-
Notifications
You must be signed in to change notification settings - Fork 38
Fix CK grouped-GEMM fallback for fused wgrad accumulation (BF16 in / FP32 out) #701
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
Open
sudhu2k
wants to merge
6
commits into
dev
Choose a base branch
from
sudhu/ck_ggemm_fusewgrad_fix
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a0a7884
Support FP32 accumulation in multi-tensor GEMM for 16-bit inputs
sudhu2k 517e8ba
Clarify supported dtype combinations in multi-tensor GEMM comment
sudhu2k 3b0eeba
Add grouped GEMM test suite for CK backend with fallback detection
sudhu2k 1637b2b
Assert CK grouped GEMM does not fall back to hipBLASLt for supported …
sudhu2k 6774018
Move CK grouped GEMM tests to dedicated test file
sudhu2k 53561fd
Remove unwanted includes
sudhu2k 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 hidden or 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
Oops, something went wrong.
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.
Corresponding GEMMTestSuite needs to be added to test_cublas_gem
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.
There are no grouped GEMM tests in
test_cublaslt_gemm.cucurrently, it's the single GEMM test suite. Would it be more natural to put these with the existing grouped GEMM tests? Two options:test_grouped_gemm.cu, or following the pattern intest_ck_grouped_mxfp8.cu(which already has a fallback detection); orTransformerEngine/tests/pytorch/test_grouped_linear.py
Lines 301 to 302 in ebbd623
For the fallback-detection pattern, the restored test in restore test_grouped_gemm_unaligned pytest #703 could be reused
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.
I was originally thinking of adding the tests to
test_grouped_gemm.cubut I noticed that we currently remove that file from testing inTransformerEngine/tests/cpp/operator/CMakeLists.txt
Lines 38 to 47 in ebbd623
So I've added the tests to test_cublas_gemm.cu itself, since the groupedgemm implementation is part of the cublaslt_gemm.cu file.
I can create a test_ck_grouped_gemm.cu file, and add it there, but let me know!
The .cu tests that I've added already checks and fails if the test falls back to hipblasLT multi-stream grouped gemm.
Uh oh!
There was an error while loading. Please reload this page.
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.
I think test_grouped_linear_accuracy_rocm_backends pytest is more suited to test this PR's scenario on the module level. I've added a similar fallback detection pattern that one of your test uses in 3b0eeba
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks! Not sure if we need to keep the new C++ tests in addition to the pytest ones, but I'll defer to @ipanfilo and you on that.
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.
test_grouped_gemm.cu is for grouped_gemm API. while this PR is for multi_tensor_gemm. I think it is more appropriate to make test_ck_grouped_gemm based on test_ck_grouped_mxfp8
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.
Moved the test to test_ck_grouped_gemm.cu in 6774018
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.
Hi @ipanfilo, could you please take a quick look at this PR again? Thanks!
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.
Well, I mean repurpose test_ck_grouped_mxfp8 to be more generic. Sorry for confusion, it can be separate PR