perf(packaging): build independent ROCm wheels concurrently #9598
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 584 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.381
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9598"
general
weight: 0.35
nunnikri
Motivation
setup.py bdist_wheelone at a time. On a full Linux nightly the device batch is 30 wheels, and the host batch is core, profiler, and libraries. Those packages do not depend on each other, and zip DEFLATE inside one wheel stays single-threaded, so the wait is between packages.Issue ID: https://github.com/ROCm/TheRock/issues/3161
Technical Details
build_packagestakesmax_workers(default 3) and runs one setuptools process per staged package, capped by the number of packages in the batch.rocmstays an sdist androcm-sdk-develstays a single package, so those batches remain one worker.build_python_packages.pypasses the same count through--wheel-build-workers. Workflows do not pass the flag, so Linux and Windows portable Python jobs pick up the default._build_package_workeris the single-package invocation. The one-package path calls it directly. Several packages submit it to a thread pool. A failure cancels the futures that have not started and re-raises.Test Plan
BuildPackagesConcurrencyTest.test_builds_independent_packages_concurrently— two packages,max_workers=2, bothsetup.pyprocesses start before either finishestest_rejects_nonpositive_workers—max_workersbelow 1 raisestest_split_batches_device_packages_for_parallel_build— the device batch receiveswheel_build_workersROCm/rockrelrun 40423604075, 17 families) with this branchROCm/rockrelrun 40607843845,gfx94X-dcgpu;gfx90a;gfx950-dcgpu) on a medium runner and on a larger runnerTest Result
aws-linux-scale-rocm-prodfinished. The wheel phase there was about 5 minutes shorter than one-at-a-time on that runner (host wall 131s vs 296s sequential, device wall 94s vs 221s).Test Runs:
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name=ProgId content=OneNote.File>
<meta name=Generator content="Microsoft OneNote 15">
</head>
<body lang=en-US style='font-family:Calibri;font-size:11.0pt'>
<!--StartFragment-->
<div style='direction:ltr'>
Optimization | What we tried | Result | Decision
-- | -- | -- | --
Overlap independent wheels | 1, 2, 4, and 8 package workers. One bdist_wheel is one zlib stream, so the tarball worker formula does not apply. | Local gfx942: 7m 18s at 1 worker, 6m 25s at 2, 4, and 8. Only the 3 host wheels overlap; device and devel stay one package. Early multi-arch CI: 13m 37s at 1 (35669455108), 11m 51s at 2, 10m 39s at 8. | Proceed with approach. Default is 3. More than 3 cannot beat the longest device wheel.
Stored zip (--no-wheel-compression) | Workers 1, compression off. | Wall 3m 9s vs 7m 18s. Device / devel / core grew from 1.7 GiB / 673 MiB / 408 MiB to 2.4 GiB / 2.9 GiB / 1.4 GiB. | Approach not used. Pip wheels must stay zip DEFLATE.
DEFLATE level 1 vs default ~6 | Forced compresslevel 1. Hook checked on text first. | Wall 7m 18s both. Wheel bytes identical, devel −3 KiB. | Do not add a level flag.
</div>
<!--EndFragment-->
</body>
</html>
Submission Checklist