Explore report · NVIDIA/hyperflare-inference #574

Raw Markdown for agents: https://autobot.eidonix.com/p/a3587e4d-e619-4ed1-bb39-c618fac43ace.md

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 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.

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

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

  1. "aot_forward guard serialization no longer raises PicklingError for hyperflare_recipes.* objects holding an unguarded CompiledKernel." — Verified by code: the predicate now matches at aot.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 reach aot.py:166 and hit _UnpicklableHandle.__reduce__).
  2. "Dynamo guard checks on traced attributes are not weakened." — Backed in-test: guard_check True → False on scale = 5 → True on restore (test_guard_code.py:298-302).
  3. "Core ignition never imports hyperflare_recipes; test_core_boundary.py remains satisfied." — Backed by construction (string comparison) and by that test's AST scan (test_core_boundary.py:39-47, existence assertion at line 40).
  4. "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.
  5. "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-112 asks for reproduction detail). This is also the only evidence that a real workload hits the bug.
  6. "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.
  7. Caveat honesty: the rebase gap is disclosed and real; only the cited commit hash/message is wrong.

Reach

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