PR #574 — Strip unguarded attributes from hyperflare_recipes objects in AOT guard serialization
https://github.com/NVIDIA/hyperflare-inference/pull/574 · open, ready for review · base main, head 628f361 · 2 files, +54/−1 · no labels, no reviews, no CI checks · opened and last updated 2026-11-28.
Key findings
- The predicate is shared, so the change reaches further than the title says.
_uses_custom_object_state(ignition/preparation/forward_metadata.py:39-45) is consumed by both_GuardPickler.reducer_override(ignition/preparation/aot.py:155-166, the AOT guard case described) and_ForwardPickler.reducer_override(ignition/preparation/forward_metadata.py:277-278, forward-metadata / worker-IPC pickling). The second path now reconstructshyperflare_recipes.*classes that define a class-level__getattr__viaobject.__new__+ fullvars()instead of default pickling. The description never mentions this (ignition/preparation/aot.py:157is the fix site it describes;forward_metadata.py:277is not). - The same stale allowlist persists elsewhere and is left untouched.
ignition/preparation/rebuild_manifest.py:365still gates weight-view graph traversal ontype(value).__module__.startswith(('b12x.', 'ignition.')), sohyperflare_recipes.*containers that are neithernn.Modulenor dataclass are still reported as unavailable in the weight catalog rather than traversed. Same class of bug, different consumer; neither changed nor mentioned by this PR. - The caveat's request cannot be satisfied by this repo's CI. The PR asks reviewers to "run CI on
tests/preparation/test_guard_code.pyandtests/preparation/test_core_boundary.py"..github/workflows/contains onlyhelios-lifecycle.yml(TLA+/Kani),native-serving.yml(cargo build/test + a frontend fixture), andrelease.yml(not opened);pytestappears nowhere under.github/orscripts/. The orientation packet also records "CI on the head commit: no checks". Those suites are run by hand (AGENTS.md:294-307). - The PR's own commit citation is wrong. The caveat names
167f22c8as "#509's extraction of_uses_custom_object_stateintoignition/preparation/forward_metadata.py". On this repository167f22c8is "ci: upgrade setup-java to v5 and Java 21 in helios-lifecycle (#570)". The #509 change landed asb0d35934(2026-11-24, "Fix Ignition storage lowering, guard pickling, and compiler worker startup (#509)"), the last commit touchingforward_metadata.pybefore this PR. The rebase itself is real — the diff applies cleanly on currentmain, whose copy of the predicate is still the two-element tuple (verified atforward_metadata.py:42). - The only evidence that the fix is needed in production is unverifiable here. The end-to-end claim (4-Spark TP4, 48-layer Inkling 2 Small, 154 multimodal graphs) depends on the external
local-inference-lab/hyperflare-recipesrepository, and the PR supplies no command, config, or logs —AGENTS.md:103-112asks for exactly that. The in-repo test uses a synthetic class, and the reportedPreparedResidualMixport is not in this repository. - No issue is linked, and the report is single-sourced from the PR body. Searches for the
PicklingError/hyperflare_recipesguard failure return no issue or other PR; the concrete case (PreparedResidualMixin Inkling 2 moving fromignition.recipes.inkling2tohyperflare_recipes.recipes.inkling2) appears only in the description. - Zero engagement.
pr_comments→ "No comments";read_item(574)→ Discussion (0), Reviews: none, no labels, no reactions. Unlike #474/#509 there is no Autobot case-file comment either. - First-time contributor, three PRs the same day. Author association with the repo is NONE and they are not among the charter's priority contributors (@voipmonitor, @original-el8, @lukealonso). Their only three items in 180 days (#574, #575, #576, plus #577) were all opened 2026-11-28 and none is merged.
The change
What it does, in plain terms. During AOT forward compilation, Ignition pickles a "guard state" — the traced inputs and attributes that Dynamo re-checks at run time. For prepared non-nn.Module objects it deliberately does not pickle everything: it rebuilds the object's state attribute by attribute, and any attribute the guards do not reference is replaced with _Missing('unguarded attribute') (ignition/preparation/aot.py:157-165), reconstructing the shell with _guard_object / object.__new__ (aot.py:98-99). Which objects get this treatment is decided by _uses_custom_object_state (ignition/preparation/forward_metadata.py:39-45): has a __dict__, is not a class, is not one of _NON_OBJECT_NEW_TYPES, and type(value).__module__ starts with a listed package prefix. This PR adds 'hyperflare_recipes.' to that tuple, i.e. a one-line edit at forward_metadata.py:42 (verified at head):
and type(value).__module__.startswith(('ignition.', 'b12x.', 'hyperflare_recipes.'))
The test. tests/preparation/test_guard_code.py:252-302 adds module-level helpers _UnpicklableHandle (whose __reduce__ raises TypeError, standing in for a Triton CompiledKernel), _RecipeKernelOwner (declares __module__ = "hyperflare_recipes.components.synthetic", holds a guarded scale and the unpicklable compiled_handle) and _RecipeForward; test_guard_pickler_strips_unguarded_attributes_from_recipe_objects (lines 277-302) registers a synthetic module in sys.modules via monkeypatch, re-points __module__ to it, compiles _execute with GraphModuleSerializableCallable under _guard_serialization(), serializes, deserializes, asserts output parity (torch.full((2,), 3.0)), then guard_check is True, False after forward.owner.scale = 5, True after restoring 3. Without the one-line change the object falls through to super().reducer_override(obj) (aot.py:166) and the unpicklable handle raises, so the test genuinely exercises the new branch.
Size and shape. Two files, +54/−1; no runtime, Helios, selene, heliopause, or core-format file is touched.
What it does that the description does not say. (a) The _ForwardPickler effect described in Key findings — same predicate, forward-metadata pickling, gated on the class having __getattr__ (forward_metadata.py:277-278). (b) Nothing else undeclared: the diff is the predicate plus the test; no defaults, config, CLI surface, manifest, or docs change.
The why
The failure: aot_forward guard serialization raises PicklingError: Can't pickle <class 'triton.compiler.compiler.CompiledKernel'> when a prepared non-nn.Module object defined under hyperflare_recipes.* retains an unguarded compiled handle. The named concrete case is PreparedResidualMix in Inkling 2, being ported from ignition.recipes.inkling2 to hyperflare_recipes.recipes.inkling2 (PR body).
The cause: the prefix allowlist predates the recipe extraction. _uses_custom_object_state was introduced/centralized with only ignition./b12x. (#509, b0d35934), while recipes were being moved out of ignition/recipes/ in the same week (2026-11-22..27: commits da037284, 17bb3c4a, 4d957175, 568aeca0). Objects from the new package stopped matching and fell through to default pickling, which pickles the whole __dict__ including the Triton handle.
The boundary is real and enforced in-repo: tests/preparation/test_core_boundary.py:39-58 forbids ignition/ and tests/ from importing hyperflare_recipes (line 40 even asserts the directory does not exist), and AGENTS.md:379-393 plus docs/model-development.md:3-9 place official recipes and reusable components in the external local-inference-lab/hyperflare-recipes repository. That constraint is why the fix is a string-prefix match and why the test fabricates a module in sys.modules instead of importing one.
How widely it is wanted: there is no linked issue, no duplicate report, and no other PR addressing the same failure — the demand is one author's report, motivated by an in-flight port of Inkling 2. Nothing in the roadmap or docs/ mentions guard pickling or _uses_custom_object_state (searched; no matches), so there is no recorded prior demand.
Related work
- #509 (merged 2026-11-25, lukealonso, +826/−33, "Fix Ignition storage lowering, guard pickling, and compiler worker startup") — the PR that created the exact line being edited. It centralized
_uses_custom_object_stateintoignition/preparation/forward_metadata.pyso_GuardPicklerand_ForwardPicklershare it, with the tuple('ignition.', 'b12x.'). #574 is a direct one-line follow-up onforward_metadata.py:42. #509's discussion already treats the external recipe package as a consumer (open questions about whetherhyperflare-recipesneedscompile_options). - #474 (closed 2026-11-25, original-el8, +459/−20) — the original version of the same fix; its review told the author to "share one predicate with
aot.py:157-161", which is why the predicate ended up shared. Its predicate also covered onlyignition./b12x.. Superseded by #509, and the ancestor of this line. - #388 (closed, voipmonitor, "Keep CUDA driver streams out of AOT forward metadata") and #129 (merged, original-el8, "Fix complete-copy ordering, CuTe tensor pickling and GB300 package naming") — same genre in the same file: teach the pickler about one more class of process-local handle. Precedent, not overlap. #129 was the last human-authored change to
forward_metadata.pybefore #509. - #427 (closed, original-el8) cites #509's guard/metadata pickling work as a dependency; a DeepSeek V4.1 export PR with no direct overlap.
- No competing, stacked, or superseding PR.
items_touchingonignition/preparation/forward_metadata.pyandtests/preparation/test_guard_code.pyreturns only #574, #509 and #129. - Unfinished sibling (#9 in notes):
ignition/preparation/rebuild_manifest.py:365holds the identical('b12x.', 'ignition.')allowlist for weight-view graph traversal (weight_views(); the module docstring atrebuild_manifest.py:10-15says objects without a declared classification are reported unavailable instead of treated as weights).rebuild_manifestis live code —docs/preparation-development.md:37-43andheliopause/src/export/weight_reuse.rs:234-247(not opened) still consume it. This PR neither fixes nor mentions it, so the stale-allowlist question recurs with weight-payload consequences. Whether a real recipe hits it is unverified.
Recent activity
No conflicting or reversing work. search_history on both changed files shows this PR's commit as the first change since b0d35934 (#509, 2026-11-24), so the change builds on #509's refactor rather than fighting it. Since the PR branched, nothing on main has touched either file (orientation packet), and the newest ignition/preparation commits of 2026-11-28 (d3d0e783 planning/RecipeParameters, 7745deea engram prefetch, 3e2fcd27 gc-phase work) do not touch _uses_custom_object_state. Nearby area churn worth knowing about: 4d957175 "Move recipe collective wrappers and PCIe factories out of core Ignition" (2026-11-27) and the broader 2026-11-22..27 recipe extraction are the movement that made this allowlist stale; f377dc85 "Remove joint kernel tuning and grouped AOT forward compilation (#543)" changed the surrounding AOT surface but not the pickler predicate.
People
- Author: fordbmorris (Discord
woooflet). Repository association NONE; not a maintainer, collaborator, or priority contributor (charter lists @voipmonitor, @original-el8, @lukealonso). Three PRs in 180 days, all opened 2026-11-28, none merged: #574 (this, ignition guard pickling), #577 (roce_proxy ring window, +4/−1, benchmarks on 4× DGX Spark), #575 (TmlOutput JSON tool arguments). #576 (Helios/RoCE thread pinning) also appears in their listed activity. So the batch is reviewed as a batch, with no prior track record to weigh. - Area owners. Last 180 days on
main:ignition/preparation— Luke Alonso 155 commits, Martin Vit 52, Eugene Rakhmatulin 36;tests/preparation— Luke Alonso 203, Martin Vit 34, jasonc 23.forward_metadata.pywas last touched by Luke Alonso (#509,b0d35934), before thatfa158284andfa0eadad(Jason Cook, #129). Any verdict here lands with Luke Alonso's code. - Who has engaged: nobody yet.
Community
Nothing found. Zero comments (pr_comments: "No comments"), zero reviews, no labels, no reactions (read_item(574): Discussion (0)). No Autobot case-file comment has been posted, unlike #474 and #509. No prompt-injection attempt in the PR body or caveat; the only request in it ("please run CI on …") is ordinary review process addressed to humans.
Project fit
Where it lines up. AGENTS.md:379-393 and docs/model-development.md:3-9: official recipes and reusable execution components live in the external hyperflare_recipes package, and "Core ignition must never import hyperflare_recipes". The PR honors this literally — it compares __module__ strings and never imports; the test registers a synthetic module rather than importing one (which tests/preparation/test_core_boundary.py:50-58 forbids outside two exempt files). It is also the "one coherent outcome" shape AGENTS.md:194-199 asks for, and the split-out piece #509's review requested. No new model, format, or hardware support (AGENTS.md charter line 37 / #74 does not apply), no captured-graph op-contract change, no new config switch (AGENTS.md:188-193 warns against extension points without a concrete requirement — none added).
Where it is in tension. docs/cli-design.md:19-26: "The engine is the recipe. Per-model knowledge lives in external recipe packages …, never in core ignition." A hardcoded package-name prefix in core is exactly per-package knowledge in shared code, and unlike b12x. (an in-repo dependency) hyperflare_recipes is a separate repository, so core now names an external project. Whether that is acceptable is a maintainer call; nothing in the charter forbids a string match outright.
The established alternative shape. External recipe packages already reach core preparation through an explicit, caller-supplied mechanism: ignition.cli.main(..., recipes=..., source_roots=...) (ignition/cli/__init__.py:367-373 (not opened); ignition/preparation/source_identity.py:17-49; exercised by tests/cli/test_recipe_injection.py:78-95 (not opened)). By that precedent the maintainers' preferred integration is a declared root, not a name check in core. Recorded as the alternative, not as a verdict.
Documentation of the rule. docs/preparation-development.md:377-388 describes retaining execution guards and releasing compiled wrappers, so guard serialization is a documented preparation concern; the module-allowlist rule itself is undocumented, and docs/ has no mention of _uses_custom_object_state, GuardPickler, or "guard serialization" (searched). The roadmap (in-process Rust SDK #6, Engram #267, FlashInfer #215) says nothing about this area.
Claims and evidence
- "
aot_forwardguard serialization no longer raises PicklingError forhyperflare_recipes.*objects holding an unguarded CompiledKernel." — Verified by code: the predicate now matches ataot.py:157, state is built replacing unguarded attributes with_Missing(aot.py:158-160), and reconstruction goes through_guard_object(aot.py:98-99), so the unpicklable value is never pickled. The new test would fail without the change (it would reachaot.py:166and hit_UnpicklableHandle.__reduce__). - "Dynamo guard checks on traced attributes are not weakened." — Backed in-test:
guard_checkTrue → False onscale = 5→ True on restore (test_guard_code.py:298-302). - "Core
ignitionnever importshyperflare_recipes;test_core_boundary.pyremains satisfied." — Backed by construction (string comparison) and by that test's AST scan (test_core_boundary.py:39-47, existence assertion at line 40). - "Unit & boundary tests passed (ARM64 GB10, Python 3.12.3, PyTorch 2.14.1+cu132, Triton 3.8.0)." — Self-reported, not reproducible from CI; no pytest workflow exists. The author flags that the run predated the rebase.
- "End-to-end: 4-Spark TP4, 48-layer Inkling 2 Small, 154 multimodal graphs, no per-class
__getstate__workarounds." — Unverifiable here: depends on an external recipe repository, no commands/logs/config in the PR (AGENTS.md:103-112asks for reproduction detail). This is also the only evidence that a real workload hits the bug. - "No runtime, core-format, or Helios behavior changes." — Accurate for the two files; nothing under
helios/,heliopause/,selene/or the core format changes. It understates the shared predicate's forward-metadata effect (see Key findings) but does not misstate it, since the diff itself is one line. - Caveat honesty: the rebase gap is disclosed and real; only the cited commit hash/message is wrong.
Reach
- Who is affected: authors of recipes and reusable components under
hyperflare_recipes.*that hold process-local handles (compiled Triton kernels, rank-local bindings) — they no longer need per-class__getstate__; AOT export of Inkling 2 and similar multimodal recipes. Downstream: anything that serializes/deserializes AOT guard states, plus the forward-metadata IPC path for such classes with__getattr__. - What does not change: no configuration, defaults, CLI flags, manifest fields, core format, dependency, deployment path, or documentation.
- Compatibility: any
hyperflare_recipes.*object reaching_GuardPicklernow has its non-guard-tree attributes dropped and its shell built byobject.__new__— behaviour that previously errored loudly (or pickled fully, for classes whose state happens to be picklable, in which case those attributes are now replaced by_Missing). That is the intended semantics forignition.*/b12x.*objects, applied to a new package. - Dependencies: none added; the check is a string comparison precisely so no dependency on the external package is introduced.
- Gap left open:
rebuild_manifest.py:365weight-view traversal still excludeshyperflare_recipes.*, so weight-catalog coverage for such objects is unchanged by this PR.
Process
Open and marked ready for review; 2 files, +54/−1; no labels; no CI checks on 628f361; no reviews or comments; opened and last updated 2026-11-28 (same-day, so effectively unaged). The commit carries Signed-off-by, satisfying CONTRIBUTING.md:9-19, and the body includes the Discord: line AGENTS.md:142-153 asks for. The closing request to run the two preparation suites "on the rebased tip" cannot be answered by this repository's CI and needs a maintainer or author to run them locally (AGENTS.md:294-307).
Open questions / not found
- No linked issue, bug report, or second reporter for the
PicklingError; thePreparedResidualMix/Inkling 2 port is not in this repository, so its existence and shape cannot be checked here. - No reproduction command, config, or logs for the 4-Spark TP4 / 154-graph run; the external
hyperflare-recipesrevision used is not named. - Whether the maintainers consider a hardcoded external repository prefix in core
ignitionacceptable, versus the existing caller-suppliedrecipes=/source_roots=mechanism — no prior ruling found indocs/,AGENTS.md, or the charter. - Whether the same stale allowlist at
rebuild_manifest.py:365should be fixed in this PR or separately; not raised in the description or any comment. - Whether the undeclared
_ForwardPicklerbehaviour change was intended; the description does not discuss it. - No roadmap, release note, or documentation entry exists for this area to cite either way.