Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the generated CUTLASS code #2

Closed
YukeWang96 opened this issue Jan 9, 2022 · 7 comments
Closed

Check the generated CUTLASS code #2

YukeWang96 opened this issue Jan 9, 2022 · 7 comments

Comments

@YukeWang96
Copy link

Is there any way to check/print the generated CUTLASS code?

@masahi
Copy link
Owner

masahi commented Jan 9, 2022

If you run test_cutlass.py, you will see generated cutlass code under the tmp directory (check lib0.cu file)

@YukeWang96
Copy link
Author

It works in test_cutlass.py.
However, when I want to figure out which statement that generate the *.cu, I use the following code

lib = relay.build(mod, target, params=params)
lib = build_cutlass_kernels(lib, sm=75,  tmp_dir="./tmp", lib_path="compile.so")

It will only keep the *.o files while no *.cu under the tmp/ , am I missing something?

@masahi
Copy link
Owner

masahi commented Jan 10, 2022

I think this should be export_library() call at

https://github.com/apache/tvm/blob/6d35f0bbdf656d393b0722cb93cd213217781c9d/python/tvm/contrib/cutlass/build.py#L353

This is where we dump the .cu file and invoke nvcc.

@YukeWang96
Copy link
Author

I also found that when I comment out tune_cutlass_kernels such as https://github.com/apache/tvm/blob/4babd36481b7108bf50df5c3b256c95c0d9c3291/tests/python/contrib/test_cutlass.py#L181-L183 there will be no .cu file generated.

@YukeWang96
Copy link
Author

Finally, I figure out the reason: The annotated needs to identify the operators that will be lowering to CUTLASS backend.
Thanks!

@masahi
Copy link
Owner

masahi commented Jan 11, 2022

You are welcome to join tlcpack slack (aka TVM slack) if you want more high-bandwidth communication with me or others. The invitation link is below.

https://join.slack.com/t/tvmai/shared_invite/zt-foemgff5-9pC0jateEAdpoZImfxxMew

@YukeWang96
Copy link
Author

Sure, will do. Thanks for your nice suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants