Repository navigation
perf(tensilelite): compile the benchmark helper kernels once, xnack-agnostic - #15287
Draft
Alex-Vasile wants to merge 1 commit into
Conversation
Alex-Vasile
force-pushed
the
users/alvasile/tl-speedup-37-helper-xnack-agnostic
branch
from
November 6, 2026 18:24
3ee6795 to
8a481b3
Compare
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
…gnostic Benchmark Kernels.cpp is compiled for the bare architecture instead of both xnack+ and xnack- (xnack+ kept with -fsanitize=). Helper artifact names and --use-cache keys change, so old caches miss.
Alex-Vasile
force-pushed
the
users/alvasile/tl-speedup-37-helper-xnack-agnostic
branch
from
November 6, 2026 18:45
8a481b3 to
077bf8b
Compare
|
🎉 All checks passed! This PR is ready for review. |
1 task done
This branch has not been deployed
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.
JIRA ID : AIHPBLAS-5256
Motivation
Each TensileLite benchmark step compiles
Kernels.cpp, the C++ source of its helper kernels, with clang. XNACK is a GPU memory-fault replay feature; clang can build code for it on (xnack+), off (xnack-) or for either ("xnack-agnostic", the bare name such asgfx950). Benchmark and test builds compiled every helper kernel twice, once forgfx950:xnack+and once forgfx950:xnack-, which is half of the helper compile. The helper compile was 1,008 s (39.1%) of a gfx950 per-config build aggregate. Shipped libraries already build their helpers for the bare architecture, and the runtime looks for that file first.Technical Details
BenchmarkProblems.cmdLineArchsFor(archNames, isaInfoMap, compiler)now returns the bare architecture for every instruction set architecture (ISA) instead of its 2 xnack variants. This covers every architecturegfxVariantMaplists: gfx906, gfx908, gfx90a, gfx942 and gfx950. A step's library then holdsKernels.so-000-<arch>.hsacoinstead of the-xnack+and-xnack-files. A requested stepping still wins, as before.When the source compiler's default arguments include
-fsanitize=..., the target is<arch>:xnack+on architectures that have that variant, as the library build does for ASAN, the address sanitizer. Tensile's own benchmark toolchain is not built that way today. Both callers passsrcToolchain.compiler.cmdLineArchsForalso feeds the benchmark step cache key and the helper-kernel cache key. Existing--use-cacheartifacts and helper-cache entries therefore miss once and are rebuilt.Tests: new
Tests/unit/test_benchmark_helper_targets.py(20 cases), and 3 test files' fake source toolchains gain a compiler withdefault_args.Test Plan
Run from
projects/hipblaslt/tensilelite:tox -e unit -- tensilelite/Tests/unit/test_benchmark_helper_targets.py tensilelite/Tests/unit/test_benchmark_steps_one_pool.py tensilelite/Tests/unit/test_tensile_backend_config.py tensilelite/Tests/unit/Ductilechecks one target per architecture, the sanitizer rule, steppings, a single--offload-archin the compile command and the changed cache key.pre-commit run --fileson the changed files checks formatting and lint.Test Result
Time saved: 3.26-12.26 s of build wall time per config (13.6-38.0%) on 4 gfx950 configs, and 8.27 s (39.6%) on 1 gfx942 build; the helper compile itself about halves. Measured on the original unsplit branch against the commit before it,
--build-onlyof 1 config at a time on the gfx950 (MI355X) host, cold helper cache, 25 cores, mean of 2 runs per side (gfx942 target: 1 run per side). Per config:gsuasb(gfx950)gemm_bias_strided_batched_gfx940(gfx950)spmm_bf16_sb(gfx950)bf16_gradient_bias(gfx950)gemm_bias_strided_batched_gfx940(gfx942, build only, 1 run)-xnack+object: every function's disassembly, the code-object metadata (except the target and build ID) and every kernel descriptor identical. Only the ELF xnack flag changes. Other artifact members were byte-identical;cache.yamldiffers only in the helper file names.--use-cache) of the 4 gfx950 configs: all pass, and all 27 client processes opened onlyKernels.so-000-gfx950.hsaco. With the parent, the client first failed to open that file, printedhipModuleLoad failed, then loaded-xnack-.hsaco.gsuasbartifacts missed the cache with this change, were rebuilt and passed. The full Python unit suite: 0 failed.Not yet run on this branch. Automated GitHub checks are pending.
Related
Device / Architecture Coverage
This changes the compile targets of the benchmark helper kernels on gfx906, gfx908, gfx90a, gfx942 and gfx950. On xnack-off GPUs the benchmark client now runs xnack-agnostic helper code instead of the
-xnack-object: a few mores_noppadding instructions, as shipped libraries already run. The runtime effect was not measured. The overlay requires CI coverage on the affected archs, gfx942 and gfx950 at least. An arch that is only built counts as uncovered.Submission Checklist
Risk level
Medium (3/5): benchmark and test helper kernels change target and file name, and existing benchmark caches miss once. Shipped library builds are unchanged. The helper code's runtime on xnack-off hosts was not measured.