Skip to content

revert(hipblaslt): remove the gfx1250v0 subtree and the asicRevision check - #15123

Open
geotseng-amd wants to merge 1 commit into
developfrom
users/geotseng/revert-gfx1250v0
Open

geotseng-amd wants to merge 1 commit into
developfrom
users/geotseng/revert-gfx1250v0

Conversation

@geotseng-amd

@geotseng-amd geotseng-amd commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : AIHPBLAS-4727
JIRA ID : AIHPBLAS-4728
JIRA ID : AIHPBLAS-4729
JIRA ID : AIHPBLAS-4730
JIRA ID : AIHPBLAS-4768
JIRA ID : AIHPSPAR-275
JIRA ID : ROCM-31226
JIRA ID : ROCM-30511

Motivation

hipBLASLt and hipSPARSELt load their GPU kernels from one directory per GPU architecture under library/. The gfx1250 chip has two hardware revisions (steppings). The early one, V0, reports the name gfx1250-strict when the ROCm runtime variable HSA_DISABLE_GFX12_STRICT is 0, and its kernels are built into library/gfx1250-strict/.

#11777 also kept a second route for V0, added in its commit 6fdee38 ("build v0 kernels for gfx1250 and pick them by ASIC revision"). That route is a third directory, library/gfx1250v0/, holding the same V0 kernels built for the gfx1250 compiler target. Both libraries picked that directory by reading the chip's revision number (hipDeviceProp_t::asicRevision) whenever V0 reported plain gfx1250. That route costs an extra TensileLite build pass (on our host the hipBLASLt build took 538 s with it and 322 s without). It also keeps a revision check in two libraries and an architecture-alias layer in TensileLite. This PR removes the route, so the name gfx1250-strict is the only thing that selects V0 kernels.

Technical Details

This PR undoes the gfx1250v0 parts of 6fdee38, which #11777 squash-merged into develop. About 30 later commits edited the same files, so git revert does not apply; the parts are undone by hand. Those later commits built XNACK support on the same helpers. XNACK is a GPU memory-retry mode named in the target string, as in gfx1250:xnack-, and that support is kept.

  • Runtime: tensile_host.cpp in hipBLASLt and hipSPARSELt is restored byte-for-byte to its form before 6fdee38. Neither library reads asicRevision now; the device name alone picks library/<name>/. rocblaslt_arch_revision.hpp and arch_revision_gtest.cpp are deleted.
  • Build: the CMake option HIPBLASLT_BUILD_GFX1250V0 and TensileCreateLibrary --gfx1250v0 are removed. -a "gfx1250;gfx1250-strict" now produces two directories instead of three.
  • TensileLite: the alias table ARCH_BUILD_ALIASES is removed, along with the helpers that existed only for it: tuningArchOf, deviceTargetFeaturesOf, withArchBuildAliases and the archRenames parameter. Toolchain/Source.py returns to its earlier output paths, which give the same result once no alias exists.
  • Install check: validate_library_layout.py is restored to its form before 6fdee38. It now reports a library/gfx1250v0/ left over in a reused install prefix, and a new test in test_validate_library_layout.py checks that.
  • Tests: 49 alias-path test cases in test_arch_steppings.py are deleted. Two tests are added. One checks that compilerTargetOf returns every target unchanged when no compiler is given. The other checks that TensileCreateLibrary passes the name gfx1250-strict to the StinkyTofu instruction scheduler, which turns on V0-only workarounds by that name.
  • Comments that called gfx1250v0 the V0 build now say gfx1250-strict.

Two behaviors change:

  • A V0 part run with HSA_DISABLE_GFX12_STRICT=1 or unset reports gfx1250. It now loads library/gfx1250/, which holds kernels for the production stepping, and prints no error. Before this PR it loaded library/gfx1250v0/, or stopped with an error if that directory was missing. V0 users must set the variable to 0 and use a package that contains library/gfx1250-strict/. TheRock packages gain that directory in ROCm/TheRock#8350, and this PR should merge after it.
  • A build that names only gfx1250 no longer compiles the gfx1250-strict tuning files, so it no longer checks them. Name gfx1250-strict, or use all, to cover them.

Other architectures are not affected.

Test Plan

Three environments. Each started from deleted build trees.

FFM simulator. FFM is a software model of an MI450-class gfx1250 GPU. These runs used ROCm 10.3.0a20261103 and compared a clean build of develop 29e5b0a059e with a clean build of this branch.

  • Build both libraries with -a "gfx1250;gfx1250-strict". Compare every code object's .text, .rodata and note sections, and its symbol list, against develop.
  • Use a V0 topology (revision 0) and a production-stepping topology (revision 2), each with HSA_DISABLE_GFX12_STRICT set to 0, set to 1, and unset (5 combinations in all). For each, record with strace which library/ subdirectory each library opens, and run 2 small tests per library. Repeat with a leftover library/gfx1250v0/ copied in, and again with library/gfx1250-strict/ removed.
  • On V0 at =0: hipblaslt-test and hipsparselt-test with --gtest_filter='*quick*'; the TensileLite config tests -m common -k "not streamk".
  • The TensileLite unit tests (-m 'unit and not gpu'), tools/scripts/tests, the rocisa adaptor's test_emission_consistency.py, and pre-commit with the root and projects/hipblaslt configs.

Real V0 hardware. One A0 GPU (ASIC Revision: 0), with ROCm 10.3.0a20261105 (the newest nightly on 2026-11-05) in a fresh venv. The run used this branch at 74ff18e9f2 and HSA_DISABLE_GFX12_STRICT=0. It followed every section of docs/gfx1250-strict-a0-install.md except 8.7, which covers the removed gfx1250v0 path.

  • Check that rocminfo, amdgpu-arch, rocm_agent_enumerator and invoke get-gpu-arch all report gfx1250-strict, and that no /opt/rocm path is left in the environment.
  • Build rocisa, StinkyTofu (and run its ctest), hipBLASLt and hipSPARSELt with -a "gfx1250;gfx1250-strict". Check the ELF machine flags, and check the layout with validate_library_layout.py.
  • Check with ldd that each test binary loads the library just built, not the copy in the ROCm SDK.
  • Run the full hipblaslt-test, *quick*, the FP4 bench and the mxf4 smoke test, the full hipsparselt-test, the tox config tests -m common -k "not streamk" (tox 4.67.4), the TensileLite unit tests, test_arch_steppings.py, tools/scripts/tests, and both pre-commit configs over 29e5b0a059e..HEAD.

Real V1 hardware. One V1 GPU (ASIC Revision: 1), with the same ROCm 10.3.0a20261105 in a fresh venv and the same sections of docs/gfx1250-strict-a0-install.md. The run used this branch after it was rebased onto develop 307f8f6d352, at 7ab98b94ce9. Compared with 74ff18e9f2, the rebase changed one test docstring, in test_r7_createlib_deep_char.py: develop's new _parseLogicFileForLibrary wrapper had been described as taking archRenames, which this PR removes. ROCr adds -strict only at revision 0, so V1 reports gfx1250 and the GPU suites run library/gfx1250/; gfx1250-strict/ is built and checked but not run.

  • Check that rocminfo, amdgpu-arch and invoke get-gpu-arch report gfx1250 at HSA_DISABLE_GFX12_STRICT set to 0, set to 1, and unset.
  • The same builds, layout check and test suites as on V0.
  • Check the libraries each binary loads two ways: ldd, and LD_DEBUG=libs on a running test, which also lists libraries opened at run time. Record with strace which library/ subdirectory hipSPARSELt opens at =0 and =1, and run the hipBLASLt smoke at =0, =1 and unset.
  • Build develop 307f8f6d352 with the same nightly in a separate worktree, and compare its code objects with this branch's.
  • Rerun any failing tox config alone, twice on this branch and once on develop. Rerun any failing hipblaslt-test case alone, 3 times on each.

Test Result

FFM simulator

  • Build: 2 TensileLite build passes instead of 3. hipBLASLt library/ holds gfx1250/ (454 files) and gfx1250-strict/ (440 files); hipSPARSELt has 131 files in each. Neither .so contains the string gfx1250v0.
  • Kernels: all 262 hipSPARSELt files are byte-identical to develop. In hipBLASLt, 874 of 894 files are byte-identical. In the other 20, only symbol names differ, because StinkyTofu adds a random 16-character suffix to labels on every build. The 20 match once that suffix is masked.
  • Loading: V0 at =0 opens gfx1250-strict/. V0 at =1 or unset, and revision 2 in both modes, open gfx1250/. All 10 runs (2 tests each) pass. A leftover gfx1250v0/ is never opened, and the install check reports 441 violations for it. With gfx1250-strict/ removed, V0 at =0 stops with Cannot read .../TensileLibrary_lazy_gfx1250-strict..., the same as develop.
  • hipblaslt-test *quick*: 18043 passed, 0 failed. hipsparselt-test *quick*: 36816 passed, 0 failed.
  • TensileLite config tests: 585 selected; 198 passed, 368 skipped (configs for other architectures), 19 xfailed (configs marked as expected failures), 0 failed. tox 4.67.5 drops the quotes in -k "not streamk" and selects nothing, so this run used the same pytest command tox builds, invoked directly.
  • TensileLite unit: 12530 passed and 7 failed. The same 7 fail on develop because of the test environment: no setuptools in the venv, HIP_PATH set in the shell, and 5 order-dependent cases in test_subtile_ds_read_emit.py. test_arch_steppings.py: 909 passed. tools/scripts/tests: 16 passed. Adaptor emission tests: 300 passed. Both pre-commit configs pass; the hipBLASLt test hook ran 12537 tests with 0 failures.

Real V0 hardware

  • Environment: all four tools report gfx1250-strict, with ASIC Revision: 0(0x0).
  • Build: hipBLASLt took 310 s with -j 128 and ran 2 TensileLite passes, [gfx1250] and [gfx1250-strict]. Files: 454 and 440. Code objects: 224 and 217, with ELF flags 0x49 and 0xEB. The layout check reports OK, and there is no gfx1250v0/ directory. hipSPARSELt took 151 s and has 131 files in each directory. StinkyTofu ctest: 1860 of 1860 passed.
  • ldd: libhipblaslt, libtensilelite-host and libhipsparselt resolve to the new build's install directories, and HIP and HSA to the 10.3.0a20261105 SDK. Both tests print Device ID 0 : ... gfx1250-strict. hipBLASLt loads library/gfx1250-strict.
  • Full hipblaslt-test: 69985 tests ran; 69784 passed, 0 failed, 201 skipped (1216 s). *quick*: 18043 passed, 0 failed.
  • FP4 bench, 256×256×512: 4 solutions, with 0 nan, 0 inf and 0 failed. mxf4 smoke: 40 passed.
  • Full hipsparselt-test: 165405 passed, 0 failed. The first 137973 tests ran in one process. The other 27432 ran in four shards on the same GPU, selected by name. The names of passing tests match --gtest_list_tests exactly: none missing, none run twice.
  • TensileLite config tests (tox 4.67.4): 585 selected; 202 passed, 368 skipped, 15 xfailed, 0 failed.
  • TensileLite unit: 12532 passed, 5 failed. The 5 are the order-dependent cases in test_subtile_ds_read_emit.py; that file passes 8 of 8 when run alone. test_arch_steppings.py: 909 passed. tools/scripts/tests: 16 passed. Both pre-commit configs: every hook Passed or Skipped, and no file changed.

Real V1 hardware

  • Environment: rocminfo, amdgpu-arch and invoke get-gpu-arch report gfx1250 at =0, =1 and unset, with ASIC Revision: 1(0x1). No /opt/rocm path or HIP_CLANG_PATH is left in the environment.
  • Build: hipBLASLt took 801 s with -j 32 and ran 2 TensileLite passes, [gfx1250] and [gfx1250-strict]. Files: 454 and 440. Code objects: 224 for target gfx1250 and 217 for gfx1250-strict. The layout check reports OK; there is no gfx1250v0/ directory, and libhipblaslt.so does not contain the string. hipSPARSELt took 127 s and has 131 files in each directory, with no gfx1250v0/. StinkyTofu ctest: 1874 of 1874 passed.
  • Kernels against develop 307f8f6d352: the file names match in both directories, and 872 of 894 files are byte-identical. The other 22 have the same instruction addresses and encodings; only the random suffixes StinkyTofu adds to local labels differ.
  • ldd: libhipblaslt.so.1 and libtensilelite-host.so.1 resolve to hipblaslt-install/lib, libhipsparselt.so.0 to hipsparselt-install/lib, and every other ROCm library to the 10.3.0a20261105 SDK; none resolves to /opt/rocm. Under LD_DEBUG=libs, one hipblaslt-test case initializes 34 shared objects, split the same way. The tox client loads libtensilelite-host.so.1 from its own build directory.
  • Loading: hipBLASLt prints Device ID 0 : ... gfx1250 and loads library/gfx1250 at =0, =1 and unset; the smoke filter passes 1152 tests at each. hipSPARSELt opens only library/gfx1250 at =0 and =1; 384 tests pass at each.
  • Full hipblaslt-test: 69848 passed, 2 failed, 206 skipped (1239 s). Both failures are nightly_matmul_fast_check_large f32 cases at 16385×16383×4097, batch 2, one TN and one TT, with wrong values in part of D. Run alone, both passed 3 times on this branch and 3 times on develop 307f8f6d352. During the full run, the TensileLite unit tests were also using the GPU. *quick*: 18043 passed, 0 failed.
  • FP4 bench, 128, 256 and 512 with K 512: 5 solutions each, with 0 nan, 0 inf and 0 failed. mxf4 smoke: 40 passed.
  • Full hipsparselt-test: 165501 passed, 0 failed (2030 s). It ran as four gtest shards (GTEST_TOTAL_SHARDS=4) on the same GPU at once: 41376, 41375, 41375 and 41375 tests.
  • TensileLite config tests (tox 4.67.4): 600 selected; 224 passed, 359 skipped, 16 xfailed, 1 failed. The failure is bf16_CLS_gfx1250.yaml, which develop added in 83c00bc1056, and it also fails on develop 307f8f6d352. Each run, one CLS solution out of 361 at (4095,4095,1,1024) had wrong values, and it was a different solution each time: 48, 78 and 66 wrong values out of 16769025 in three runs on this branch, and 844 on develop.
  • TensileLite unit: 14399 passed (not gpu) and 14405 passed (gpu), 0 failed. test_arch_steppings.py: 909 passed. tools/scripts/tests: 16 passed.
  • Pre-commit, both configs over 307f8f6d352..HEAD: every hook Passed or Skipped, and no file changed. The hipBLASLt test hook reads only staged files, and nothing was staged, so it selected no tests here; the full unit run above covers them.

Not run

  • Production-stepping hardware at revision 2. V1, at revision 1, was run.
  • V0 hardware at HSA_DISABLE_GFX12_STRICT=1 or unset, which is the behavior change; this was checked only on the simulator.
  • -a all and single-stepping builds.
  • A gfx942 or gfx950 kernel comparison.

Automated GitHub checks are pending.

Risk level

4/5. This PR changes which kernel directory a V0 part loads when HSA_DISABLE_GFX12_STRICT is not 0, in two libraries, and that change was checked only on the simulator. On real V0 hardware at =0, the full hipBLASLt and hipSPARSELt suites pass with 0 failures and load library/gfx1250-strict/. On real V1 hardware, both libraries load library/gfx1250/ at every setting of the variable, and the kernels match develop's. The full hipsparselt-test passes with 0 failures. The full hipblaslt-test had 2 failures, and both passed when rerun alone on this branch and on develop. For every other configuration, the kernels and the directory each library loads were unchanged in the measurements above.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

⏳ Waiting on Required Checks

⏳ Required checks have not all concluded yet. This bot run is exiting without failing so those checks can report independently.

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ⏳ Pending ⏳ Still running…
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⏳ Required checks are still running or have not started yet.
This PR is not ready for review until they complete.

📖 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 Nov 5, 2026 •

Copy link
Copy Markdown

⏳ Waiting for required checks to start or finish:

  • ⏳ pre-commit

…check

The V0 stepping is now served only by gfx1250-strict: with
HSA_DISABLE_GFX12_STRICT=0 it reports gfx1250-strict and loads
library/gfx1250-strict/. hipBLASLt and hipSPARSELt no longer read
hipDeviceProp_t::asicRevision, and the build no longer produces
library/gfx1250v0/ (gfx1250-strict's logic built for the gfx1250 target).

This undoes the gfx1250v0 parts of #11777 by hand; later commits touched
the same files, so a git revert does not apply. The xnack handling built
on top of it (compilerTargetOf, the xnack- capability overrides, outDirs)
is kept.

- tensile_host.cpp in hipBLASLt and hipSPARSELt, and
  validate_library_layout.py, are restored to their state before the
  gfx1250v0 change.
- HIPBLASLT_BUILD_GFX1250V0 and TensileCreateLibrary --gfx1250v0 are
  removed, and with them ARCH_BUILD_ALIASES, tuningArchOf,
  deviceTargetFeaturesOf, withArchBuildAliases and archRenames.
- The layout validator reports a library/gfx1250v0/ left in a reused
  install prefix.
- Comments that named gfx1250v0 as the V0 build now name gfx1250-strict.

Behavior changes:
- A V0 part at HSA_DISABLE_GFX12_STRICT=1 or unset reports gfx1250 and
  loads library/gfx1250/ without an error. V0 needs =0 and a package
  that ships gfx1250-strict/.
- A gfx1250-only build no longer runs --check-all on gfx1250-strict logic.

Testing (FFM, ROCm 10.3.0a20261103):
- gfx1250 and gfx1250-strict code objects match develop except for
  StinkyTofu's random label hashes; hipSPARSELt is byte-identical.
- V0 topology at =0 loads gfx1250-strict/: hipblaslt-test *quick* 18043
  passed, hipsparselt-test *quick* 36816 passed, tox Tests/common 198
  passed and 0 failed.
- TensileLite unit tests and both pre-commit configs pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
@geotseng-amd
geotseng-amd force-pushed the users/geotseng/revert-gfx1250v0 branch from 74ff18e to 7ab98b9 Compare November 5, 2026 16:45
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #15123   +/-   ##
========================================
  Coverage    77.75%   77.75%           
========================================
  Files         2904     2903    -1     
  Lines       491207   491131   -76     
  Branches     74462    74447   -15     
========================================
- Hits        381923   381869   -54     
+ Misses       84288    84266   -22     
  Partials     24996    24996           
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 53.85% <ø> (ø)
TensileLite-Unit 85.02% <100.00%> (-0.01%) ⬇️
hipBLAS 90.62% <ø> (ø) Carriedforward from 307f8f6
hipBLASLt 70.13% <100.00%> (+0.06%) ⬆️
hipCUB 82.68% <ø> (ø) Carriedforward from 307f8f6
hipDNN 87.25% <ø> (ø) Carriedforward from 307f8f6
hipFFT 42.65% <ø> (ø) Carriedforward from 307f8f6
hipRAND 76.12% <ø> (ø) Carriedforward from 307f8f6
hipSOLVER 69.67% <ø> (ø) Carriedforward from 307f8f6
hipSPARSE 87.03% <ø> (ø) Carriedforward from 307f8f6
rocBLAS 69.20% <ø> (ø) Carriedforward from 307f8f6
rocFFT 46.49% <ø> (ø) Carriedforward from 307f8f6
rocRAND 57.32% <ø> (ø) Carriedforward from 307f8f6
rocSOLVER 76.65% <ø> (ø) Carriedforward from 307f8f6
rocSPARSE 83.54% <ø> (ø) Carriedforward from 307f8f6
rocThrust 93.15% <ø> (ø) Carriedforward from 307f8f6

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

Files with missing lines Coverage Δ
...rary/src/amd_detail/rocblaslt/src/tensile_host.cpp 66.32% <100.00%> (+0.24%) ⬆️
...lt/tensilelite/tensilelite/Common/Architectures.py 87.82% <100.00%> (-0.54%) ⬇️
...slt/tensilelite/tensilelite/Common/Capabilities.py 100.00% <100.00%> (ø)
...tensilelite/tensilelite/Common/GlobalParameters.py 95.99% <ø> (ø)
.../hipblaslt/tensilelite/tensilelite/KernelWriter.py 84.94% <100.00%> (ø)
...cts/hipblaslt/tensilelite/tensilelite/LibraryIO.py 94.88% <ø> (-0.02%) ⬇️
...jects/hipblaslt/tensilelite/tensilelite/Tensile.py 83.13% <100.00%> (ø)
...tensilelite/TensileCreateLibrary/ParseArguments.py 100.00% <ø> (ø)
...ensilelite/tensilelite/TensileCreateLibrary/Run.py 90.33% <100.00%> (-0.22%) ⬇️
...t/tensilelite/tensilelite/TensileLibLogicToYaml.py 99.23% <100.00%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

🚀 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.

@hcman2

hcman2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Is it guaranteed that all V0 deployments set HSA_DISABLE_GFX12_STRICT=0? Otherwise, V0 may silently load gfx1250 kernels and produce incorrect results.

This branch has not been deployed

No deployments
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.

3 participants