Skip to content

ci(tensilelite): run the hw-common tests with pytest-xdist worksteal - #15251

Open
Alex-Vasile wants to merge 1 commit into
developfrom
users/alvasile/tl-speedup-01-hw-common-worksteal
Open

Alex-Vasile wants to merge 1 commit into
developfrom
users/alvasile/tl-speedup-01-hw-common-worksteal

Conversation

@Alex-Vasile

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

Copy link
Copy Markdown
Contributor

JIRA ID : AIHPBLAS-5255

Motivation

TensileLite's common tests generate, build and run real GEMM (matrix multiply) kernels for a set of YAML test configs. TheRock CI runs them on GPU runners as the hw-common test category, with pytest-xdist, the pytest plugin that runs tests in parallel worker processes, and 4 workers. xdist's default load scheduler hands tests out in chunks. The most expensive configs (dtv, cgemm, zgemm, bufferLoadStore0 and others) sit next to each other in collection order, so they land on one worker while the other workers go idle.

Technical Details

The hw-common category in test_categories.yaml gains --dist=worksteal in its pytest_args, with a comment that gives the reason. With worksteal, an idle worker takes queued tests from a busy one. parallel_workers stays 4. TheRock's pytest_runner.py reads this file; the change affects only that job.

This is CI configuration only. It changes which worker runs which test, not which tests run or what they check. No product code, test code or device behavior changes. The other categories, including the FFM (emulation) categories, keep their current settings.

Test Plan

From projects/hipblaslt/tensilelite:

  • pre-commit run --files test_categories.yaml checks the YAML against the repository hooks.
  • The TheRock hw-common job on this PR exercises the new scheduler. Compare its pass/fail set and wall time with a recent develop run.

Test Result

Time saved: 87 to 91 s of wall time (15.5% to 16.1%) in the CI-like build stage of the common tests (--build-only --gpu-targets gfx942, -n 4, cache cleared first), with worksteal at 475 s (1 run) against the default load scheduler at 566 and 562 s (2 runs). Both were measured on the original unsplit branch with the same tree, on a gfx942 (MI300X) host with the process bound to 25 cores and OMP_NUM_THREADS=25. That tree also deselected configs that opt out of the target architecture (146 tests), which this branch does not include. The run stage (--use-cache) saved nothing.

Scheduler Wall time (s)
load (default) 566, 562
load --maxschedchunk=1 527, 546
load --maxschedchunk=2 527, 528
load --maxschedchunk=4 585, 600
worksteal 475 (one run)

Idle worker time was 123 worker-seconds with worksteal against about 516 with load. Every run had the same outcome: 145 passed and 1 known failure (comm/gfx950/fused_a2a). The run stage took 747 and 736 s against 751 and 746 s, because a per-GPU lock serializes client runs. The hw-common job builds and runs in one pass, and that combined mode was not measured.

Not yet run on this branch. Automated GitHub checks are pending.

Related

  • Work tracking: AIHPBLAS-5255
  • #14605 already runs the unit-test categories with --dist=worksteal; this PR applies the same scheduler to hw-common.
  • #14798 raised the declared minimum to pytest-xdist>=3.2, the first version with worksteal.

Device / Architecture Coverage

CI configuration only; no kernel, client or GPU behavior changes. Passing PR checks are sufficient, provided they include the TheRock hw-common job that reads this setting.

Submission Checklist

Risk level

Low (2/5): changes only how the hw-common job distributes tests across its 4 workers; test selection and verdicts are unchanged. worksteal needs pytest-xdist 3.2 or later, which develop already requires.

@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 ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 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 Nov 6, 2026 •

Copy link
Copy Markdown

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

@Alex-Vasile
Alex-Vasile force-pushed the users/alvasile/tl-speedup-01-hw-common-worksteal branch from fd6736a to 2abe42c Compare November 6, 2026 18:24
@Alex-Vasile Alex-Vasile removed NoCI Don't run CI ci:skip Skip all CI builds/tests for this PR labels Nov 6, 2026
Adds --dist=worksteal to the hw-common category of test_categories.yaml (TheRock's tensilelite-common job) so idle xdist workers take the queued expensive configs of busy ones. Measured on the CI-like build stage; scheduling only.

@tony-davis tony-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alex! I'm really happy to see this stack. A real speedup for the common tests is something I think a lot of folks will feel right away, and the descriptions make the layers easy to follow.

This one looks good to me. I checked that TheRock's pytest_runner.py appends pytest_args as-is next to --numprocesses, and that develop already requires pytest-xdist>=3.2 (#14798), so --dist=worksteal should reach the hw-common job the way you describe. The stack is one commit behind develop with no file overlap, so I don't see a rebase concern.

A few small things, none blocking:

  • The CI evidence is still pending. The Linux Multi-Arch stages hadn't reached the tensilelite-common job when I looked, and that's the only place this change does anything. Once it runs on gfx942 and gfx950, I'd love to see the wall time next to a recent develop run in the Test Result. The 475 s number is one run of the build-only stage on a different tree, so I bet the combined build-and-run number will be the one people quote later.
  • Two comments explain the same thing. The block at the top of test_categories.yaml already explains worksteal for quick and standard. I think extending that block to say hw-common uses it too (for the expensive-config reason) would keep the explanation in one place. Small thing.
  • The therock-pr-bot red is stale. It ran at 18:38, saw a pre-commit run that was cancelled by the 18:43 push, and hasn't re-evaluated. pre-commit passes on the current head. A bot re-run should clear the Not ready to Review label on the PRs above this one.

For the description, I'd suggest leading the Test Result with what was measured and where, then the number. Something like:

Measured on the original unsplit branch, not this one, on a gfx942 (MI300X) host bound to 25 cores. Only the build stage was timed (--build-only --gpu-targets gfx942, -n 4, cache cleared). worksteal took 475 s in one run. The default load scheduler took 566 s and 562 s in two runs, so about 16% less wall time. Idle worker time fell from about 516 to 123 worker-seconds. All runs had 145 passes and 1 known failure (comm/gfx950/fused_a2a). That tree also deselected 146 configs that opt out of the target architecture, which this branch does not.

The run stage (--use-cache) did not change, because a per-GPU lock serializes client runs. The hw-common job builds and runs in one pass, and that combined mode was not measured. Automated GitHub checks are pending.

Thanks for doing this!

@codecov

codecov Bot commented Nov 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   #15251      +/-   ##
===========================================
- Coverage    78.10%   78.10%   -0.00%     
===========================================
  Files         3007     3007              
  Lines       522272   522272              
  Branches     81514    81514              
===========================================
- Hits        407876   407874       -2     
  Misses       85449    85449              
- Partials     28947    28949       +2     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 53.88% <ø> (-<0.01%) ⬇️
TensileLite-Unit 85.07% <ø> (-<0.01%) ⬇️
hipBLAS 90.62% <ø> (ø) Carriedforward from e3c0247
hipBLASLt 70.07% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from e3c0247
hipDNN 87.33% <ø> (ø) Carriedforward from e3c0247
hipFFT 42.65% <ø> (ø) Carriedforward from e3c0247
hipRAND 76.12% <ø> (ø) Carriedforward from e3c0247
hipSOLVER 69.67% <ø> (ø) Carriedforward from e3c0247
hipSPARSE 87.03% <ø> (ø) Carriedforward from e3c0247
rocALUTION 82.89% <ø> (ø) Carriedforward from e3c0247
rocBLAS 69.20% <ø> (ø) Carriedforward from e3c0247
rocFFT 46.49% <ø> (ø) Carriedforward from e3c0247
rocRAND 57.32% <ø> (ø) Carriedforward from e3c0247
rocSOLVER 76.66% <ø> (ø) Carriedforward from e3c0247
rocSPARSE 83.66% <ø> (ø) Carriedforward from e3c0247
rocSPARSE-unit 79.57% <ø> (ø) Carriedforward from e3c0247
rocThrust 93.15% <ø> (ø) Carriedforward from e3c0247

*This pull request uses carry forward flags. Click here to find out more.
see 2 files 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.

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.

2 participants