fix(hiptensor): reject batched contraction with a shared A/B/D mode as NOT_SUPPORTED - #10826
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
…rd trinary create, log mode as char
evedovelli
left a comment
There was a problem hiding this comment.
@harkgill-amd Would it be possible adding a couple of unit tests to verify that the batched contraction properly returns NOT_SUPPORTED for binary and trinary contractions?
Added the following three test cases,
All are self-explanatory and pass various inputs to trigger either the Tested all of these on a gfx942/MI300A system w/ the latest TheRock nightlies + hipTensor build from source. All tests pass as expected. |
evedovelli
left a comment
There was a problem hiding this comment.
Thank you so much for adding the tests! I've left one last ask, if you have the time to work on it. The changes look good for me but I'll leave to @Ryker0627 for approving.
Ryker0627
left a comment
There was a problem hiding this comment.
It looks good to me. Thank you for the time and effort you put into this!
fix(hiptensor): reject batched contraction with a shared A/B/D mode as NOT_SUPPORTED (#10826) ## Motivation Resolves ROCm/legacy-rocm-build#6559. ## Technical Details On hipTensor 2.3.0, a conventional batched contraction ``` D[b,m,n] = sum_k A[b,m,k] * B[b,k,n] ``` accepts valid descriptors and returns `HIPTENSOR_STATUS_SUCCESS` from every hipTensor call, but produces numerically incorrect output. Check for batched contraction (see below) and return HIPTENSOR_STATUS_NOT_SUPPORTED until further support is added. ``` std::set<int32_t> setB(modeBV.cbegin(), modeBV.cend()); std::set<int32_t> setD(modeDV.cbegin(), modeDV.cend()); for(int32_t m : modeAV) if(setB.count(m) && setD.count(m)) ``` ## Test Plan Build patched libhiptensor from source (develop @ 2.4.0, against nightly CK) on an MI300A (gfx942) node, then run two cases on real hardware: 1. Batched contraction -> expect NOT_SUPPORTED after patch. 2. Non-batched GEMM -> expect unchanged SUCCESS. ## Test Result - With patch applied, batched contraction correctly returns as not supported meanwhile, non batched GEMMs see no change as expected. ## Submission Checklist - [X] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
…s NOT_SUPPORTED (#10826) ## Motivation Resolves ROCm/legacy-rocm-build#6559. ## Technical Details On hipTensor 2.3.0, a conventional batched contraction ``` D[b,m,n] = sum_k A[b,m,k] * B[b,k,n] ``` accepts valid descriptors and returns `HIPTENSOR_STATUS_SUCCESS` from every hipTensor call, but produces numerically incorrect output. Check for batched contraction (see below) and return HIPTENSOR_STATUS_NOT_SUPPORTED until further support is added. ``` std::set<int32_t> setB(modeBV.cbegin(), modeBV.cend()); std::set<int32_t> setD(modeDV.cbegin(), modeDV.cend()); for(int32_t m : modeAV) if(setB.count(m) && setD.count(m)) ``` ## Test Plan Build patched libhiptensor from source (develop @ 2.4.0, against nightly CK) on an MI300A (gfx942) node, then run two cases on real hardware: 1. Batched contraction -> expect NOT_SUPPORTED after patch. 2. Non-batched GEMM -> expect unchanged SUCCESS. ## Test Result - With patch applied, batched contraction correctly returns as not supported meanwhile, non batched GEMMs see no change as expected. ## Submission Checklist - [X] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Motivation
Resolves ROCm/legacy-rocm-build#6559.
Technical Details
On hipTensor 2.3.0, a conventional batched contraction
accepts valid descriptors and returns
HIPTENSOR_STATUS_SUCCESSfrom every hipTensor call, but produces numerically incorrect output.Check for batched contraction (see below) and return HIPTENSOR_STATUS_NOT_SUPPORTED until further support is added.
Test Plan
Build patched libhiptensor from source (develop @ 2.4.0, against nightly CK) on an MI300A (gfx942) node, then run two cases on real hardware:
Test Result
Submission Checklist