Explore report · NVIDIA/hyperflare-inference #678

Raw Markdown for agents: https://autobot.eidonix.com/p/293e6065-45a3-47c1-b039-ab47c9e0dd07.md

Case file — PR #678 "fix(ignition): propagate bound source roots to spawned rank and replica processes"

https://github.com/NVIDIA/hyperflare-inference/pull/678 · author brandonmmusic-max (CONTRIBUTOR, Discord "Brandonmusic") · head e72ec0d · base main · opened 2026-12-02 10:57 · open, "ready for review", 0 comments, 0 reviews, no CI checks on the head commit · 4 files, +233 / −91.

Key findings

  1. A priority contributor's open PR already contains the same core fix. #670 (lukealonso, open, 2026-12-02 00:26) makes exactly the rank_group.py change #678 leads with: "#678's What changed" bullet 2 and #670's "TP peer source-root propagation (ignition/preparation/rank_group.py)" describe the same prepare_group → _peer → source_roots(...) edit (ignition/preparation/rank_group.py:44-59, 295-311). #670's own Autobot review asked for a CPU test for that fix and suggested splitting the rank_group fix into its own PR; #678 looks like that split but cites neither #670 nor the review. Neither PR references the other; both are open on the same lines, so merge order decides which one duplicates the other. #678's genuine additions over #670: current_source_roots() (source_identity.py:17-19), the tuning_replicas.py replica propagation (:142, :158, :174-176, :190-194), and three new tests.
  2. The failure mode named in the description does not exist on main. The PR says peer ranks "fail the cache-root agreement check in ForwardCache._prepare_ranks". _prepare_ranks (ignition/preparation/aot.py:1023-1295) has no cache-root comparison — its only agreement checks are about forward catalogs (aot.py:1045-1046, 714-715) and kernel inventory (ignition/preparation/inductor_tuning.py:236-279). A root mismatch on main surfaces as the peer resolving cache-relative paths under its own self.root (aot.py:855) → FileNotFoundError/cache miss, which is how #597 and #670 describe it. The fail-fast check is added by the author's other open PR #597, whose SM120 same-SKU/mixed-SKU rig is also exactly the rig #678 cites as end-to-end evidence. #678 does not cite #597.
  3. Multi-host peers are still unbounded and are not declared as out of scope. The only source_roots bindings in the tree at the PR head are ignition/cli/init.py:364-370, rank_group.py:59, tuning_replicas.py:158. ignition join (ignition/cli/serve.py:528-549, source_identity() at :546), HostRendezvous._admit's identity comparison (host_ranks.py:270-271) and serve_peer/RemoteSource (host_ranks.py:629-657) never bind roots, so a multi-host export launched from an external recipe CLI still fails identity agreement and still splits the ForwardCache key. The body limits itself to "spawned tensor-parallel peer processes" and "local tuning replicas", so this matches the letter of the description, but the headline benefit ("same-SKU multi-GPU exports") should not be read as covering multi-host. Open PRs #668 and #675 are the work on that peer path; neither propagates source roots.
  4. Undeclared gaps: _replica resolves/imports the recipe (_resolve_recipe, tuning_replicas.py:155 → :128-139) before entering source_roots(...) at :158; the new tests assert ContextVar visibility rather than equal ForwardCache.root/source_identity(); and peer-written rebuild metadata (rebuild_manifest.py:327) now records rank 0's identity instead of a rootless one. None of the three is in the body or the "limitations" paragraph.
  5. Size is misleading: rank_group.py's +91/−85 is almost entirely re-indentation of _peer's ~80-line body (aot.py:59 wrap); the semantic additions across the three source files are one 3-line function plus argument plumbing (~13 lines).

The change

Plain terms: the preparation code hashes the recipe source tree into cache keys and identity digests. External recipe repos tell ignition about their directories via ignition.cli.main(..., source_roots=...), which binds a ContextVar named _EXTRA_ROOTS (ignition/cli/init.py:364-370 → source_identity.py:12-30). multiprocessing "spawn" children do not inherit ContextVars, so the peer ranks and tuning replicas hashed nothing. This PR captures the binding in the parent and re-enters it in the child.

Verified, per file (at head e72ec0d):

Load-bearing consumers the diff does not touch (they are why the binding matters): ForwardCache.__init__ mixes every *.py under each bound root into the cache key and sets self.root = root/'forwards'/key.hexdigest() (aot.py:845-855, including a ValueError for a bound root that is not a directory); source_identity() mixes (*_EXTRA_ROOTS.get(), *extra_roots) into the digest (source_identity.py:33-54, :48, :112-113); rebuild_manifest.from_plan records source_identity() (rebuild_manifest.py:327).

What the description says that the change does not fully do: it frames the bug as a ForwardCache._prepare_ranks agreement failure (see Key finding 2) and implies broader "same-SKU multi-GPU" coverage than the two local-spawn paths actually deliver. What the change does beyond the description: nothing in behaviour, but the description omits the rebuild_manifest identity consequence and the _resolve_recipe ordering gap.

The why

The defect is real and structural: external recipe packages can only be hashed if their directories are bound, source_roots is bound once per CLI invocation in the parent, and both spawn sites (rank_group.py:301, tuning_replicas.py:179) produce children with an empty ContextVar. ForwardCache.__init__ (aot.py:845-855) and source_identity() (source_identity.py:48) therefore diverge between rank 0 and peers, splitting the per-host compiled-forward cache directory and the identity string recorded in kernels/rebuild metadata.

Origin of the mechanism: the external-recipe split by Luke Alonso (commits da037284, 17bb3c4a, 568aeca0, 2026-11-22; later PR #545 698ee450). source_roots/_EXTRA_ROOTS first appears in source_identity.py's history at da037284; the existing source-root tests in test_forward_cache_sources.py came from the same work. The public contract is codified in AGENTS.md:382-387 ("external recipe repositories can pass their own Recipe tuples directly to ignition.cli.main(...)").

How widely it is wanted / evidence of reports: no issue in the repository reports this. The only other written-down statement of the bug is #670's description ("rank 0 hashed external recipe package roots into its ForwardCache path while spawned peer ranks did not, causing compiled-forward cache misses and FileNotFoundError during TP exports from external recipe packages (such as local-inference-lab/hyperflare-recipes)"), opened the same day. #668 reports a different ForwardCache key defect (missing B12X_* env), #651 tracks multi-host autotune divergence. So the "why" rests on two same-week PR descriptions and no user report.

Recent activity

ignition/preparation in the last 60 days: 1fbcc3c9 (#667) "Harden Orbit payload integrity, multi-deployment TP seams, GB10 page-cache release, Unix flock drop, multi-host peer exports"; f2ca2c41 (#647) "Fix externalized core signing, stream-0 weight race, export I/O, multi-host tuning"; 555db719 (#648) "Migrate ignition runtime patches and preparation onto public b12x contracts"; e80b1f2f (#618) "decouple signed bodies, single-pass export, slice synthesis". #678 builds on this hardening work without reversing it; the trend is toward multi-host peer correctness (#667, #668, #675), the one axis #678 leaves alone.

People

Community

Nothing to report: 0 comments, 0 reviews, 0 reactions, no linked issues, no cross-references in either direction with #670, #597 or #668. Interest signals are indirect only — three same-week open PRs (#668, #670, #675) in the adjacent ForwardCache/peer-state surface.

Project fit

As facts, from the charter (read_charter) and repository docs:

Claims and evidence

Claim (from the body) What backs it Status
Peers fail "the cache-root agreement check in ForwardCache._prepare_ranks" Nothing on main; the check is added by #597 Not supported on main; most likely observed on a stack including unmerged #597
"Ensures rank 0, spawned TP peer ranks and spawned local tuning replicas compute identical ForwardCache root digests and source_identity hashes" Code does bind the roots in the children (rank_group.py:59, tuning_replicas.py:158); tests only assert that the ContextVar value is visible in the child (test_forward_cache_sources.py:83-110, 113-119, 186-188) Mechanism is in the diff; the equal-digest assertion is not tested
35 passed / 0 failed across 7 test files, CPU-only Author-reported; not reproducible here (no run). Tests are real spawn and Linux-only (skipif sys.platform != "linux", test_forward_cache_sources.py:93, 157) Plausible; CI would run them (.github/workflows/python-cpu.yml:30-33 (not opened) runs pytest tests/ -q with CUDA_VISIBLE_DEVICES="") but no checks exist on e72ec0d
End-to-end SM120 2-GPU same-SKU and 4-GPU mixed-SKU hyperflare_recipes.cli export completed Author-reported only; no logs, no artifact, no CI; the same rig appears in #597's evidence Unverified
Backward compatibility: extra_source_roots=() default Verified: in-tree callers use positional args that stay valid — tests/preparation/test_native_processes.py:228-229 (10 positional args), test_models… patched *args callers; nothing passes the new arg Holds
"No model core format, Helios ABI, or single-GPU preparation behavior changes" Verified: no changes outside ignition/preparation, none in helios/heliopause/core layout; core ignition export never binds roots so its keys are byte-identical (cli/init.py:364-370 is the only binding site) Holds, with one caveat: for external-recipe launches, peer-written rebuild metadata (rebuild_manifest.py:327) now carries rank 0's identity where it previously carried a rootless one — a behaviour change in recorded artifacts the body does not mention
Limitation stated: replica test stubs torch.cuda.set_device/synchronize/CoreStorage Confirmed at test_forward_cache_sources.py:146-154 (_cpu_replica_entry) Accurate

Test coverage, precisely: test_current_source_roots_reflects_active_scope (:71-80) nesting/reset; test_prepare_group_propagates_source_roots_to_spawned_peer (:93-110) real spawn + loopback Gloo over the TemporaryDirectory rendezvous, asserts both ranks' memory reports carry (("external_recipes", str(external)),); test_prepare_recipe_propagates_source_roots_to_spawned_tuning_replica (:157-188) real spawn, asserts both replica-N.txt files contain the label/path. Not covered: multi-host ignition join (host_ranks.py), and the _resolve_recipe-before-binding ordering.

Reach

Process

Open questions / could not be found

  1. Does the author intend #678 to supersede #670's rank_group.py hunk, or to stack on #597? Neither PR mentions it; the head commit message and body give no cross-reference.
  2. Was the observed "cache-root agreement" failure actually produced by #597's new check? The body's wording implies so, but nothing states the stack. This matters because on main alone the bug's symptom differs (FileNotFoundError/cache miss), which affects how the fix is verified.
  3. Should tuning_replicas._replica bind roots before _resolve_recipe (tuning_replicas.py:155)? As written, a recipe importable only via a bound external root still cannot resolve in the replica child.
  4. Is the multi-host ignition join path deliberately out of scope (deferring to #668/#675), or overlooked? The body's scope sentence suggests deliberate, but it is not stated and no follow-up is referenced.
  5. No issue, benchmark, or user report exists to corroborate the "unblocks same-SKU multi-GPU exports" benefit; no CI run and no review comment on e72ec0d to independently confirm the 35-passed claim.