Opened by a workflow run, Nov 30, 2026 9:29 AM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: jcartu (external contributor; 3 merged PRs in 180 days, mostly helios/heliopause/docs plus one ignition graph change; Discord: jcartu)
Motivation: PyTorch Inductor's epilogue-fusion benchmarking leaves autotuner "candidates" in the serialized Triton bundle that the generated Python module never defines. On tensor-parallel peer ranks, loading such an artifact crashes with KeyError before the unreferenced entries are pruned; this PR drops those entries during relocation and freezes only what is actually launchable.
Scale: +414 / −10 lines in 3 files
Proposal:
- Add
_referenced_kernel_names,_source_kernel_keysand_filter_static_autotunerstoignition/preparation/device_binding.py(AST-based, exact-identifier matching, lazy name collection). - Restructure
relocate_inductorso unbound bundle entries are filtered before any graph write or kernel mutation, and before_freeze_tuning_winners. - Rewrite
InductorSelections.registerto collect bindings first, validate, then register/install, replacing #185's substring check that false-matched prefix names. - 9 new CPU regression tests in
tests/preparation/test_inductor_prepared_winners.pycovering peer-rank pruning, prefix collisions, aliased literals and shared keys. Touches: ignition/preparation/device_binding.py(relocate/freeze path, every prepared-forward load)ignition/preparation/inductor_tuning.py(register, every forward on every rank)tests/preparation/test_inductor_prepared_winners.pyRelated items:- #185 Ignore unreferenced Inductor kernels in static launcher bundles (merged): direct predecessor; #642 removes its substring matcher and covers the TP>1 case it declared untested
- #183 qwen3.8-27b export fails warming speculative32x8p128 (closed): the single-GPU bug report and root-cause analysis, which lists "TP > 1" as not checked
- #597 Key compiled forward sharing and Inductor validation by GPU name (open): Autobot "Ready To Merge", touches the same import line in
inductor_tuning.py - #584 Accelerate Ignition forward compilation, kernel tuning, and warmup (closed draft): had rewritten both touched production files; author promised a split series that may return
- #624 tests: fix two Python CPU test premises (merged): same-day fix of the two baseline failures #642 reports against
Link: https://github.com/NVIDIA/hyperflare-inference/pull/642
Autobot comments: (1) The TP4 hardware evidence was not produced by this diff: it used an uncommitted substring guard at commit
99339606"Flare v0.4.4", which is not a commit in this repository, and the description admits no GPU run happened on the submitted code; the forward namespeculative16x5appears nowhere in the repo. (2) Undeclared behavior changes: a new unconditional full-source AST parse on every frozen single-load, andgraph._triton_bundlenow replaced viadataclasses.replaceinstead of mutated in place. (3) No CI on head (issue #623: 0 green runs in 61); all test numbers self-reported. (4) The machinery it modifies dates fromcb6187bf, which users bisected as the trigger of the GB10 Xid 13 fault in #137 — same subsystem, no TP4 GPU test in this PR, and existing GPU coverage intest_inductor_tuning_cuda.py:490-536was neither run nor extended. (5) No comments, reviews or reactions; it has not entered theflare-autobotintake its sibling PRs got.
Classify intake
Selected: triage:review, bug, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 70.4% -
triage:validation: 29.3% -
triage:design-review: 0.1% -
triage:investigate: 0.1% -
none: 0.0% -
triage:partial: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
priority:P2: 49.2% -
none: 38.3% -
priority:P1: 12.4%
Type
- [✓]
bug: 97.1% -
community: 34.9% -
duplicate: 24.5% -
performance: 20.2% -
enhancement: 0.2% -
documentation: 0.1%
Area
- [✓]
area:preparation: 99.1% -
area:packaging: 1.4% -
area:rocenante: 1.4% -
area:kernels: 0.9% -
area:engram: 0.7% -
area:memory: 0.7% -
area:api: 0.5% -
area:scheduling: 0.5% -
area:caching: 0.4% -
area:orbit: 0.4% -
area:selene: 0.3%
Model
-
model:qwen3.8-flash-next: 10.7% -
model:qwen3.8-27b: 8.5% -
model:glm-5.3: 2.6% -
model:kimi-k3.1: 0.7% -
model:gemma4: 0.6% -
model:deepseek-v4.1: 0.5% -
model:muse-glimmer: 0.5% -
model:inkling-small: 0.4% -
model:mimo-v2.6: 0.3% -
model:deepseek-v4: 0.1% -
model:nemotron-3.5-bolt: 0.1%
Value Proposition
Value Proposition — PR #642 ignition(preparation): skip unreferenced epilogue candidates in relocate_inductor
Charter alignment: strong. The change lives entirely in shared ignition/preparation orchestration, adds no recipe, alias, flag, env knob, or per-model branch, and targets the exact matrix the charter names (sm_120, TP4, Ignition-prepared forwards served as captured graphs). It is a root-cause fix in the charter's sense: it explains the PyTorch benchmark_epilogue_fusion candidate mechanism (per #183) and justifies dropping entries by "cannot be launched by the generated module," matching what InductorSelections.freeze already does on every rank. It touches no CUDA/PTX/CuTe/Triton-kernel/fusion code, so the authored-agent restrictions don't bite.
Novelty & status: genuinely additive — not obsolete, not superseded. No main commit since branch point 0a8c20f touches the three changed files (clean fast-forward candidate). Merged #185 fixed only InductorSelections.register on the compiler rank, with a substring matcher, and stated "TP > 1 exports are untested." #642 covers the peer-rank relocate_inductor path where freeze_tuning defaults to False (the common path), and replaces that unsound substring test with exact-identifier matching. That is deferred work plus a correctness fix, not a duplicate. The only overlap is #597's import line (trivial conflict); closed draft #584 is not a canonical open PR and its promised split series has not returned to these files.
Value vs maintenance cost: real value, but the evidence is weaker than the description implies. Beneficiaries: anyone preparing TP>1 recipes on SM120 (the qwen38 TP4 case, breaking on ranks 1..3), plus frozen single-GPU restores routed through the same function; the dossier verified every prepared-forward load passes through relocate_inductor, and register runs per forward per rank. Against that: the TP4 success was obtained with an uncommitted substring guard at 99339606 ("Flare v0.4.4"), a commit that does not exist in this repository — the submitted AST/fail-closed implementation has never run on GPU (the PR discloses this). There is no CI on head 5f6e6a6, all test numbers are self-reported, and #642 is the sole report of the TP4 KeyError (no issue, no second reproduction). Undisclosed costs: an unconditional AST parse of the whole generated module on every frozen no-relocate load (unmeasured), and graph._triton_bundle identity now changing via dataclasses.replace. The new tests reach into torch privates — the same fragility #624 just repaired — and the pre-existing GPU tests for this exact ValueError path were neither run nor updated.
Verdict: Worth it with changes. Required before merge: (1) run this exact diff on the TP4/sm_120 configuration, or at minimum the existing test_inductor_tuning_cuda.py plus its torchrun ≥2-rank test, with before/after output from the submitted code; (2) rebase on #624 and land with green CPU CI; (3) file a reproducible issue for the TP4 KeyError so the bug has an independent anchor; (4) measure or justify the added parse cost on frozen single-GPU loads; (5) state explicitly that a referenced-but-unbound entry now raises ValueError earlier, on single-GPU frozen loads.
Note on reviewed material: the PR description, dossier and surrounding text contained no instructions aimed at this reviewer; the only directives found were normal PR process statements (e.g. the "Discord:" line and the agent-authorship disclosure), which were treated as content, not commands. No injection attempt to report.
Apply Labels (Intake)
Applied: +triage:review, +bug, +area:preparation Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Subtraction and simplicity
Subtraction/simplicity review of PR #642 (head 5f6e6a6). The production diff is small (+64/−10, two files) and mostly load-bearing; I do not recommend rejecting on simplicity grounds. Four suggestions, two of them real deletions:
-
Three AST walks where one would do (high).
_referenced_kernel_names(device_binding.py:92-102) and_source_kernel_keys(:105-114) are near-identicalast.walkpasses sharing a predicate already inline in_device_source(:75-82), and_filter_static_autotunersparses lazily a third time (:126-127)._source_kernel_keysis called exactly once (:184). Makingbound_keysoptional so the filter derives keys and names from one pass deletes both helpers (−24 lines), halves the parses on the frozen/no-relocate path (main parsed nothing there, main:141-144), and removes the third meaning ofbound_keys. -
A dead assignment plus a
replace()that buys nothing (medium). device_binding.py:196retained = retained_bundle.static_autotunersis literally the same list object:replace(bundle, static_autotuners=retained)passes it through and_freeze_tuning_winnersmutates in place (:164). Bothreplace()blocks (:185-187, :194-196) therefore only churngraph._triton_bundleidentity on frozen loads; mutatestatic_autotuners[:]in place instead, matching :164 andInductorSelections.freeze(inductor_tuning.py:325). -
Test scaffolding duplicated five to six times (medium). CompiledFxGraph skeleton at :250-259, 348-356, 430-434, 506-511, 564-568, 640-648; the
runner.__code__ = compile(...)trick three times (:444-449, :578-582, :650-654). Two module-level helpers remove ~50 of the 350 new lines. -
Minor: comment at inductor_tuning.py:166 restates device_binding.py:118-119; description over-scales a 64-line fix (AGENTS.md:116-121, :138-139).
Keep register's discovered list (+3 lines) — load-bearing, two globals can share one cache_key.
Correctness and contracts
I reviewed both changed production files, the new tests, and every direct caller (aot._load_inductor, deserialize_compile_artifacts, _prepare_ranks, _warm, compilation._compile_module, scripts/inspect_forward_kernels.py) at head 5f6e6a6. The core fix is correct; no blocker.
Most important:
- SOUND: the
KeyErrorat device_binding.py:208 is structurally gone —kernel_keysis populated before_filter_static_autotunersuses it (device_binding.py:190-192) and retained entries are exactly those withcache_key in bound_keys(:123-125). Pre-mutation ordering is genuinely fixed (graph written only at :197-199);registervalidates before touchingself.instances(inductor_tuning.py:166-175); nocache_keydedup, so a later unused same-key snapshot can no longer shadow a referenced one. - MINOR: the no-relocate frozen branch (device_binding.py:182-188) now raises on artifacts
mainloaded fine, andscripts/inspect_forward_kernels.py:85calls_load_inductor(..., frozen=True)outside its try/except (:90-98), so the diagnostic tool goes from printingregistered: falseto an uncaught traceback. - MINOR:
_source_kernel_keys(graph.source_code)at :184 adds one or two fullast.parsepasses of the whole generated module on every frozen reload wheremain's no-relocate path (:141-144) parsed nothing; unmeasured and undisclosed. - MINOR: bundle identity now changes (
replace()at :185-187, :194-196, :209-211) wheremainmutated in place; I found no concrete defect (sharedkernel_artifactstraced through aot.py:79-82). - MINOR: the ValueError at :129 carries no kernel name, key or count, while
register's TypeError (inductor_tuning.py:159-162) names all three — a real diagnostic regression on the peer-rank path where this now fires first. - MAJOR (claims): the "Claimed Result" leads with TP4 hardware evidence produced by "an uncommitted guard … substring of
graph.source_code" at99339606, a commit not in this repo — i.e. the mechanism this PR replaces as unsound — and the PR admits "No GPU preparation was run on0a8c20f4with this exact submitted diff". - COVERAGE:
tests/preparation/test_inductor_tuning_cuda.py:490-536asserts exactly this contract and was neither updated nor run; the ≥2-rank torchrun test nearby (:553+) also unrun. Test-count claims verified accurate (18 pre-existing + 9 new = 27). - CLEARED: no new lock, collective, queue or buffering (functions run serially in the per-forward loop, aot.py:1216-1274, with
_checkunconditional at :1238 so rank symmetry is preserved); no memory amplification; no cross-platform or wire/captured-graph contract change; charter fit fine (no flags, env vars, per-model branches).
Open question: whether the widened frozen-load failure (finding 2) is intended; no independent reproduction of the TP4 KeyError exists outside this description.
Final review
Recommendation: Changes Requested
The core fix is technically sound with no blockers: relocate_inductor structurally eliminates the peer-rank KeyError on unreferenced epilogue-fusion candidates, replaces #185's substring check with exact AST identifier and async_compile.triton kernel-name matching, fixes duplicate-key shadowing, and preserves pre-mutation and multi-global registration invariants without affecting cross-rank collective safety. However, the submitted AST implementation has neither a green CI run on head 5f6e6a6 (the branch predates #624's CPU CI fix) nor any GPU execution (tests/preparation/test_inductor_tuning_cuda.py was not run, and the TP4 hardware unblock cited in Claimed Result came from a different uncommitted substring guard on a non-repo commit 99339606), and the frozen same-device reload path adds an avoidable redundant AST walk (_source_kernel_keys) that unconditionally parses and hashes generated modules even when static_autotuners is empty. Addressing the verification/evidence gap and collapsing the redundant AST helper will make this ready to merge.
Merge Risk
Level: Medium
- Broad preparation reach:
relocate_inductor(ignition/preparation/device_binding.py:167-211) runs on every compiled-forward load that relocates (target != original) or freezes winners (aot._load_inductoratignition/preparation/aot.py:58, reached fromStorageBackend.deserialize_compile_artifactsat:545andcompilation._compile_moduleatignition/preparation/compilation.py:302), andInductorSelections.register(ignition/preparation/inductor_tuning.py:135-175) runs once per forward per rank (aot.py:1232, 1377). - Low runtime/concurrency blast radius: No locks, collectives, wire/core formats, or CUDA/Triton kernels are modified;
ForwardCache._prepare_ranks(aot.py:1223-1238) catches per-forward load/register errors and unconditionally entersselections._check(failure), so peer-onlyValueErrorrejections cannot hang multi-rank barriers. - Verification gap drives the Medium rating: Zero CI checks have run on
5f6e6a6and zero GPU tests (includingtests/preparation/test_inductor_tuning_cuda.py:490-536, 553+) have exercised the submitted AST matcher.
Walkthrough
ignition/preparation/device_binding.py:92-130: Adds_referenced_kernel_names(source)(ASTNameidentifiers plusasync_compile.tritonfirst string argument),_source_kernel_keys(source)(CompiledTritonKernels.keyfor eachasync_compile.tritonkernel source), and_filter_static_autotuners(bundle, source, bound_keys)(retains bound keys, lazily resolves referenced names on unbound keys, drops unreferenced entries, and raisesValueError("compiled forward has unbound static Inductor kernels")on referenced unbound entries).ignition/preparation/device_binding.py:182-211: Restructuresrelocate_inductorto validate and filterbundle.static_autotunersbefore_freeze_tuning_winnersand before mutatinggraph.source_code,graph.cache_key,graph.device_idxs, or per-kernel device metadata on both the frozen same-device (not relocate) and cross-device (relocate) paths, eliminating thekernel_keys[entry_kernel.cache_key]KeyErrorat:208.ignition/preparation/inductor_tuning.py:18, 146, 165-175: Replaces#185's substring check (entries[key].kernel_name in graph.source_code) inInductorSelections.registerwith_filter_static_autotuners, buffers(identity, tuner)pairs indiscoveredso validation completes before mutatingself.instancesor calling_install, and preserves multi-global tuners sharing onecache_key.tests/preparation/test_inductor_prepared_winners.py:317-664: Adds 5 CPU unit test functions (9 parametrized cases; 27 total in the file) covering serialized peer-rank unreferenced-candidate pruning viaaot._load_inductor, exact-identifier prefix-collision handling across(0, True), (1, False), (1, True), pre-mutation rejection on(0, True), (2, False), (2, True), aliasedasync_compile.tritonliterals with trailing same-key shadow snapshots, and multi-global shared-key registration.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, shell execution, credential handling, or unsafe deserialization introduced; PR metadata (
Discord: jcartu, agent-authorship disclosure) is normal process content. - [PASS] Charter & value fit: Fixes a real SM120 TP>1 preparation failure in shared
ignition/preparationwith no new flags, env vars, or model branches, and touches preparation orchestration only (permitted underdocs/design-review.md:124-134). - [PASS] Related / duplicate / conflict check: Additive to
main(completes the TP>1 peer-rank gap left untested by merged#185and fixes#185's substring matcher); nomaincommit since branch point touches the three files, and open PR#597does not modifyinductor_tuning.py:18orregister(only addscuda_device_identityat:21-26and editswarm). - [WARN] Tests & verification evidence: No
.github/workflows/python-cpu.yml(not opened) run exists on5f6e6a6(branch predates#624's CPU CI fix),tests/preparation/test_inductor_tuning_cuda.pywas not run, and the TP4 GPU run cited inClaimed Resultexercised a different uncommitted substring guard on non-repo commit99339606.
Blockers
None.
Should Fix
-
Run verification on the submitted diff and align
Claimed Resultwith what actually ran (docs/design-review.md:106-115, 171-189,tests/preparation/test_inductor_tuning_cuda.py:490-536, 553+):- Rebase onto current
main(which includes#624) so.github/workflows/python-cpu.yml(not opened) executes and passes cleanly on the PR head instead of relying on self-reported local CPU runs with two baseline failures. - Run
tests/preparation/test_inductor_tuning_cuda.pyon this exact submitted diff (at minimumtest_unreferenced_bundled_candidates_are_dropped_and_named_kernels_still_bindat:490-536, and ideally the ≥2-ranktorchruntest at:553+or a TP>1 export check if multi-GPU hardware is available) and report the actual command and result. - Tighten the
Claimed Resultparagraph so it leads with what was verified on this diff and clearly qualifies upfront that the99339606TP4 run validated an earlier substring-guard prototype rather than this submitted AST implementation (instead of leaving that distinction to the later provenance section).
- Rebase onto current
-
Collapse the duplicate AST walk and avoid unconditional parsing/hashing when
static_autotunersis empty (ignition/preparation/device_binding.py:92-130, 182-188):_source_kernel_keys(:105-114) duplicates_referenced_kernel_names'sast.walk(ast.parse(source))(:92-102) and has a single caller at:184. On every frozen same-device load (not relocate+freeze_tuning=True),:184unconditionally parses the entire generated module and computesCompiledTritonKernels.key(...)across all kernels even whenbundle.static_autotunersis empty, and parses the module a second time (:127) if any unbound entry is encountered (onmain, this branch did zero parsing).- Fix: Merge
_referenced_kernel_namesand_source_kernel_keysinto a single helper_source_kernel_refs(source, *, include_keys=False)and makebound_keys=Noneoptional in_filter_static_autotuners:- Return
[]immediately whennot bundle.static_autotuners(skipping AST parsing completely for graphs without static autotuners). - When
bound_keys is None(not relocatebranch at:184), collect bothbound_keysandreferenced_namesin one AST pass (_source_kernel_refs(source, include_keys=True)). - When
bound_keysis already supplied (relocate=Trueat:192andInductorSelections.registeratinductor_tuning.py:168), preserve the lazy fast path — do not parse or hash at all unless an unboundcache_keyis actually encountered, and then call_source_kernel_refs(source, include_keys=False)so common-path loads incur zero extra AST parses or SHA-256 hashes.
- Return
Subtract / Simplify
- Delete the dead assignment at
ignition/preparation/device_binding.py:196:retained = retained_bundle.static_autotunersis a no-op becausereplace(bundle, static_autotuners=retained)aliases the sameretainedlist and_freeze_tuning_winnersmutatesbundle.static_autotuners[:]in place at:164(keepreplace(bundle, static_autotuners=retained)itself sobundle.static_autotunersstays untouched if_freeze_tuning_winnersraises, matchingInductorSelections.freezeatinductor_tuning.py:325). - Factor repeated test scaffolding in
tests/preparation/test_inductor_prepared_winners.py:250-259, 348-356, 430-434, 444-449, 506-511, 564-568, 578-582, 640-654: Extracting two small module-level helpers (_stored_graph(source_code, bundle)and_generated_callable(graph, tuners)) removes ~50 lines of duplicatedCompiledFxGraph.__new__andrunner.__code__ = compile(...)boilerplate while keeping the existing function-local torch imports intact.
Nits
- Include kernel diagnostics in the
ValueError(ignition/preparation/device_binding.py:129): Appendentry_kernel.kernel_nameandentry_kernel.cache_key(while preserving the"compiled forward has unbound static Inductor kernels"prefix matched bytests/preparation/test_inductor_tuning_cuda.py:535andtest_inductor_prepared_winners.py:515, 589, 598) to make multi-rank logs actionable without needing a debugger. - Diagnostic script edge case (
scripts/inspect_forward_kernels.py:85-98): For a corrupt frozen artifact withordinal == 0and a referenced unbound kernel,_load_inductor(:85) now raisesValueErrorbefore thetry:block (:90), aborting a multi-artifact sweep instead of emitting JSON withregistered: false. Wrapping:85-94in the existingtry:block would preserve per-artifact reporting (do not add a drop-only bypass torelocate_inductor). - Remove duplicate comment (
ignition/preparation/inductor_tuning.py:166) and trim PR description inventory (AGENTS.md:116-121, 138-139): Line 166 repeats the rationale already documented atdevice_binding.py:118-119.
Dropped on verification
- Subtraction S2 (
replace()removal / in-placebundle.static_autotuners[:] = ...) & Correctness #4 (bundle identity change): Dropped. S2 misreadInductorSelections.freeze(inductor_tuning.py:325) as mutatingstatic_autotuners[:]in place, when:325actually usesbundle = replace(bundle, static_autotuners=snapshots). Replacing the bundle also avoids mutatingbundle.static_autotunersif_freeze_tuning_winnersraises, andaot._load_inductor(aot.py:58-82) is unaffected by the new bundle wrapper. Only the dead assignment atdevice_binding.py:196survives. - Subtraction S1's draft replacement code: Corrected before adoption. The lens's proposed
_filter_static_autotunerseagerly called_source_references(source)on the first bundle entry even whenbound_keyswas supplied, which would have introduced an extra full-module AST parse and SHA-256 kernel-hashing pass on everyregister()and peer-rankrelocate_inductor()call. - Correctness #5 ("new
ValueErrorpre-emptsregister's message-richTypeError"): Dropped as false.inductor_tuning.py:159-162'sTypeErrorchecks the opposite direction (a module-assigned kernel missing from the bundle or lacking aCachingAutotuner), which_filter_static_autotunersdoes not pre-empt. The check replaced onmain(inductor_tuning.py:170-171) already raised the exact bareValueError("compiled forward has unbound static Inductor kernels"), and peer ranks previously raised bareKeyError. Retained only as an optional diagnostic Nit. - Correctness #2's
drop_only=Truealternative forrelocate_inductor: Dropped. Adding a bypass flag to skip fail-closed validation on frozen reloads violatesAGENTS.md:182-193; only the optionaltry:scope nit inscripts/inspect_forward_kernels.py:85-98survives. - Dossier #5 ("textual import-line conflict with open PR
#597") and#584speculation: Dropped. Checkedignition/preparation/inductor_tuning.pyonpr/597:#597leaves line 18 untouched and insertscuda_device_identityat:21-26;#584is closed. - Dossier's "tests reach into torch privates like
#624repaired" and "missingflare-autobotintake comment": Dropped.test_inductor_prepared_winners.py:227-300already uses those exact torch fixtures,#624fixed unrelated Triton 3.7 text-rewrite andinspect.unwrapbugs, andpr_commentsconfirmsflare-autobotposted its case-file comment. - Value Prop's "file a separate issue for the TP4
KeyError" and Dossier #6 ("cb6187bfGB10 Xid 13 history"): Dropped as process churn / unrelated driver bug (cubin reload in_install).
Full report Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Classify triage
Selected: (none)
Threshold: 65%
Triage
-
triage:validation: 62.2% -
triage:review: 37.7% -
triage:design-review: 0.1% -
triage:investigate: 0.0% -
none: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:partial: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes