#1 [high] Change: PR #678 propagates bound source roots into spawned processes
PR #678 "fix(ignition): propagate bound source roots to spawned rank and replica processes", base main, head e72ec0d, 4 files +233/-91.
Real semantic changes (small):
- ignition/preparation/source_identity.py:17-19 — new
current_source_roots()returning_EXTRA_ROOTS.get()(5 lines added, whole functional addition to this file). - ignition/preparation/rank_group.py:44-45 —
_peer(..., extra_source_roots=()); :53 importssource_roots; :59 the whole body is wrapped inwith source_roots(extra_source_roots):(this indentation wrap is ~85 of the 91 "removed"/re-added lines in this file — mechanical). rank_group.py:295-298prepare_groupimportscurrent_source_roots,extra_source_roots = current_source_roots(); :309-311 passes it as the last positional arg to the spawned_peer(mp.get_context("spawn"), rank_group.py:301). - ignition/preparation/tuning_replicas.py:142
_replica(..., extra_source_roots=()); :145 import; :158with source_roots(extra_source_roots), CoreStorage(world=plan.world_size) as storage:; :174-176prepare_recipecapturescurrent_source_roots(); :190-194 passes into spawned_replicaargs. - tests/preparation/test_forward_cache_sources.py +129/-3: 3 new tests (current_source_roots scoping; real spawn of rank_group.prepare_group; real spawn of tuning_replicas.prepare_recipe with cuda/CoreStorage stubs).
Not changed but load-bearing: the two consumers of _EXTRA_ROOTS are ForwardCache.init (ignition/preparation/aot.py:845-853, mixes extra-root .py bytes into the cache key -> self.root = root/'forwards'/key.hexdigest() at aot.py:855) and source_identity() (source_identity.py:33-54, combined_roots mixed at :112-113).
The "cache-root agreement check" the PR title/body refers to is not a single named function; the observable effect is that rank 0 and peers derive the same ForwardCache.root (aot.py:855) and thus share the same per-host cache directory and the same source_identity=self.root.name values passed to InductorSelections (aot.py:928, 1225, 1382) -> _execution_identity (inductor_tuning.py:100-106). Also rebuild_manifest.from_plan records source_identity() (rebuild_manifest.py:327).
#2 [high] Related work: #670 contains the same rank_group source-root fix (competing)
PR #670 (open, lukealonso, COLLABORATOR, opened 2026-12-02 00:26, head 0aeb2c1, +823/-267) bundles three things, one of which is exactly PR #678's rank_group.py fix:
- #670 "What changed" third bullet: "TP peer source-root propagation (ignition/preparation/rank_group.py): Before:
_peerexecuted prepare(...) with an empty_EXTRA_ROOTScontext. After:prepare_groupcaptures_EXTRA_ROOTS.get()and passes it to_peer, which enterssource_roots(extra_roots)before invoking prepare(...)." - #670 diff for rank_group.py: +21/-16 (vs #678's rank_group.py +91/-85, which is mostly the same edit plus re-indentation of the whole
_peerbody). - #670 problem statement names the same symptom #678 does: "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)". (#678 says the symptom is a ForwardCache root agreement failure.)
- #670's Autobot review (2026-12-02 01:03) listed as "Should Fix #2": "Add a CPU-only unit test for peer
_EXTRA_ROOTSpropagation inrank_group.py... no test file added" — i.e. #678 supplies exactly the test #670 lacks. Its Nit also suggested "Consider splitting the ignition/preparation/rank_group.py peer source-root fix into its own PR so the preparation bugfix and the Helios parser feature can be reviewed and reverted independently" — #678 looks like that split, though #678 does not reference #670 and #670 does not reference #678. - #678 adds scope beyond #670: tuning_replicas.py replica propagation and the
current_source_roots()helper; #670 does not touch tuning_replicas.py or source_identity.py. Both are open simultaneously with the same fix in rank_group.py -> merge-order conflict: whichever lands first makes the other's rank_group.py hunk duplicate/conflicting. Autobot review URL for #670: https://autobot.eidonix.com/p/a53c70a8-1c2d-4df6-9fb8-dcba9e7d776e.html
#3 [high] Claims/evidence: "cache-root agreement check in ForwardCache._prepare_ranks" does not exist on main; it is #597's addition
PR #678's description says the bug makes exports "fail the cache-root agreement check in ForwardCache._prepare_ranks". Verified on main/PR head (ignition/preparation/aot.py):
_prepare_ranks(aot.py:1023-1295) contains no cache-root comparison. The only agreement checks are "ranks prepared different forward catalogs" (aot.py:1045-1046),allocation_order's "tensor-parallel capture requires matching forward catalogs" (aot.py:714-715), and kernel-inventory/winner checks in ignition/preparation/inductor_tuning.py:236-279.- A cache-root mismatch on main manifests later and less clearly: peers resolve cache-root-relative paths under their own (empty-root)
self.rootcreated at aot.py:855 -> FileNotFoundError during_allocation_sizes/_load(aot.py:1210-1214, 1238-1242). This is exactly how #597 and #670 describe the symptom ("FileNotFoundError during TP exports", "compiled-forward cache misses"). - PR #597 (open, same author brandonmmusic-max, head 0d794b5) adds the check:
_prepare_ranksgathers(gpu_name, capability, self.root.name)and "fail fast with a clearRuntimeErrorif ranks sharing a GPU product name resolve different cache scopes" (author comment 2026-12-01 19:38 item 3; Autobot review 2026-12-01 20:03 citestest_same_gpu_sku_with_mismatched_cache_roots_is_rejected). So #678's stated error and its SM120 same-SKU/mixed-SKU end-to-end evidence most plausibly come from a stack that includes unmerged #597; on main alone the failure would be FileNotFoundError/cache miss, not a root-agreement error. #597 and #678 look complementary (diagnostic check + root-cause fix) but neither references the other.
#4 [high] Reach: multi-host ignition join peer path still has no source-roots binding
Verified by grep for source_roots|current_source_roots at PR head: the only bindings are ignition/cli/init.py:364-370 (main(..., source_roots=...)), ignition/preparation/rank_group.py:53-59/295-298, ignition/preparation/tuning_replicas.py:145/158/174-176. Nothing in ignition/preparation/host_ranks.py or ignition/cli/serve.py.
Consequence (reasoned, not run): multi-host export/serve peers run ignition join -> ignition/cli/serve.py:528-549, which computes source_identity() at serve.py:546 with an empty _EXTRA_ROOTS, and HostRendezvous._admit compares it to rank zero's identity (host_ranks.py:270-271 "source identity differs from rank zero's; every host must run the same checkout"); serve_peer/RemoteSource also uses source_identity() (host_ranks.py:629-631) and prepares at host_ranks.py:654-657 with no root binding. So an external recipe CLI that binds roots on rank zero still has unbounded peers on other hosts, both for identity agreement and for the ForwardCache key (aot.py:845-855).
This is consistent with the description, which scopes the fix to "spawned tensor-parallel peer processes" and "local tuning replicas", but the PR's headline benefit ("unblocking same-SKU multi-GPU exports launched through external recipe CLIs") should not be read as covering multi-host. PRs #668 and #675 are the open work on that peer path (b12x env / kernel_cache / rendezvous), neither propagates source roots.
Also note ignition convert/serve launched directly as ignition ... never bind roots at all; only external CLIs passing source_roots= do.
#11 [high] Research summary
Case file for PR #678 gathered; scratchpad holds 10 entries covering every angle (change, why, related work, recent activity, people, community, project fit, claims/evidence, reach, process).
Headlines a reader could not get from the description:
-
#670 by lukealonso already contains the identical rank_group.py fix. #670 ("parameterize THINK_TAGS ... and propagate peer source roots", open, +823/-267) makes exactly the
prepare_group->_peersource_roots(...)change; #678 adds the small extra pieces (#670 lacks):current_source_roots(), the tuning_replicas.py replica propagation, and the three new tests — indeed #670's own Autobot review asked for such a test and suggested splitting the rank_group fix out. Neither PR references the other; both open at once on the same lines. -
The stated failure mode ("cache-root agreement check in
ForwardCache._prepare_ranks") does not exist on main. On main a root mismatch surfaces as FileNotFoundError/cache miss; the fail-fast root check is added by the author's other open PR #597, which also matches #678's SM120 same-SKU/mixed-SKU evidence rig. #678 does not cite #597. -
The multi-host peer path is untouched:
ignition join/ host_ranks.py / serve.py never bind source roots, sosource_identity()and the ForwardCache key stay rootless on remote peers; the fix is local-spawn only. -
Small undeclared gaps:
_replicaimports the recipe module (_resolve_recipe, tuning_replicas.py:155) before enteringsource_roots(...)at :158; the new tests assert ContextVar visibility, not equalForwardCache.root/source_identity(); and peer-written rebuild metadata (rebuild_manifest.py:327) now carries rank 0's identity — none of these are mentioned in the PR body or limitations.
Charter fit is clean (no flags, no plugin, shared ignition/preparation, fixes the documented external-recipe CLI entrypoint), no docs were added, no human review or CI exists on the head commit e72ec0d, and the PR is otherwise small: one new 3-line function plus argument plumbing, with rank_group.py's +91/-85 being almost entirely re-indentation of _peer's body.
#12 [high] Why: the problem, its origin, and which issues/PRs report it
Problem: external recipe repos (local-inference-lab/hyperflare-recipes) call ignition.cli.main(..., source_roots=...), which binds _EXTRA_ROOTS (ignition/cli/init.py:364-370, ignition/preparation/source_identity.py:12-30). Two consumers hash those roots: ForwardCache.__init__ (ignition/preparation/aot.py:845-855, key -> self.root) and source_identity() (source_identity.py:33-54, :112-113). mp.get_context("spawn") children (rank_group.py:301, tuning_replicas.py:179) start with an empty ContextVar, so peers get a different root/source identity than rank 0.
Origin of the mechanism: the external-recipe split by Luke Alonso — commits da037284 / 17bb3c4a / 568aeca0 (2026-11-22, "Stage hyperflare_recipes separation...", "Remove extracted hyperflare_recipes...", "Align core Flare docs..."), later PR #545 (698ee450, compositional RecipeParameters + dynamic CLI). source_roots/_EXTRA_ROOTS first appears in the history of source_identity.py at da037284; test_forward_cache_sources.py's source-root tests came with #545/da037284. The public entrypoint contract is codified at AGENTS.md:382-387.
No issue in the repo reports this defect. The only other place it is written down is PR #670 (lukealonso) and PR #597/#668's ForwardCache discussions; #668 reports a different multi-host ForwardCache defect (missing B12X_* env in the cache key) and #651 tracks multi-host autotune divergence. So: no linked issue, no user report attached to #678 — the "why" rests entirely on the PR body plus #670's parallel description.
#5 [medium] Change (detail): what each modified function does, line by line
Files at PR head, all under ignition/preparation/:
- source_identity.py:12-30 —
_EXTRA_ROOTSContextVar with default();current_source_roots()(new, :17-19) just returns it;source_roots(roots=())(:22-30) normalizes to(str(label), Path(path))and sets/resets a token. Docstrings still say "for the duration of a CLI invocation" though the new consumers use it around spawned-process preparation. - Consumers: aot.py:845-853 (ForwardCache key: for each
(label, root)in_EXTRA_ROOTS.get()resolve, raiseValueError(f"bound source root {label!r} does not exist: {extra_root}")if not a dir, then mixlabel/relpath+ sha256 of every *.py); source_identity.py:33-54source_identity()mixescombined_roots = (*_EXTRA_ROOTS.get(), *extra_roots)into the digest (:48, :112-113). - rank_group.py:44-45
_peer(..., extra_source_roots=()); rank_group.py:59with source_roots(extra_source_roots):wraps preparation AND export AND serve/benchmark/direct handoff anddist.destroy_process_group()(the whole body, aot-indent shift); rank_group.py:295-311prepare_groupcaptures roots and passes positionally to the spawn Process. Note the ContextVar capture happens beforecontext.Process(...)(rank_group.py:301-311), so pickling-safe. - tuning_replicas.py:142,158
_replicaenterssource_roots(extra_source_roots)only aroundCoreStorage(...)+prepare(...)call, not around_resolve_recipe(tuning_replicas.py:155, which imports recipe modules by name) — the recipe module import happens before the roots are bound. - Only caller of
ignition.cli.main(..., source_roots=)in-tree is tests/cli/test_recipe_injection.py:78-98 (test_main_binds_source_roots_for_source_identity). External callers per AGENTS.md:382-387 are external recipe repos.
#6 [medium] Gap: _replica imports the recipe before binding the roots
- Nothing in the PR records or comments on this:
_replicacalls_resolve_recipe(prepare, recipe_name)at ignition/preparation/tuning_replicas.py:155 (imports the recipe module, and falls back to scanning the module'svars()forRecipevalues) beforewith source_roots(extra_source_roots), CoreStorage(...)at :158. So for an external recipe package that is only importable because its directory was passed viasource_roots, the replica child still resolves the recipe with an empty_EXTRA_ROOTSbinding. Rank 0'sprepare_reciperesolves nothing itself; the parent path passesplan/recipe through. - Compared with #670's rank_group-only version of the same fix, #678 also covers tuning_replicas — an undeclared-in-#670 extension.
- Mechanical size: rank_group.py's diff is +91/-85 but the only semantic lines are the signature default (:44-45), the import (:53), the
withat :59 and the 3 args at :309-311; the rest is re-indentation of_peer's ~80-line body.
#7 [medium] Claims/evidence: the new tests assert ContextVar visibility, not equal cache roots
Tests at PR head, tests/preparation/test_forward_cache_sources.py:
- :71-80
test_current_source_roots_reflects_active_scope— nesting/reset of the ContextVar. - :93-110
test_prepare_group_propagates_source_roots_to_spawned_peer— realmp spawn, loopback Gloo over the TemporaryDirectory rendezvous, asserts rank 0 and rank 1 memory reports both carry(("external_recipes", str(external)),); skipped off Linux ("local rank supervision requires Linux pidfds") andpytest.importorskip("flare_heliopause"). Stubs the prepare callable so no CUDA/torch.distributed model work happens. - :157-188
test_prepare_recipe_propagates_source_roots_to_spawned_tuning_replica— real spawn; patchestuning_replicas._replicawith_cpu_replica_entry(:146-154) which inside the child patchestorch.cuda.set_device,torch.cuda.synchronize,core_storage.CoreStorage(declared limitation in the PR body). Writesreplica-N.txtand asserts both replicas saw the root with label+path. - What the tests do NOT assert: that
ForwardCache.root/source_identity()are equal between parent and child (the actual bug mechanism) — only that the ContextVar value is visible. Also not covered: multi-hostignition join(host_ranks.py), and_resolve_recipeordering (see the replica gap note). - CI: .github/workflows/python-cpu.yml:30-33 runs
.venv/bin/python -m pytest tests/ -qwithCUDA_VISIBLE_DEVICES=""on ubuntu-24.04, so these spawn tests would run in CI; but the orientation packet reports "CI on the head commit: no checks" for e72ec0d.
#8 [medium] People: author is the #597 mixed-SKU ForwardCache author; no human engagement yet
- Author: brandonmmusic-max (CONTRIBUTOR, Discord "Brandonmusic"), same author as open #597 ("Key compiled forward sharing and Inductor validation by GPU name"), #475, #458, #457; merged: #162, #154; closed: #480, #468, #215, #163.
- #597 is the closest predecessor: same subsystem (ForwardCache/
_prepare_ranks/_share_artifacts/Inductor selections), same hardware story (SM120 Max-Q + Workstation mixed-SKU, 2-GPU same-SKU and 4-GPU mixed-SKU), and it went through 6 Autobot rounds (Changes Requested -> Ready To Merge on head 0d794b5, 2026-12-01 20:03). #678's own end-to-end evidence ("2-GPU same-SKU Workstation and 4-GPU mixed-SKU Max-Q + Workstation") matches #597's test rig exactly. - Neither #678 nor #597 mentions the other; #678 does not cite #670 (lukealonso's PR containing the identical rank_group fix).
- Area owners by commits (last 180 days, per orientation packet): ignition/preparation — Luke Alonso 161, Martin Vit 52, Eugene Rakhmatulin 36; tests/preparation — Luke Alonso 207, Martin Vit 34, jasonc 23. Luke Alonso is a priority contributor per the charter and owner of the external-recipe split (#545, #568aeca0, #17bb3c4a, AGENTS.md:382-387) that created
_EXTRA_ROOTS. - No human reviews/comments on #678 yet (pr_comments => "No comments"); Autobot case file/CI status unknown (PR not in local copy; orientation packet: no checks on e72ec0d).
#9 [medium] Project fit: aligns with the external-recipe rule; no docs added
Charter (read_charter) and repo docs, as facts:
- Charter line 12 "Keep the runtime small and model-agnostic... Ignition writes the recipes"; AGENTS.md:382-387 — "Official model recipes live in local-inference-lab/hyperflare-recipes ... and external recipe repositories can pass their own
Recipetuples directly toignition.cli.main(...). ... Coreignitionmust never importhyperflare_recipesor introduce a plugin discovery framework." #678 works entirely inside sharedignition/preparationand adds no plugin/import, no CLI flag, no env var -> lines up with the "solve the right problem in the right place" and recipe-externalisation rules; it makes the documented external-CLI entrypoint work under TP. - Charter line 21 goal: "Prepare supported model recipes with Ignition and serve captured CUDA graphs from Rust on SM103, SM120, and SM121" — the PR's evidence is SM120 TP2/TP4, inside the supported matrix.
- Charter review standards: "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)". #678 propagates the actual binding instead of relaxing the hash -> matches; the only silenced thing is nothing.
- Charter "PR descriptions: Expect four parts" — #678 has why/what/benefit/evidence with an explicit limitations paragraph, so it meets the form. Its evidence is CPU-only plus a claimed un-logged SM120 end-to-end run.
- Related constraint: AGENTS.md:376-381 requires owner approval for new captured-graph op families — not applicable here.
- Docs: grep for
source_roots|_EXTRA_ROOTSin docs/ returns nothing;docs/preparation-development.md/docs/model-preparation.md/docs/cli-design.mddocument cache roots and multi-host but say nothing about external-source-root propagation. #678 adds no documentation. #597 did add docs (docs/cli-design.md, docs/model-preparation.md, docs/preparation-development.md) for its cache-scope rules. - Design-review reference: docs/design-review.md:42-45 external recipes live in hyperflare-recipes; PR description claims here are consistent.
#10 [medium] Reach: only external ignition.cli.main(source_roots=...) launches change; core CLI untouched
Verified on PR head by grep:
source_rootsis only bound in ignition/cli/init.py:364-370 from themain(..., source_roots=...)kwarg; noignition convert/serve/exportsubcommand sets it, andignition/preparation/host_ranks.py/ignition/cli/serve.pynever touch it.- So
ignition exportfrom core (without an external recipe CLI) currently hashes NO external roots on any rank;extra_source_roots=()keeps that byte-identical -> default path unchanged (supports the PR's "backward compatibility" claim). - Anyone who previously called
_peer/_replicadirectly with positional args is unaffected (new arg is last, defaulted); in-tree callers: tests/preparation/test_native_processes.py:228-229 (_peer(parent, None, config, 1, "unused", connection, Control(), prepare, True, True)— 10 positional args, still valid), tests/preparation/test_model_core.py:92-101/126 (patched_peer,*args), and rank_group.py:309-311 itself. No caller passes the new arg. - Cache-reuse impact: for external-recipe launches the cache key now includes the same extra roots on peers as on rank 0, so peers reuse rank 0's per-host compiled forwards instead of missing them. For core launches, nothing changes. No core-format, Helios ABI, or on-disk artifact naming change (compare #597, which altered ForwardCache keying/lending semantics).
- Rebuild/publication:
rebuild_manifest.from_planrecordssource_identity()(ignition/preparation/rebuild_manifest.py:327); with roots now bound on peers, peer-written core rebuild metadata carries the same identity string as rank 0 — previously peers in spawned groups would record a rootless identity. Not mentioned in the PR body.
#13 [medium] Related work: #668 and #675 touch the same ForwardCache/peer-path surface but not source roots
- #668 (open, lukealonso, head d4d7b2d, +423/-44, opened 2026-12-01 22:26, labelled area:preparation, priority:P2) edits ignition/preparation/aot.py (+79/-10) and tests/preparation/test_forward_cache_sources.py (+78/-0) — the same two files #678 touches. It changes
ForwardCache.__init__'s key (adds sortedB12X_*env via_b12x_forward_env(), aot.py:47-100/870-877 per review), atomic.binsaves and corrupt-.binrecovery; it does NOT touch_EXTRA_ROOTSor rank_group.py. Its Autobot review (2026-12-01 22:47) noted overlap with #667/#597 in the same helpers. Direct textual conflict risk with #678 is low (different hunks of aot.py) but both edit test_forward_cache_sources.py, so the test files will conflict. - #675 (open, Reederey87, FIRST_TIME_CONTRIBUTOR, opened 2026-12-02 10:50) forwards recipe
b12x_environmentto multi-host peer ranks in host_ranks.py/serve.py; Autobot stopped its review on 2026-12-02 10:54 with "Another open pull request already covers this change" (i.e. #668). It is the multi-host analogue of #678's local-peer problem, and shows two contributors independently working the same "spawned/remote peer loses parent state" class of bug in the same week. - #664 (open, kbenkhaled) also edits ignition/preparation/rank_group.py; #504 (merged) and #433 (merged) are the last merged changes to rank_group.py/tuning_replicas.py respectively, neither near
_peer's prologue where #678 edits. - #667 (merged, 1fbcc3c9) and #647 (merged, f2ca2c41) are the most recent merged work in ignition/preparation (multi-host peer exports, externalized core signing, tuning); #678 builds on them without reversing anything (orientation packet: no default-branch commits since the branch point touch its files).