Skip to content

docs(tensilelite): add the timing measurement scripts, results and write-ups - #15291

Draft
Alex-Vasile wants to merge 2 commits into
users/alvasile/tl-speedup-40-helper-chunk-cachefrom
users/alvasile/tl-speedup-41-timing-results-and-notes
Draft

Alex-Vasile wants to merge 2 commits into
users/alvasile/tl-speedup-40-helper-chunk-cachefrom
users/alvasile/tl-speedup-41-timing-results-and-notes

Conversation

@Alex-Vasile

@Alex-Vasile Alex-Vasile commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : AIHPBLAS-5255

Motivation

The TensileLite common tests build GPU kernels for each YAML test config and then run them through tensilelite-client, the C++ program that runs and validates generated kernels. The changes below this one in the stack speed up both stages. This PR keeps the before and after timings of those changes and the scripts to measure a before and after again. It is meant to stay a draft, as a reference for reviewers of the other PRs.

Technical Details

All files are new and sit under projects/hipblaslt/tensilelite/timing_runs/. Nothing in the build, CI or tests reads them, and no existing file changes.

  • Timing aggregates: 8 AGGREGATE_analysis.txt files, each the sum of one per-config pass (every config built or run on its own, with timers on), written by scripts/aggregate_timing.py. gfx950: full_runs_gfx950/baseline_build/ and baseline_run/ (before), after_run/ (after the run-stage changes) and after_build/ (after the build-stage changes). gfx942: full_runs_gfx942/pre_build/ and pre_run/ (before), post_build/ and post_run/ (after).
  • Scripts, in full_runs_gfx950/, used on both GPUs: split/run_split.sh (the CI-like pass: whole build stage, then whole run stage, 4 pytest-xdist workers), per_config/run_per_config_build.sh and per_config/run_per_config.sh (the per-config passes), and measure_env.sh, which they all read for paths, caches, GPU target, cores and GPU. before_after/run_side.sh runs one side of a before/after comparison through all 3 passes, and before_after/compare_aggregates.py prints 2 aggregates side by side.
  • run_split.sh takes DIST, the pytest-xdist scheduler (default worksteal, as the hw-common CI category uses), and CLEAR_RUN_CACHE (default 0: the run stage keeps the cache the build stage left). The CI-like numbers below were measured with DIST=load and CLEAR_RUN_CACHE=1.

The PR's first commit also added the exploratory runs, the investigation and decision notes and the write-ups; the second commit removes them, so they stay in the history.

How to read these results

Each result set was measured at one commit of the original, unsplit branch users/alvasile/new_test_client ("commit N" is its position among that branch's 109 commits, 8149ff02ff2d..bb98b8d3b0bb). The last column names the PRs of this stack that hold the same code changes.

Result set Code measured (original-branch commit) Equivalent point in this stack
gfx950 before: baseline_build/, baseline_run/ (184 configs) Commit 35, 289f976d5a52; its code equals commit 20 Part of #15256 (the timers of commits 2-20) and all of #15262. None of the other PRs.
gfx950 after the run-stage changes: after_run/ (185 configs) Commit 75, a9221990f377 #15255 to #15278, except commit 97 (the last commit of #15265) and commits 100, 103 and 105 of #15256. None of #15251-#15254 or #15279-#15290.
gfx950 after the build-stage changes: after_build/ (185 configs) Commit 94, bcf018e67fd0; the first 25 configs at commit 92, 55f2c5569f5a. The client is commit 75's; no client source changed between 75 and 94. The previous row plus #15252, #15253, #15281-#15285, #15286 without commit 106, and #15287-#15290
gfx942 before: pre_build/, pre_run/ (123 configs) Commit 36, aa19af72bc03; its code equals commit 20 Same as gfx950 before
gfx942 after: post_build/, post_run/ (123 configs) Commit 98, c1345541ac0c #15252-#15290, except #15279, #15280, commit 106 of #15286, and commits 100, 103 and 105 of #15256

Reading notes:

How to time a change

Build one msgpack-only client per side, from that side's source tree:

cmake --preset tensilelite -S <tree>/projects/hipblaslt -B <build> -G "Unix Makefiles" \
  -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=gfx942 \
  -DCMAKE_CXX_COMPILER=/usr/bin/amdclang++ -DCMAKE_C_COMPILER=/opt/rocm/bin/amdclang \
  -DHIPBLASLT_ENABLE_YAML=OFF -DTENSILELITE_ENABLE_CLIENT=ON -DTENSILELITE_BUILD_TESTING=OFF \
  -DTENSILELITE_CLIENT_ENABLE_ROCPROFSDK=OFF
cmake --build <build> -j --target tensilelite-client

Then start both sides at the same time, each on its own 25 cores and GPU, so that both see the same host load:

S=projects/hipblaslt/tensilelite/timing_runs/full_runs_gfx950/before_after
ROOT=/scratch/cmp TL=<before tree>/projects/hipblaslt/tensilelite \
  CLIENT=<before build>/tensilelite/client/tensilelite-client \
  GPU_TARGET=gfx942 CORES=0-24 GPU=0 bash $S/run_side.sh before &
ROOT=/scratch/cmp TL=<after tree>/projects/hipblaslt/tensilelite \
  CLIENT=<after build>/tensilelite/client/tensilelite-client \
  GPU_TARGET=gfx942 CORES=48-72 GPU=4 bash $S/run_side.sh after &
wait
python $S/compare_aggregates.py /scratch/cmp/before/build /scratch/cmp/after/build
python $S/compare_aggregates.py /scratch/cmp/before/run /scratch/cmp/after/run

Each side's CI-like stage times are in /scratch/cmp/<side>/split/times.txt. The per-config passes cover the configs whose run passed in either side's CI-like pass. If the "before" tree is older than the timers you compare, set ANALYZE_DIR to the "after" tree's scripts/ directory so both sides are read by the same analyzer.

Test Plan

Run from projects/hipblaslt/tensilelite:

  • pre-commit run --files on the added files checks whitespace, line endings and the hooks that apply to shell and Python.
  • bash -n on the shell scripts checks their syntax.
  • compare_aggregates.py on the gfx942 per-config data reproduces the comparison table removed from this PR.

Test Result

Time saved: none by this branch; it adds documentation, reports and scripts only. The headline numbers below measure the whole stack, not this PR.

All numbers are wall times of the CI-like pass (-n 4, timers off), measured on the original unsplit branch on shared hosts. Each run used 25 cores reserved with taskset, OMP_NUM_THREADS=25 and 1 GPU.

gfx942 (MI300X). Before and after ran at the same time on different sockets and GPUs, 1 sample each:

Measurement Before After Change
Build stage 1,028 s 634 s -38%
Run stage 1,494 s 742 s -50%

gfx950 (MI355X). Before and after ran back to back in the same session, each on an idle GPU. For the build stage, "after" is the point after the build-stage changes; for the run stage, the point after the run-stage changes:

Measurement Before After Change
Build stage 616.5 s 535.5 s -13.1%
Run stage 2,445 s and 2,499 s 941 s and 943 s -61.5% and -62.3%

On the added scripts: pre-commit passed, bash -n passed, and compare_aggregates.py reproduced the gfx942 build comparison row for row. The scripts were not run end to end on this branch. Automated GitHub checks are pending.

Related

  • Work tracking: AIHPBLAS-5255

Device / Architecture Coverage

Documentation, generated reports and hand-run scripts only. No product code, test, CI configuration or GPU behavior changes, so passing PR checks are sufficient.

Submission Checklist

Risk level

Low (1/5): docs, data and hand-run scripts only; nothing builds, runs or is tested differently.

@Alex-Vasile Alex-Vasile added NoCI Don't run CI ci:skip Skip all CI builds/tests for this PR labels Nov 6, 2026
@Alex-Vasile
Alex-Vasile added this pull request to stack #15292 November 6, 2026 17:39
@Alex-Vasile
Alex-Vasile force-pushed the users/alvasile/tl-speedup-41-timing-results-and-notes branch from e30640d to c1cc9e4 Compare November 6, 2026 18:24
@therock-pr-bot

therock-pr-bot Bot commented Nov 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/tensilelite/timing_runs/full_runs_gfx950/before_after/compare_aggregates.py; 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?

…ite-ups

One draft-only branch with everything the speed-up work measured and wrote down (78 files, 15,982 lines): the hand-run measurement scripts (16 files, 598 lines; measure_env.sh makes paths, caches, GPU target and cores overridable), the generated analyze_timing / aggregate_timing outputs of six campaigns (43 files, 9,206 lines: first gfx942 runs, gfx950 per-config, gfx950 baseline / after-run / after-build, gfx942 before and after), and the hand-written notes (19 files, 6,178 lines: test-client-plan.md, CI_SPLIT_TIMING.md, the gfx950 investigations, DECISIONS.md, DEFERRED.md, the before/after write-ups, the gfx942 README and FURTHER_SPEEDUPS.md). Nothing in the build, CI or tests reads these files.
@Alex-Vasile
Alex-Vasile force-pushed the users/alvasile/tl-speedup-41-timing-results-and-notes branch from c1cc9e4 to 150dcfe Compare November 6, 2026 18:45
@therock-pr-bot

therock-pr-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

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

…heir scripts

Keep the 8 per-config timing aggregates of the before and after points
(gfx950 baseline, after the run-side changes and after the build-side
changes; gfx942 before and after) and the scripts that reproduce them.
Remove the exploratory runs, the early gfx950 passes, the investigation
and decision notes, the write-ups, the test-outcome lists, the comparison
tables, the split times and the other scripts (66 files). They stay in
the parent commit's history.

Add before_after/run_side.sh, which runs one side of a before/after
timing (CI-like split, shared config list, per-config build and run),
and before_after/compare_aggregates.py, which prints two per-config
aggregates side by side; it reproduces the removed gfx942
build_comparison.txt from the same data. run_split.sh gains DIST
(pytest-xdist scheduler, default worksteal as in the hw-common CI
category) and CLEAR_RUN_CACHE (default 0: the run phase keeps the cache
the build phase left); the removed split numbers were measured with
DIST=load and CLEAR_RUN_CACHE=1.

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.

1 participant