Skip to content

[hipBLASLt] Fix JIRA ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests#8868

Draft
sajandhy wants to merge 1 commit into
developfrom
users/sajandhy/rocm-3139-fast-tf32-fp32-gfx942
Draft

[hipBLASLt] Fix JIRA ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests#8868
sajandhy wants to merge 1 commit into
developfrom
users/sajandhy/rocm-3139-fast-tf32-fp32-gfx942

Conversation

@sajandhy

@sajandhy sajandhy commented Jun 26, 2026

Copy link
Copy Markdown

Downgrade HIPBLAS_COMPUTE_32F_FAST_TF32 to HIPBLAS_COMPUTE_32F when XF32 is unsupported on gfx942, and add a smoke gtest that compares the two compute modes on MI300-class hardware.

Motivation
On gfx942 (MI300-class), HIPBLAS_COMPUTE_32F_FAST_TF32 was silently routing FP32 GEMM through a lower-precision path, producing results that diverged from HIPBLAS_COMPUTE_32F. This fixes ROCM-3139 by ensuring FAST_TF32 requests use full FP32 compute on gfx942 when XF32 is not supported.

Technical Details
Add rocblaslt_internal_supports_xf32_compute() returning false on gfx942.
In hipblasLtMatmulDescCreate(), downgrade HIPBLAS_COMPUTE_32F_FAST_TF32 → HIPBLAS_COMPUTE_32F when XF32 is unsupported.
Gate XF32 heuristic selection in tensile_host.cpp on the same capability check.
Add HipblasltTf32Precision.smoke_FastTf32MatchesFullFp32OnGfx942 gtest: runs the same FP32 NN GEMM with both compute types and requires outputs to match within 1e-4. The smoke_ prefix ensures TheRock PR CI (--gtest_filter=smoke) runs it on gfx942; skipped on other arches.
Link GTest::gmock in clients/CMakeLists.txt (required by existing matrix_transform_gtest.cpp matchers).
Files changed: hipblaslt.cpp, rocblaslt_auxiliary.cpp, rocblaslt-auxiliary.h, tensile_host.cpp, hipblaslt_tf32_precision_gtest.cpp, client CMakeLists.

Test Plan
Build host lib + clients only: invoke build -ca gfx942 -c -d -t
Point device libs at in-tree install: HIPBLASLT_TENSILE_LIBPATH=/lib/hipblaslt/library/gfx942
Run targeted gtest: hipblaslt-test --gtest_filter='HipblasltTf32Precision'
CI: TheRock smoke gtest lane on gfx942 hardware

Test Result
HipblasltTf32Precision.smoke_FastTf32MatchesFullFp32OnGfx942 PASS on gfx942 (MI308X) with patched libhipblaslt.so
Pre-fix stock library reproduced the bug (max diff ~0.37); post-fix max diff 0.0
Submission Checklist

Downgrade HIPBLAS_COMPUTE_32F_FAST_TF32 to HIPBLAS_COMPUTE_32F when XF32 is
unsupported on gfx942, and add a smoke gtest that compares the two compute
modes on MI300-class hardware.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sajandhy sajandhy changed the title Fix ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests [hipBLASLt] Fix ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests Jun 26, 2026
@therock-pr-bot

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ❌ Fail Error: Title does not follow Conventional Commits style.
Expected: start with a valid type (feat, fix, docs, …).
Desired format: type(optional-scope): short description
───
Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
JIRA ID : TESTAUTO-6039
JIRA ID - #330
JIRA ID #330
ISSUE ID : TESTUTO-3334
ISSUE ID #3334
ISSUE ID - TESTAUTO-3433
ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Closes #10
Fixes octo-org/octo-repo#100
Resolves: #123
#123
https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
Forbidden Files ✅ Pass
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/hipblaslt/clients/tests/src/hipblaslt_tf32_precision_gtest.cpp, projects/hipblaslt/library/src/amd_detail/hipblaslt.cpp, projects/hipblaslt/library/src/amd_detail/rocblaslt/include/rocblaslt-auxiliary.h, projects/hipblaslt/library/src/amd_detail/rocblaslt/src/rocblaslt_auxiliary.cpp, projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp; no test file found
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 2 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@sajandhy sajandhy changed the title [hipBLASLt] Fix ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests [hipBLASLt] Fix JIRA ROCM-3139: use full FP32 on gfx942 for FAST_TF32 requests Jun 26, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cts/hipblaslt/library/src/amd_detail/hipblaslt.cpp 16.67% 3 Missing and 2 partials ⚠️
...rary/src/amd_detail/rocblaslt/src/tensile_host.cpp 0.00% 1 Missing and 1 partial ⚠️

❌ Your project status has failed because the head coverage (76.92%) 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    #8868      +/-   ##
===========================================
- Coverage    71.34%   71.34%   -0.00%     
===========================================
  Files         2613     2613              
  Lines       408997   409006       +9     
  Branches     61114    61115       +1     
===========================================
+ Hits        291772   291777       +5     
- Misses       95826    95829       +3     
- Partials     21399    21400       +1     
Flag Coverage Δ *Carryforward flag
TensileLite 76.98% <ø> (ø) Carriedforward from 1ec66f2
hipBLAS 90.81% <ø> (ø) Carriedforward from 1ec66f2
hipBLASLt 41.37% <41.67%> (+0.01%) ⬆️
hipCUB 82.68% <ø> (ø) Carriedforward from 1ec66f2
hipDNN 86.79% <ø> (ø) Carriedforward from 1ec66f2
hipFFT 50.17% <ø> (ø) Carriedforward from 1ec66f2
hipRAND 76.12% <ø> (ø) Carriedforward from 1ec66f2
hipSOLVER 69.18% <ø> (ø) Carriedforward from 1ec66f2
hipSPARSE 86.55% <ø> (ø) Carriedforward from 1ec66f2
rocBLAS 48.08% <ø> (ø) Carriedforward from 1ec66f2
rocFFT 46.30% <ø> (ø) Carriedforward from 1ec66f2
rocRAND 57.07% <ø> (ø) Carriedforward from 1ec66f2
rocSOLVER 76.92% <ø> (ø) Carriedforward from 1ec66f2
rocSPARSE 72.37% <ø> (ø) Carriedforward from 1ec66f2
rocThrust 91.36% <ø> (ø) Carriedforward from 1ec66f2

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...c/amd_detail/rocblaslt/src/rocblaslt_auxiliary.cpp 68.22% <100.00%> (+0.06%) ⬆️
...rary/src/amd_detail/rocblaslt/src/tensile_host.cpp 41.68% <0.00%> (-0.01%) ⬇️
...cts/hipblaslt/library/src/amd_detail/hipblaslt.cpp 47.38% <16.67%> (-0.16%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants