Skip to content

fix(hipblaslt): take the e5m3 software path on gfx1250-strict - #13136

Merged
jichangjichang merged 1 commit into
ROCm:developfrom
geotseng-amd:users/geotseng/develop-e5m3
Oct 6, 2026
Merged

jichangjichang merged 1 commit into
ROCm:developfrom
geotseng-amd:users/geotseng/develop-e5m3

Conversation

@geotseng-amd

@geotseng-amd geotseng-amd commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #11777 ("hipblaslt: add support for gfx1250-strict build").

Motivation

#11777 made eight source guards that tested only __gfx1250__ accept __gfx1250_strict__ too, because compiling for gfx1250-strict predefines only the latter. Two of those guards enable the hardware e5m3 conversion. That was valid with the compiler #11777 was tested on (10.2.0a20260930), but the compiler has since changed.

The hipBLASLt client build for gfx1250-strict fails on ROCm nightlies from 10.2.0a20261004:

error: '__builtin_amdgcn_cvt_pk_fp8_f32_e5m3' needs target feature fp8e5m3-insts

ROCm/llvm-project 7667f52dd687 cherry-picks llvm/llvm-project#227861 ("Disable e5m3 conversions on gfx1250-strict", LCOMPILER-2845). It moves FeatureFP8E5M3Insts out of the common gfx1250 feature set, so gfx1250-strict (v0) no longer has the e5m3 conversion instructions. hipblaslt_e5m3.h and DataTypes_E5M3.hpp still enable the hardware fast path for both __gfx1250__ and __gfx1250_strict__, as #11777 left them.

This PR makes the strict build work again on current nightlies and keeps it working on older ones.

Technical Details

HIP_E5M3_CVT_FAST_PATH is now enabled for __gfx1250__ only, in both copies of the header:

  • projects/hipblaslt/library/include/hipblaslt/hipblaslt_e5m3.h
  • projects/hipblaslt/tensilelite/include/Tensile/DataTypes_E5M3.hpp
-#if (defined(__gfx1250__) || defined(__gfx1250_strict__)) && __HIP_DEVICE_COMPILE__
+// gfx1250-strict (v0) has no e5m3 conversion instructions; it takes the software path.
+#if defined(__gfx1250__) && __HIP_DEVICE_COMPILE__
 #define HIP_E5M3_CVT_FAST_PATH 1
  • gfx1250-strict: takes the existing software conversion. This is also correct on nightlies up to 20261003. Their compiler still accepted the e5m3 builtins on strict, but v0 has no such instructions.
  • gfx1250 (v1): unchanged. It keeps the hardware v_cvt_pk_fp8_f32, and the condition evaluates the same for it as before.
  • The remaining guards from hipblaslt: add support for gfx1250-strict build #11777 (memory_gfx.h, the float4/bfloat6/float6 headers, mxDataGenerator) are unchanged. They still accept both names, and the client and libraries build with them on every nightly from 20260930 to 20261006.
  • Tensile kernels: not affected. TensileLite emits no e5m3 conversion, and the strict library tree assembles on 20261004 to 20261006.
  • Not covered: the other changes in the same cherry-pick (#227426, #227475) re-enable v_cvt_scale_pk8/pk16 on strict in their block32 forms. hipBLASLt and hipSPARSELt do not use these instructions or the HIP FP4/FP6 headers, so they need no change here.
  • Still not addressed, as listed in hipblaslt: add support for gfx1250-strict build #11777: on a v0 part with HSA_DISABLE_GFX12_STRICT unset or 1, the device reports gfx1250. The HIP kernels compiled into libhipblaslt and the clients then load their gfx1250 builds, which keep the hardware e5m3 path. This change does not alter that. It covers only the gfx1250-strict builds.

Test Plan

  • Compile the real client TU (hipblaslt_init_device.cpp, flags from compile_commands.json) for gfx1250 and gfx1250-strict, with the original and the new headers, on every nightly from 20260930 to 20261006.
  • Clean builds of hipBLASLt and hipSPARSELt, clients included (install.sh -c -a "gfx1250;gfx1250-strict"), on every nightly from 20260930 to 20261006, then verify the library layout.
  • Full test pass on gfx1250 (v1), ROCm 10.2.0a20261005, following gfx1250-strict-testing.md:
    • hipblaslt-test (all, and *quick*)
    • FP4 bench and mxf4 smoke
    • hipsparselt-test
    • TensileLite unit, arch-stepping and packaging tests
    • tox Tests/common
    • pre-commit (hipBLASLt and repo root configs)

Test Result

  • Client TU compile:
    • Original headers fail on gfx1250-strict for 20261004, 20261005 and 20261006.
    • With this change, both targets build on every nightly from 20260930 to 20261006.
  • Clean builds, 20260930 to 20261006: rc=0 on every nightly.
    • hipBLASLt: 400 / 397 / 400 files for gfx1250 / gfx1250v0 / gfx1250-strict, layout OK.
    • hipSPARSELt: 131 files in each subtree.
  • gfx1250 (v1), ROCm 10.2.0a20261005:
Suite Result
hipblaslt-test all 67569 passed, 0 failed, 34 skipped
hipblaslt-test *quick* 18043 passed
FP4 bench / mxf4 smoke 345 solutions, no nan / passed
hipsparselt-test 165405 / 165405 passed
TensileLite unit, arch-stepping, packaging passed
tox Tests/common 9642 passed, 1 failed
pre-commit, both configs passed

The one tox failure is gsu_gfx1250 (BF16 GSU, size 512x512x1x32767, Relu). It is flaky and unrelated to e5m3. Of three reruns on an idle GPU, two passed and one failed, and the failing kernel differs between runs.

The tests ran on develop d116965bed9 plus this change. The branch is rebased onto develop 9db04770489. The 3 commits in between touch only rocALUTION and rocSPARSE.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning 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/library/include/hipblaslt/hipblaslt_e5m3.h, projects/hipblaslt/tensilelite/include/Tensile/DataTypes_E5M3.hpp; no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

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

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@geotseng-amd

Copy link
Copy Markdown
Contributor Author

All tests passed and have been verified on the v1 machine.

## Problem

The client build for gfx1250-strict fails on ROCm nightlies from
10.2.0a20261004:

    error: '__builtin_amdgcn_cvt_pk_fp8_f32_e5m3' needs target feature
    fp8e5m3-insts

ROCm/llvm-project 7667f52dd687 (llvm-project #227861, "Disable e5m3
conversions on gfx1250-strict") moved FeatureFP8E5M3Insts out of the
gfx1250 common feature set, so gfx1250-strict (v0) no longer has the e5m3
conversion instructions. hipblaslt_e5m3.h and DataTypes_E5M3.hpp enabled
the hardware fast path for both __gfx1250__ and __gfx1250_strict__.

## Fix

Enable HIP_E5M3_CVT_FAST_PATH for __gfx1250__ only. gfx1250-strict takes
the existing software conversion, which is also correct on older nightlies
(up to 20261003), whose compiler still accepted the e5m3 builtins on strict
but where v0 has no such instructions. gfx1250 (v1) code is unchanged and
keeps the hardware v_cvt_pk_fp8_f32.

## Testing

- Compile of the real client TU (hipblaslt_init_device.cpp) for gfx1250
  and gfx1250-strict: the original headers fail on strict for 20261004,
  20261005 and 20261006; with this change both targets build on every
  nightly from 20260930 to 20261006.
- Clean hipBLASLt and hipSPARSELt builds with -a "gfx1250;gfx1250-strict"
  on nightlies 20260930 to 20261006: rc=0, library layout OK.
- On gfx1250 (v1), ROCm 10.2.0a20261005:
  - hipblaslt-test all: 67569 passed, 0 failed, 34 skipped
  - hipblaslt-test *quick*: 18043 passed
  - FP4 bench: 345 solutions, no nan; mxf4 smoke passed
  - hipsparselt-test: 165405 / 165405 passed
  - TensileLite unit, arch-stepping and packaging tests passed
  - tox Tests/common: 9642 passed, 1 failed (gsu_gfx1250, BF16 GSU; flaky,
    passes on rerun, and the failing kernel differs between runs)
  - pre-commit (hipBLASLt and repo root configs): passed
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #13136      +/-   ##
===========================================
+ Coverage    72.12%   72.14%   +0.02%     
===========================================
  Files         2861     2861              
  Lines       472089   471234     -855     
  Branches     69803    69773      -30     
===========================================
- Hits        340449   339944     -505     
+ Misses      107910   107578     -332     
+ Partials     23730    23712      -18     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 49.02% <ø> (ø)
TensileLite-Unit 83.28% <ø> (ø)
hipBLAS 90.62% <ø> (ø) Carriedforward from a6c8eb0
hipBLASLt 38.65% <ø> (ø) Carriedforward from a6c8eb0
hipCUB 82.68% <ø> (ø) Carriedforward from a6c8eb0
hipDNN 86.64% <ø> (ø) Carriedforward from a6c8eb0
hipFFT 54.32% <ø> (ø) Carriedforward from a6c8eb0
hipRAND 76.12% <ø> (ø) Carriedforward from a6c8eb0
hipSOLVER 68.96% <ø> (ø) Carriedforward from a6c8eb0
hipSPARSE 86.99% <ø> (ø) Carriedforward from a6c8eb0
rocBLAS 48.25% <ø> (ø) Carriedforward from a6c8eb0
rocFFT 48.78% <ø> (ø) Carriedforward from a6c8eb0
rocRAND 57.45% <ø> (ø) Carriedforward from a6c8eb0
rocSOLVER 76.83% <ø> (ø) Carriedforward from a6c8eb0
rocSPARSE 74.93% <ø> (+0.17%) ⬆️ Carriedforward from a6c8eb0
rocThrust 93.15% <ø> (ø) Carriedforward from a6c8eb0

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

Files with missing lines Coverage Δ
...pblaslt/library/include/hipblaslt/hipblaslt_e5m3.h 0.00% <ø> (ø)
🚀 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.

@geotseng-amd
geotseng-amd force-pushed the users/geotseng/develop-e5m3 branch from 8a1b00d to 79ab6b3 Compare October 6, 2026 07:13
@geotseng-amd
geotseng-amd enabled auto-merge (squash) October 6, 2026 07:14
@jichangjichang
jichangjichang merged commit 30064a9 into ROCm:develop Oct 6, 2026
33 of 34 checks passed
@marbre

marbre commented Oct 13, 2026

Copy link
Copy Markdown
Member

Even though there was no update posted by the bot, the PR was included in a recent submodule bump and is part of TheRock.

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.

4 participants