Hardware Test Plan — PR #678 fix(ignition): expose current_source_roots and propagate source roots to tuning replicas
Head: 90b0d31 · 5 files, +136/−20 (production +18/−8) · fix/spawn-propagate-source-roots → main
1. Bottom line for the test engineer
Book cn5. Do not book cn7. Total ask: one CPU pass plus two short 2-GPU runs (well under one GPU-hour).
The decisive finding is that there is no speedup to measure. Nothing in this PR touches a hot path, and no performance claim is made anywhere in the PR body. More importantly, the bug it is titled after is already fixed on main:
- PR #670 merged (
2acc3f3a, included incc0a49d2). It already added_peer(..., extra_roots=())(ignition/preparation/rank_group.py:44-45) andwith bind_source_roots(extra_roots):around the prepare block (rank_group.py:60-74), andprepare_groupalready passes the roots into the spawn args (rank_group.py:309-310, identical onmainand at the PR head). - This PR's two edits in that path are a behavior-neutral refactor: it only swaps a private import for the new public accessor —
rank_group.py:295-297andaot.py:845-847change_EXTRA_ROOTS.get()→current_source_roots(), andsource_identity.py:17-19is a three-line accessor returning the sameContextVarvalue.
So the entire behavioral delta of this PR is one thing: tuning_replicas._replica gains a required 8th positional argument and binds source_roots around replica preparation (tuning_replicas.py:142,153,158,174-176,190-194). And the PR itself discloses that this is inert today: _replica calls prepare(..., compile_forwards=False) (:160) and exits on TuningComplete (:162-165), and ForwardCache is constructed only under if compile_decoder: in ignition/preparation/capture.py:117-118. I verified no in-tree replica path reaches ForwardCache, source_identity() or current_source_roots().
Consequence: hardware testing cannot demonstrate that this PR fixes anything, because on main nothing is broken in the paths it touches. Hardware testing can only do two useful jobs: (a) confirm the changed _replica signature does not regress a real spawn with real CUDA/CoreStorage, and (b) confirm no regression in TP-peer compiled-forward reuse end-to-end. That is exactly the scope of the plan below — and it is deliberately small.
2. Machine selection
| Machine | Verdict | Why |
|---|---|---|
| cn5 (4 × RTX PRO 6000 Blackwell Max-Q, 96 GiB, 48 CPU, 125 GiB RAM) | Use it | SM120, inside the supported matrix (AGENTS.md:3: SM103/SM120/SM121; the repo's own ForwardCache test stub uses "SM120"). Four GPUs is exactly enough for either spawn path. Homogeneous SKU, so tuning_devices' same-SKU rule is satisfied. |
| cn7 (1 × GB10, arm64, 10 CPU, 60 GiB) | Skip | Both spawn loops are gated on world size. prepare_group spawns peers over range(1, len(config.devices)) (rank_group.py:304) — with one GPU that loop is empty. tuning_devices (ignition/cli/preparation.py:84-107) returns tuning_gpus=() unless there are ≥ 2 × world_size GPUs, and replicas = len(tuning_gpus) // world_size with a spawn loop of range(1, replicas) (tuning_replicas.py:177,187) — so no replica process is ever created. cn7 cannot execute a single line of the changed code. |
Also not reproducible on this fleet: the author's "4-GPU mixed-SKU (Max-Q + Workstation)" evidence. cn5's product name is literally "RTX PRO 6000 Blackwell Max-Q Workstation Edition" ×4 — one SKU. If mixed-SKU validation matters it needs a different rig; do not pretend cn5 covers it.
3. The plan
Step 0 — CPU spawn gate (0 GPUs, ~2 min, run on cn5)
No CI run exists on 90b0d31; the "36 passed" figure is author-reported. This is the cheapest check in the whole plan and it covers more of the change than any GPU run.
cd /repo && git checkout 90b0d315953e453c8438f0129cc5173d01fcb731
CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest \
tests/preparation/test_forward_cache_sources.py -q # the changed tests
CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest \
tests/preparation tests/cli -q # blast radius
Must include (do not accept skips silently — per AGENTS.md:306, report a skip as an unrun check):
test_current_source_roots_reflects_active_scope— nesting/reset of the new accessor.test_prepare_group_propagates_source_roots_to_spawned_peers— realspawn, assertsrank1["cache_root"] == rank0["cache_root"] != baseline(test_forward_cache_sources.py:122-123).test_prepare_recipe_propagates_source_roots_to_spawned_tuning_replica— Linux-gated (:210), stubs CUDA/CoreStoragein the child, asserts the same for replicas (:244-245).
Why this is not redundant with GPU work: these are the only tests that assert the invariant the PR exists to protect — equal ForwardCache.root across a spawn boundary — and they assert it directly. The GPU runs below cannot assert it cheaply, because no in-tree recipe reads the roots in a replica.
Also confirm the private-symbol claim holds: git grep _EXTRA_ROOTS must show hits only in ignition/preparation/source_identity.py.
Step 1 — TP=2 peer spawn with a real external-recipe CLI (2 GPUs, ~15 min, cn5)
Purpose: end-to-end confirmation that two spawned peers build an identical ForwardCache root with real CUDA/Inductor, i.e. that the accessor swap in aot.py:845-847 did not disturb the copy already merged via #670. Expected to pass on both the PR head and main — this is a no-regression run, not a fix demonstration.
Pre-flight (5 min, no GPU): this bug is only reachable through an external recipe CLI calling ignition.cli.main(..., source_roots=...) (ignition/cli/__init__.py:364-372); core ignition has no in-tree recipes (pyproject.toml does not depend on hyperflare_recipes; AGENTS.md:382-387). So:
- Install the external recipe package into the venv and confirm
python -c "import hyperflare_recipes"works —mp.get_context("spawn")re-imports the recipe module in the child, so a package visible only throughsource_rootspaths will fail before any GPU work. rg "_replica|_peer" <recipe-package>— if the external package callstuning_replicas._replicapositionally with 7 args, the new required 8th parameter breaks it with aTypeError. This is the single realistic backward-compat risk in the diff; resolve it on paper, not on GPU.
Run (a minimal driver script is required, since core ignition binds ()):
# external-recipe entrypoint, ~20 lines
from ignition.cli import main
from hyperflare_recipes.recipes import RECIPES # the real package tuples
raise SystemExit(main(["export", "<model>", "--gpus", "0,1",
"--compile-workers", "12"],
recipes=RECIPES, prog="hyperflare",
source_roots=(("hyperflare_recipes", RECIPE_DIR),)))
export CUDA_VISIBLE_DEVICES=0,1
mkdir -p /scratch/flare/kernels # cn5 gives only 16 GiB scratch; keep ~/.cache/flare off it
ls /scratch/flare/kernels/forwards 2>/dev/null | wc -l > /tmp/before
bash repro.sh (not opened) 2>&1 | tee /tmp/run1.log
ls /scratch/flare/kernels/forwards | wc -l > /tmp/after
Pass criteria (all boolean, no benchmarking):
- Both ranks complete; no
FileNotFoundErrorresolving rank 0's cache-relativepathsunder a rootlessself.root(aot.py:1239), and no"bound source root ... does not exist"(aot.py:848-850). - Exactly one new
forwards/<hash>directory appears — a second directory means the ranks hashed different roots. This is the single cheapest, most direct hardware assertion of the property; a divergent root forks the cache. - Repeat the export once against the warm cache: the second launch restores (
bound.cache_hit,aot.py:1243) rather than recompiling, and adds no newforwards/<hash>directory.
Step 2 — tuning-replica spawn with the changed signature (2 GPUs, ~20 min, cn5)
Purpose: the only genuinely new code. Confirm the required extra_source_roots argument survives real spawn pickling and that with source_roots(...), CoreStorage(...) around prepare(...) (tuning_replicas.py:158) runs against real CUDA and real CoreStorage — which the CPU test stubs out (test_forward_cache_sources.py:199-207).
Pick the cheapest valid layout: world_size=1, two tuning GPUs. tuning_devices (ignition/cli/preparation.py:94,107) requires the tuning list to start with the serving GPUs and be a whole number of replicas; --gpus 0 --tuning-gpus 0,1 gives replicas=2, so exactly one _replica process spawns (tuning_replicas.py:187). That is all the coverage the change needs.
export CUDA_VISIBLE_DEVICES=0,1
bash repro.sh (not opened) --gpus 0 --tuning-gpus 0,1 2>&1 | tee /tmp/run2.log
Pass criteria:
- Exactly one
flare-tuning-1child reachesTuningComplete; parent reports no"tuning replica ... exited with"(tuning_replicas.py:200-202) and no"a tuning replica continued beyond kernel preparation"(:165). --verboseshows the replica'sForwardCache.root, when it builds one, equal to rank 0's — or, today, simply that the replica prepared without the root-binding path raising.- Child exits 0 under the same
source_rootsbinding; if you can, add a one-line debug print ofcurrent_source_roots()in the replica entry and confirm it is non-empty (this is the propagation actually crossingspawn, on real hardware).
If a 4-GPU run is preferred instead, use --gpus 0,1 --tuning-gpus 0,1,2,3 (replicas=2, still one child) — it adds TP=2 + replicas in one shot but costs 4 GPUs for no additional code coverage. Treat this as optional, not the default.
Step 3 — do not run
- Serving throughput / latency benchmarks. Nothing on the serving hot path changes;
source_roots/current_source_rootsare CLI-invocation-scoped, andForwardCache.__init__already rglobs two whole source trees (aot.py:837-844), so one extra small recipe tree is noise. A tokens/s number here would measure nothing. - Memory measurements. Only an immutable
tuple[tuple[str, Path], ...]crosses the spawn boundary; no new locks, threads, or allocations. ignition join/ multi-host. Out of scope and already correct —joinruns insidemain(...)'sbind_source_roots(ignition/cli/__init__.py:364-372) andhost_ranks.serve_peerruns in-process withoutmp.spawn. Ran on cn5 alone it would also be meaningless; there is no second host.- cn7. See §2.
- Combined 4-GPU TP=2 + tuning replicas, unless Steps 1–2 both pass and a maintainer asks.
4. Measurement guidance
There is no speedup claim to validate, so do not build a benchmark. The one quantity worth recording is the cache-fork count from Step 1 (forwards/<hash> directories created per launch), because it is the only directly observable hardware consequence of the property under test — divergent roots fork the cache and silently recompile. Record it as a raw number with the command that produced it (AGENTS.md:512-513); do not produce an audit bundle.
5. Cost and risks
- Budget: one 2-min CPU pass, two ~15–20 min runs on 2 GPUs each. Under ~1 GPU-hour total. Nothing here needs 4 GPUs.
- 16 GiB scratch on cn5 is the real risk.
~/.cache/flare/kernelsplus the HF hub cache plus the checkpoint must fit. Verify checkpoint sizes and pre-download before booking GPUs; a mid-run disk-full will look like aFileNotFoundErrorand be misread as the bug under test. - cn5 is homogeneous SM120, so it can validate root agreement but cannot reproduce the mixed-SKU failure the PR's author-reported evidence relied on (and which depends on unmerged #597's cache-root check — that check does not exist on
main,aot.py:1043-1046only agrees forward catalog keys). - Pre-flight beats re-runs: the two checks in Step 1 (external package importable in a spawned child; no 7-arg positional
_replicacaller) are the realistic failure modes and cost no GPU time.
6. What the testing will and will not establish
Will establish: the changed _replica signature works under real spawn with real CUDA and CoreStorage; TP=2 peers still agree on the compiled-forward cache after the accessor swap; no observable regression in the two spawn paths.
Will not establish: that this PR fixes the stated bug — #670 already merged that fix, and the replica-side propagation is inert by the PR's own disclosure. If the team's goal is to validate a fix, the honest answer is that there is nothing left for hardware to fix-verify here, and the merge decision should rest on the CPU tests (90b0d31 has no CI run), the code-encapsulation value, and the ownership/merge-order question against #670 — not on a GPU run.
Recommendation: run Step 0 unconditionally (it is free and its absence is the PR's biggest open gap); run Steps 1–2 only if maintainers want positive evidence for the external-recipe TP and tuning-replica paths before merge. If GPU time is scarce, Step 0 plus Step 2 is the highest-value subset — Step 2 is the only run that touches new behavior.