Updated client code to handle A/B=0 for General Batched GEMM and added corresponding tests#8412
Merged
Merged
Conversation
…d corresponding test
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (77.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #8412 +/- ##
===========================================
+ Coverage 65.05% 65.17% +0.12%
===========================================
Files 2597 2597
Lines 403820 404619 +799
Branches 60162 60333 +171
===========================================
+ Hits 262683 263693 +1010
+ Misses 121909 121088 -821
- Partials 19228 19838 +610
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
nakajee
reviewed
Jun 15, 2026
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The GEMM kernel implementation in hipBLASLt initializes the SrdA and SrdB from AddressA and AddressB values passed into the kernel as arguments for each workgroup but the dereferencing of the addresses in SrdA and SrdB only happens when alpha != 0. But with General Batched GEMM, the AddressA and AddressB is pointer to a pointer array on the device side. In order to initialize the SrdA and SrdB, the AddressA and AddressB needs to be dereferenced before the alpha != 0 check. This gap was exposed by rocblas batched gemm bad args tests. The PR at #8082 has a dependency on this fix.
Technical Details
When K = 0, the size of A and B matrices will be 0 as well. We have two scenarios which can happen here for the bad args:
Test Plan
hipBLASLt didn't have a test for this earlier. Added a new test with K=0 and the client code for General Batched GEMM checks the size of A and B matrices to decide if it should pass the pointer array or just nullptr into the kernel. This mimics the rocblas test's behavior.
Test Result
All tests are passing locally
Submission Checklist