Case file — PR #642 ignition(preparation): skip unreferenced epilogue candidates in relocate_inductor
Author jcartu (CONTRIBUTOR; "Discord: jcartu"), open 2026-11-30, base main, head 5f6e6a6, 3 files, +414/−10 (verified by pr_files): ignition/preparation/device_binding.py +57/−6, ignition/preparation/inductor_tuning.py +7/−4, tests/preparation/test_inductor_prepared_winners.py +350/−0. No labels, no reviews, no comments, no CI checks on head.
Key findings
- The GPU evidence was not produced by this diff. The "unblocked
qwen38TP4 preparation on 4x RTX PRO 6000 Blackwell" result was obtained with "an uncommitted guard inrelocate_inductorthat skippedstatic_autotunersentries absent fromkernel_keyswhenentry.kernel_namewas not a substring ofgraph.source_code" (PR description, "Hardware reproduction provenance") — i.e. a weaker, substring-based mechanism at commit99339606"Flare v0.4.4", which is not a commit in this repository (search_historyfinds no such commit; the only hit for the string is this PR's own commit). The submitted AST-based, fail-closed implementation was never run on GPU, and the PR discloses that ("No GPU preparation was run on0a8c20f4with this exact submitted diff"). The forward namespeculative16x5does not appear anywhere in the repo either. - This is the TP-rank half of a bug already fixed once, on the rank and code path the earlier fix did not cover. Merged PR #185 (mark-yong, 2026-11-04) fixed issue #183 by ignoring unreferenced bundle entries in
InductorSelections.register, with a substring test, and stated explicitly that "TP > 1 exports are untested". PR #642 removes exactly that substring test (mainignition/preparation/inductor_tuning.py:170-171) and puts the filter intorelocate_inductor, which is what runs on peer ranks during unfrozen deserialization. So #642 is the deferred TP>1 work of #185 plus a correctness fix of #185's matcher. - Undeclared behavior changes beyond the description (see "The change"): a new unconditional AST parse of the whole generated source on every frozen single-load (
_source_kernel_keys, device_binding.py:105-114, called at :184) where the old no-relocate path did no parsing at all; andgraph._triton_bundleis now replaced viadataclasses.replace(device_binding.py:185-187, 194-196, 209-211) rather than mutated in place, so bundle object identity changes on frozen/no-relocate loads. - No CI signal exists for the head commit ("CI on the head commit: no checks"). Per issue #623, the Python CPU workflow had 0 green runs in 61 because of two unrelated deterministic failures; #624 (merged 2026-11-30, the same day, after this PR opened) repaired them, so the suite may be green now but not at
5f6e6a6. All test numbers in the description are self-reported. - Direct file overlaps with open work. #597 (open, Autobot verdict "Ready To Merge") also edits
ignition/preparation/inductor_tuning.py(import line andwarm); closed draft #584 had rewritten both touched production files (+216/−45 indevice_binding.py, +267/−58 ininductor_tuning.py) and its author said it would be re-opened in pieces. A trivial conflict with #597 is likely; a #584 re-open would supersede this change. - The touched machinery has a hardware-failure history.
relocate_inductor,_freeze_tuning_winnersandInductorSelections.registerall date fromcb6187bf(Luke Alonso, 2026-10-27), the commit users bisected as the trigger of the GB10 Xid 13 "Illegal Instruction Encoding" fault in issue #137 (different mechanism — cubin reload in_install— but same subsystem, and the freeze/relocate path has no TP4 GPU test coverage in this PR).
The change (what it does, plain terms)
- The bug: PyTorch Inductor's epilogue-fusion benchmarking leaves "candidate" autotuners in the serialized Triton bundle (
static_autotuners) that the generated Python module never defines — their kernel names are still placeholders likePlaceholder.DESCRIPTIVE_NAME(issue #183's root-cause analysis). Two code paths trip over them:InductorSelections.register(compiler rank, substring match) andrelocate_inductor(peer ranks during unfrozen load,kernel_keys[entry_kernel.cache_key]→KeyError). - Three new helpers,
ignition/preparation/device_binding.py:92-130(read at PR head):_referenced_kernel_names(source)(:92) — AST walk collecting everyast.Nameid plus the string first argument ofasync_compile.triton(...)calls._source_kernel_keys(source)(:105) —CompiledTritonKernels.key()of the second (source) argument of eachasync_compile.tritoncall; i.e. what is actually launchable from that module._filter_static_autotuners(bundle, source, bound_keys)(:117) — keeps entries whosecache_key in bound_keys; for the rest, raisesValueError("compiled forward has unbound static Inductor kernels")only ifentry_kernel.kernel_nameis an exact member of_referenced_kernel_names(source), otherwise silently drops the entry. Name collection is lazy, only on the first unbound key (:120, :126-127).
relocate_inductorrestructured (device_binding.py:167-211vs main:126-160): previouslygraph.source_code/cache_key/device_idxswere written (:146-148 on main) before the loop that indexedkernel_keys[entry_kernel.cache_key](:157 on main) and before_freeze_tuning_winnersran on the unfiltered bundle (:141-142 on main). Now_device_sourcepopulateskernel_keysfirst (:190), then_filter_static_autotunersvalidates/filters (:192), then freezing happens on areplace()d bundle (:194-196), and only then aregraph.source_code/cache_key/device_idxswritten (:197-199) and per-kernel device metadata mutated for retained entries only (:200-211). The no-relocate path withfreeze_tuning(:182-188) now also filters before freezing. Because every retained entry hascache_key in kernel_keys, theKeyErrorat :208 is structurally gone.InductorSelections.registerrestructured (inductor_tuning.py:135-175vs main:135-172):discoveredpairs are collected during the AST walk (:146, :165) instead of mutatingself.instances/ calling_installinline (main :164-168);_filter_static_autotuners(graph._triton_bundle, graph.source_code, bindings)validates first (:167-168); only then are tuners registered, existing winners installed, andself.forwards[id(bound)]recorded (:169-175). The old substring checkany(entries[key].kernel_name in graph.source_code …)(main :170-171) is gone.- Tests: 5 new test functions / 9 cases in
tests/preparation/test_inductor_prepared_winners.py—test_load_inductor_relocation_drops_unreferenced_epilogue_candidates(:317),test_relocate_inductor_skips_prefix_colliding_unreferenced_candidate_in_memoryparametrized[(0, True), (1, False), (1, True)](:399-400),test_relocate_inductor_rejects_referenced_unbound_kernel_without_partial_mutationparametrized[(0, True), (2, False), (2, True)](:471-472),test_register_and_relocate_reject_aliased_triton_literal_without_partial_mutation(:529),test_register_preserves_distinct_tuners_sharing_source_key(:606). They are CPU-only, buildCompiledFxGraph.__new__fixtures and monkeypatch torch internals (deserialize_bundled_cache_entry,standalone_compile.AOTCompiledArtifact,aot_autograd_result,SerializableCompiledFunction,simple_wraps— :318-328, :372-381).
What the description does not say (verified against the diff)
- New parsing cost:
_source_kernel_keys(graph.source_code)(device_binding.py:184) parses the entire generated module on every frozen single-load / no-relocate load. Previously the no-relocate branch did no source parsing inrelocate_inductorat all (main :141-144 just froze or returned). Not measured or mentioned. - Bundle identity change:
graph._triton_bundlebecomes a new object (replace(...)) on the freeze paths (device_binding.py:185-187, 194-196, 209-211) whereas main mutated/matched the original._freeze_tuning_winnersstill mutates the entry kernels in place (:143-164), so kernel objects are shared with the pre-filter bundle. - Freeze-path ordering: on the no-relocate branch,
_freeze_tuning_winnersnow runs on the filtered bundle (:184-186), which is the fix — but it also means an artifact that previously froze fine and had a referenced unbound entry now raises inrelocate_inductor(ValueError("compiled forward has unbound static Inductor kernels")) rather than later inregister. That is a new failure point on single-GPU frozen loads, though the same condition also failed before viaregister's substring check. - Three meanings of "bound" are passed to one helper:
bindings(dict,register:168),kernel_keys(dict, :192),_source_kernel_keys(...)(set, :184). Membership semantics are uniform, but the helper's contract is looser than its signature suggests. - Not changed although related: the "missing direction" (module names a kernel with no bundle entry) is still a
TypeErroratinductor_tuning.py:156-162, untouched.
What the description says that the code does not do
Nothing material found. The description's claims about _referenced_kernel_names, _source_kernel_keys, _filter_static_autotuners, pre-mutation validation in both functions, and the exact-identifier test all match the code at head. The one overstatement is rhetorical rather than code: the "Claimed Result" leads with hardware language for a run that used a different patch (see Key finding 1).
The why
- Issue #183 (mark-yong, opened 2026-11-03, closed 2026-11-04 by #185):
ignition export qwen3.8-27b --gpus 0on maincc696a6bfails at forward 26/108 (speculative32x8p128) withValueError: compiled forward has unbound static Inductor kernels; bundle has 157 static autotuners, module names 156; the orphan is an unselected fused-epilogue GEMM template variant left byconfig.benchmark_epilogue_fusion(speedup_by_fusioncompiles template+epilogue candidates for benchmarking;TritonBundler.put_static_autotunerrecords every statically launchable kernel regardless of whether final code names it). Deterministic on RTX PRO 6000 Blackwell Max-Q (SM120), torch 2.14.1+cu132, triton 3.8.0. #183's "Not yet checked" section lists "TP > 1" as untested — the exact gap #642 fills. - Why now / how long: timeline from notes —
cb6187bf(2026-10-27) introduced the bundle-equality check; its validation export was Qwen3.8 TP2 + MTP5, which did not hit it;cbb7d9d9(2026-10-28) movedqwen3.8-27bfrom MTP to DFlash2, adding the fused-epilogue candidate selector that creates the benchmarked candidate; #183 filed 2026-11-03 and fixed the same day; #642 arrives 26 days later as the first report of the TP-rank manifestation. - No issue precedes the TP case:
search_itemsfor "unbound static Inductor kernels", "relocate_inductor KeyError", "tensor parallel preparation KeyError", "static autotuner bundle freeze tuning" returns only #642 itself plus #183/#185. The PR description is the only report of the TP4 failure — there is no independent reproduction anyone else can read. - Related-but-different: issue #268 (roobyz, 2026-11-12) explicitly disambiguates its qwen3.8-27b warm-up failure from #183/#185 — evidence the error string is a recognised landmark, but still no TP report. Issue #517 (jcartu, closed) is a different TP4/SM120 fault (Xid 31 in
_checkpoint_pages), showing jcartu works this hardware config.
Related work
- #185 "Ignore unreferenced Inductor kernels in static launcher bundles" (merged 2026-11-04, mark-yong, +52/−1): the direct predecessor and the code #642 deletes. It added the substring test at
inductor_tuning.py:170-171(commitb4196955), plus a GPU testtests/preparation/test_inductor_tuning_cuda.py::test_unreferenced_bundled_candidates_are_dropped_and_named_kernels_still_bind(:490-536). #185 said "TP > 1 exports are untested" and "the orphaned entry did not reproduce in a standalone forward, so the test supplies it directly". - #183 (closed, issue) — the single-GPU bug report; see above. #185's fix does not reach the peer-rank path.
- #597 "Key compiled forward sharing and Inductor validation by GPU name" (open, brandonmmusic-max, 2026-11-29→30, +643/−96): touches
ignition/preparation/inductor_tuning.py(+11/−1,cuda_device_identity, keying thewarminventory by GPU name) plusaot.py(_prepare_ranks,_publication_lock,_share_artifacts) andcompile_pool.py(not opened). Same files as #642'saot.pyneighbourhood (_prepare_rankscallsregisterat aot.py:1232); textual overlap limited to the import line — a trivial conflict is likely. Autobot's latest verdict on #597: "Ready To Merge". - #639 (open draft, original-el8, 2026-11-30): CompilePool sizing / Inductor compile threads (
aot.prepare_many,compile_pool.py(not opened)) — same subsystem, no file overlap. - #584 (closed draft, FujitsuPolycom, 2026-11-28→29, +4283/−264): had rewritten
device_binding.py(+216/−45, sharded tuning,peer_selection,_SourceTemplate) andinductor_tuning.py(+267/−58); closed by the author to split into "smaller, single-concern PRs … before re-opening later", with voipmonitor's review listing blockers. Any re-open would supersede/conflict with #642 on the same functions. - #110 (merged, voipmonitor) / e60bb3bc, #425 (merged, original-el8) also touched
inductor_tuning.py; neither conflicts. - #624 (merged 2026-11-30) repaired the two stale CPU tests (#623) that polluted the baseline #642 reports against — same-day, relevant to interpreting #642's test claims.
Recent activity (last ~60 days in the touched areas)
ignition/preparation: Luke Alonso (158 commits), Martin Vit (52), Eugene Rakhmatulin (36).tests/preparation: Luke Alonso (206), Martin Vit (34), jasonc (23). Recent merged work in the directory includes #618 (decouple signed bodies/single-pass export), #620 (remove copy drafts), #581 (USE_NODE_PRIORITY on exported graphs), #592 (sm110/thor), #608 (restore CPU Python tests).- No commit on
mainsince the branch point (0a8c20f) touches the three files this PR changes (orientation packet;search_historyfor the files shows5f6e6a62as the newest, i.e. this PR's own head). Clean fast-forward candidate. device_binding.pyhistory:5f6e6a62,0edad23f(2026-11-11 Luke Alonso, Kimi temporary storage),28f0833b,cb6187bf(2026-10-27, introduced the machinery),a08efb01(2026-10-16 Jason Cook, preserve prepared Triton launches on restore).inductor_tuning.py:5f6e6a62,dfea2875,af0907d9(Luke Alonso, TP16),b4196955(Mark Yong = #185),28f0833b,e60bb3bc,cb6187bf.cb6187bfis the commit users bisected as the Xid 13 trigger in issue #137 (javieratomic/calvarado2004, GB10, driver 580→615 fixed it;a794c99dmitigated) — different failure inside_install, but the same freeze/relocate subsystem. #642 builds on that code rather than reversing it.- The #183→#185→#642 chain is the substantive lineage: #642 explicitly reverses #185's substring matcher while keeping its policy.
People
- Author
jcartu(CONTRIBUTOR): last 180 days 3 merged — #505 "Bind core-declared FP32 parameters into text forward graphs" (the only merged change inignition/preparation-adjacent graph work), #418 (DSML/Qwen/GLM/TML strict tool schemas), #416 (host prefix-cache recency); 3 closed — #404 (activation steering), #520 (snapshot-slot assertion), #517 (Xid 31 issue); 2 open — #621 "Validate scheduler admission against the core parameter declarations" (2026-11-29) and #461 (docs, strict tool selection). Merged areas:docs(3),helios/src(3),heliopause/src,helios/proto. Profile: an active contributor who mostly lands frontend/core-protocol work, not a regular owner ofignition/preparation. - Regular owners of the touched code: Luke Alonso (author of
relocate_inductor,_freeze_tuning_winners,InductorSelections.registerviacb6187bf, plus later TP16/Kimi tuning commits), Mark Yong (author of #185's substring check and reporter of #183 — the person who diagnosed this mechanism one level up and wrote "Maintainers will know whether exact equality also protects another invariant"), Martin Vit (#110 tuning, GC deferral #559), Jason Cook (a08efb01), Eugene Rakhmatulin. - Engagement on #642 so far: none — no comments, reviews, reactions, or Autobot case file (contrast #597/#624/#639 which each got a
flare-autobotcase-file comment within minutes and an Autobot review later). - Authorship disclosure: the description ends "Authored by Gemini 4 Carbon and Gemini 4 Neon (
docs/design-review.mdprinciple 14)" and gives a Discord handle — this is the only place in the repo naming those agents (search_codefor jcartu/Cartu finds nothing else).
Community
- Zero comments, zero reviews, no labels, no reactions (
pr_comments: "No comments"). No inbound cross-references: searches for the PR's distinguishing phrases return only #642. - The PR has not entered the automated
flare-autobotintake that sibling PRs opened the same day received — worth a maintainer noting if intake is expected to be automatic.
Project fit (charter, read_charter, docs/design-review.md)
- Lines up with charter line 11 "Bring real evidence … Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)": the PR explains the PyTorch mechanism (per #183's
benchmark_epilogue_fusionanalysis) and justifies the drop by "cannot be launched by the generated module", notingInductorSelections.freezealready produces the same result on every rank (inductor_tuning.py:318-330rebuildsstatic_autotunersfrombindingsonly — verified). - Lines up with line 12 "Keep the runtime small and model-agnostic": change is confined to shared
ignition/preparation, no recipe/flag/env additions, no per-model branches. - Lines up with the roadmap goal on line 21 "Prepare supported model recipes with Ignition and serve captured CUDA graphs from Rust on SM103, SM120, and SM121": the failing configuration is
sm_120TP4, i.e. squarely in scope. - Possible tension with the same line-11 rule: the change is still a skip of the offending entry, and the hardware evidence that skipping helps came from a substring guard — the mechanism the PR itself argues is unsound. A reader could read it as generalizing a workaround validated only in weaker form on hardware.
- Principle 14 (docs/design-review.md:124-134) governs authored-agent restrictions on CUDA/PTX/CuTe/Triton-kernel/fusion code; this PR is preparation orchestration, the permitted category — consistent with its own "does not modify CUDA, PTX, CuTe DSL, Triton kernels, fusion, stream overlap, prepared core formats, or runtime ABIs" statement.
- Documentation: nothing under
docs/mentionsstatic_autotuners, tuning winners, orautotune_at_compile_time(search_code: no matches), so there is no doc to update and none was.
Reach
Verified in the repo, not just claimed:
relocate_inductorhas exactly one production caller,aot._load_inductor(ignition/preparation/aot.py:58), reached fromStorageBackend.deserialize_compile_artifacts(aot.py:545, withfrozen=fn._tuning_frozen) and from the portable-device cache-hit path incompilation._compile_module(compilation.py:302, nofrozen→False), plusscripts/inspect_forward_kernels.py:85(not opened). So every prepared-forward load — single-GPU restore, TP compiler rank, TP peer ranks, compile cache — passes through the changed function.freeze_tuningdefaults toFalse:_loadbinds it to thetriton.autotune_at_compile_timeoption (aot.py:1297) whose default isFalse(compilation.py:28), andfn._tuning_frozenis only setTruebyInductorSelections.freeze(inductor_tuning.py:330) and round-tripped through serialization (aot.py:514/519). The unfrozen peer path that crashed is the default, common path.InductorSelections.registerruns once per forward per rank in_prepare_ranks(aot.py:1232) and in single-device_warm(aot.py:1377) — every multi-rank preparation and every single-GPU warm.- Affected settings/defaults: none added or changed. Affected dependencies: private PyTorch Inductor internals
CompiledTritonKernels.key(device_binding.py:106/:113),CompiledFxGraph,CachingAutotuner,TritonBundlerbundle shape — coupling unchanged in kind but now used in one more place (_source_kernel_keys). - Users/operators affected: anyone preparing TP>1 recipes on SM120 (the reported qwen38 TP4 case), plus single-GPU frozen/prepared artifacts; the failure mode before the fix is a
KeyError/ValueErrorduring "Load and warm compiled forwards" (per the description, rank 0 silent, ranks 1..3 raising).
Claims and evidence
| Claim | Backing |
|---|---|
32 passed on the three targeted CPU test files; 27 in the new file |
self-reported; no CI on head 5f6e6a6; cannot be independently checked from artifacts |
Full tests/preparation: 1,157 passed / 74 skipped / 2 failed, same 2 as baseline 0a8c20f |
self-reported; the two named failures match #623's description exactly (stale torch/triton internals), which supports plausibility; #624 merged the same day fixing them |
| Revert check: 8 behavior-change cases fail without the production change | self-reported, not reproducible from the PR |
TP4 hardware: skipping unreferenced candidates unblocked qwen38 through core export and flare run health on all four ranks |
used a different, uncommitted substring guard at non-repo commit 99339606 ("Flare v0.4.4"); submitted diff never ran on GPU; checkpoint local-inference-lab/Qwen3.8-Flash-Next-NVFP4-MXFP8-CSF-QAD dc5b8ab2 and forward speculative16x5 have no counterpart in this repo |
"No GPU preparation was run on 0a8c20f4 with this exact diff; tests/preparation/*_cuda.py (not opened) not run" |
disclosed honestly |
Description's "neither unrelated failure touches device_binding.py or inductor_tuning.py" |
true |
Soundness argument: dropped entries cannot be launched; freeze discards them anyway |
verified against inductor_tuning.py:318-330 and #183's mechanism analysis; the argument is sound for the benchmark-candidate case |
| Existing GPU coverage not extended | tests/preparation/test_inductor_tuning_cuda.py:490-536 (from #185) asserts the very ValueError path #642 now routes through _filter_static_autotuners, and :553+ is a torchrun ≥2-rank test — neither was run or updated |
Process
- Open, "ready for review", one day old at the time of the packet (opened and last updated 2026-11-30), no labels, no reviewers requested, no CI, no discussion. Fast-forward candidate: no
maincommit since0a8c20ftouches the three files. - Size and description quality: four-part description with a
Discord:line and an honest Limitations section; the "Claimed Result" paragraph mixes verified CPU results with an unverified hardware anecdote on a different patch, which is the main process risk for a reviewer skimming it. - Test hygiene risk: the new tests reach into torch private internals (
CompiledFxGraph.__new__,torch._functorch._aot_autograd.runtime_wrappers.SerializableCompiledFunction,standalone_compile.AOTCompiledArtifact, monkeypatcheddeserialize_bundled_cache_entry) in the same style as tests #623/#624 just had to repair — the most likely future breakage on a torch bump.
Open questions / not found
- No independent report of the TP4
KeyError(no issue, no second reproduction) — the PR description is the sole evidence of the failure mode, and the fix's hardware validation used a different mechanism. - Not found: any doc, changelog or config surface for
static_autotuners/ tuning-winner freezing underdocs/; any indication of a maintainer review or triage of #642; whether theflare-autobotintake is expected to pick it up automatically. - Not measured: the added AST-parse cost on frozen single-GPU loads (thousands-line module parsed once per load).
- Unknown: whether #597 merges first (trivial import-line conflict accepted) and whether #584's promised split series returns to these two files.