test(rccl): gate build time against the PR's base commit - #9890
Open
alex-breslow-amd wants to merge 1 commit into
Open
test(rccl): gate build time against the PR's base commit#9890alex-breslow-amd wants to merge 1 commit into
alex-breslow-amd wants to merge 1 commit into
Conversation
The absolute 5-minute threshold only means something on hardware close to what it was tuned on: a clean single-arch build is ~50s on a 256-core host but would blow the budget on a small runner. A ratio does not have that problem, so add --compare-base, which builds the merge-base and the head on the same runner and fails when the head is more than --max-regression-pct slower. Three things keep it from being flaky. Runs alternate between base and head so slow drift does not land on one side. The minimum across --repeat rounds is the estimator, since build-time noise is one-sided. And ccache is forced off, because a warm cache would let the second build finish instantly and quietly invalidate the comparison; RCCL does not enable it but TheRock CI does. This mode times the head anyway, so it also enforces the absolute budget and replaces the separate precheckin entry rather than adding a second one. The gate goes from one build to four, about 6 minutes. Measured on gfx950 at -j 64: a test-only change reads -0.1% and the eight days of develop that slowed gfx950 from 1:19 to 1:30 reads +13.8%. With min-of-2 the four raw readings spanned 0.1s on 90s, so a 10% limit sits well clear of the noise. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Stacked on #9889 — review that one first. This PR's diff is a single commit; the base will retarget to
developautomatically once #9889 merges.Why
The absolute 5-minute threshold added in #9889 only means something on hardware close to what it was tuned on. A clean single-arch build is about 50s on a 256-core host but would blow the same budget on a small runner, so the number needs re-tuning per machine class.
A ratio does not have that problem.
--compare-basebuilds the PR's merge-base and its head on the same runner and fails when the head is more than--max-regression-pctslower.Keeping it honest
Three things stop this from being a flaky test:
CCACHE_DISABLE=1rather than trusting the surrounding configuration.Folded into the existing gate
The comparison times the head build anyway, so it also enforces the absolute budget. That replaces the precheckin entry from #9889 instead of adding a second one, so there is still a single "RCCL Build Time" suite. The two checks are independent: with an artificially small budget a run failed with
took 1:30.16, over the 0:10.00 budgetwhile its delta was a healthy −0.7%.Measurements
All on gfx950 at
-j 64, through the precheckin harness:develop(1:19 → 1:30)The four raw readings in the last passing run spanned 0.1s on 90s, and two separate harness runs both landed on −0.1%. A 10% limit therefore sits well clear of the noise on this class of runner; it could go lower later if the data holds on the real CI hardware.
Cost
Four builds instead of one, 365s measured. Because it replaces the previous 92s entry, the net addition to precheckin is roughly 4.5 minutes.
Test plan
mypy --strictcleantest_runner.py(365s, exit 0)Made with Cursor
Coverage is scoped to the toolchain it runs under
Worth stating plainly, since it bounds what this gate can promise: it only catches regressions that reproduce under the compiler the runner uses. Precheckin builds against the local
/opt/rocminstall, so a regression that only manifests on another toolchain will pass here.This is not hypothetical. #9756 fixed a
ce_reduce.cctranslation unit that took ~48 minutes to compile on the srock toolchain, caused by LLVM's runtime loop-unroller auto-unrolling a rank loop by up to 64x. Measured against/opt/rocm7.0.2.1 on gfx950, the same pre-fix file compiles in 2.63s (confirmed from ninja's per-edge log on a full clean build), and this gate scores the fix at -0.0% — 90.38s before, 90.37s after. The pathological unroll simply does not happen with that clang, so there was never anything here to catch.Two consequences for reviewers:
/opt/rocm, perf(rccl): split ce_reduce into per-kernel TUs to fix ~48min build time #9756 takesce_reducefrom one 2.63s job to 42 jobs totaling 30.64s of CPU — roughly 12x the aggregate work — while wall clock is unchanged (83.80s vs 83.77s) because-j 64has slack to absorb it. That is the right trade against a 48-minute serialized job, but on a core-starved runner the same split could cost wall clock instead of saving it.