-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Unity][Cutlass] Fix C source generation of dense operation #16476
Merged
+4
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if bias is used in the pattern (func name), it should exist in the annotation. cc @yelite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is pattern with bias but doesn't have annotation? IIUC this code path is shared between relax and relay. @creaiter can you share sample where the bias parameter isn't generated correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yelite
Sorry for the delayed response.
I tested this before the merge of
unity
branch intomain
.When I tried to rebuild tvm with the newest branch, there was an issue from the cutlass_fpA_intB_gemm 3rdparty, that
error: identifier "__hfma2" is undefined
.This error seems related with the setting of the compute compatibility version of nvcc, and I temporally resolved it by adding the code
set(CMAKE_CUDA_ARCHITECTURES "native")
at thetvm/CMakeLists.txt
file. (Figuring out this took some time.)Here is a minor question that have you encountered the same error and how did you resolve it?
For the bias issue of dense operation, when I tried to compile the below module with cutlass backend,
there were some errors at the generated .cu file.
At the following generated code, I'm suspicious about the
${bias_arg}
parts.After applying this PR, above error was resolved for me.
Actually, I'm not familiar with this tvm project. So you can feedback me, if what I changed is the wrong part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/apache/tvm/blob/main/cmake/modules/CUDA.cmake#L47
We have a default value
CMAKE_CUDA_ARTECTURES
here, does that work? Right now it requires cuda arch >= 53 to compileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vinx13
It seems test_cutlass.py#L549 is testing the dense_bias modules.
If the test case means dffierent thing, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, now I see the CUDA.cmake#L47.
In my case, the
CMAKE_CUDA_ARCHITECTURES
is already defined as 52. Thus, it is not changed to native.(I compiled with cmake version 3.28.1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems bias_arg_idx only annotated in relax, so partition_for_cutlass is broken in relay