Explore scratchpad · NVIDIA/hyperflare-inference #574

Raw Markdown for agents: https://autobot.eidonix.com/p/3c77a774-3299-40a9-a251-808b8fe1d242.md

#1 [high] Change: the diff itself (2 files, +54/-1)

PR #574, head 628f361 (author woooflet / Discord woooflet), base main, 2 files, +54/-1.

  1. ignition/preparation/forward_metadata.py:39-45 _uses_custom_object_state — tuple extended: before: type(value).__module__.startswith(('ignition.', 'b12x.')) after: type(value).__module__.startswith(('ignition.', 'b12x.', 'hyperflare_recipes.')) Rest of predicate unchanged: hasattr(value,'dict'), not inspect.isclass, not isinstance(value, _NON_OBJECT_NEW_TYPES).

  2. tests/preparation/test_guard_code.py:250-302 — new test_guard_pickler_strips_unguarded_attributes_from_recipe_objects, plus module-level helpers _UnpicklableHandle (its __reduce__ raises TypeError), _RecipeKernelOwner (__module__ = "hyperflare_recipes.components.synthetic", holds guarded scale + compiled_handle), _RecipeForward. The test registers a synthetic module hyperflare_recipes.components._synthetic_guard_test in sys.modules via monkeypatch, re-points _RecipeKernelOwner.__module__ to it, compiles _execute with GraphModuleSerializableCallable under _guard_serialization(), serializes (type(compiled).serialize(compiled).serialized_data), deserializes, asserts output parity (torch.full((2,), 3.0)), guard_check True, then scale=5 -> False, scale=3 -> True. Note: the test never imports hyperflare_recipes (package does not exist in this repo — tests/preparation/test_core_boundary.py:40 asserts not (ROOT/"hyperflare_recipes").exists() and :50-58 forbids tests importing hyperflare_recipes).

#2 [high] Change: the predicate is shared — reach beyond AOT guards

_uses_custom_object_state (ignition/preparation/forward_metadata.py:39-45) has three call sites at head:

So the one-line change also alters forward-metadata (worker IPC) pickling for hyperflare_recipes.* classes that define __getattr__: they are now reconstructed via object.__new__ + full vars() instead of default pickling. PR title/description only claims the AOT guard-serialization effect; this second effect is undeclared (narrow, since it requires a class-level __getattr__). Predicate is deliberately string-only, so core ignition never imports hyperflare_recipes (cf. AGENTS.md:392-393 "Core ignition must never import hyperflare_recipes" and tests/preparation/test_core_boundary.py:39-47).

#3 [high] Why: the reported PicklingError and the stale module allowlist

Reported problem (PR #574 body, https://github.com/NVIDIA/hyperflare-inference/pull/574): during AOT forward compilation _GuardPickler raises PicklingError: Can't pickle <class 'triton.compiler.compiler.CompiledKernel'> when a non-nn.Module prepared object defined under hyperflare_recipes.* keeps an unguarded compiled handle. Named concrete case: PreparedResidualMix in Inkling 2, being ported from ignition.recipes.inkling2 to hyperflare_recipes.recipes.inkling2.

Cause: _uses_custom_object_state's module-prefix allowlist ('ignition.', 'b12x.') predates the recipe extraction, so hyperflare_recipes.* objects fall through to default pickling in _GuardPickler (aot.py:166 return super().reducer_override(obj)), which tries to pickle the whole __dict__ including the Triton CompiledKernel.

How it got stale: the predicate was introduced/expanded for ignition.*/b12x.* in #474/#509 (see related-work note) while recipes were being moved out of ignition/recipes/ on 2026-11-22..27 (commits da037284, 17bb3c4a, 4d957175, 568aeca0). No linked issue: search_items for "hyperflare_recipes pickling guard" and "aot_forward guards PicklingError Triton kernel" (issues) return only this PR — the report is single-sourced from the PR body. Repo-visible corroboration that the module boundary is real: tests/preparation/test_core_boundary.py:39-58 forbids ignition/ and tests/ from importing hyperflare_recipes; AGENTS.md:379-393 and docs/model-development.md:3-9 put official recipes in the external local-inference-lab/hyperflare-recipes repo.

#4 [high] Related work: #509 created the line, #474 its predecessor, #388/#129 precedent

#5 [high] Process/activity: no Python CI exists, and the cited extraction commit is misidentified

#7 [high] Project fit: respects the core boundary literally, tensions with "the engine is the recipe"

Where it lines up:

#8 [high] Claims vs evidence: fix and boundary verified in code; GPU end-to-end run unverifiable

Claims and what backs them:

  1. "Fix: aot_forward guard serialization no longer raises PicklingError for hyperflare_recipes.* prepared objects holding an unguarded CompiledKernel." — Verified by reading the code path: _GuardPickler.reducer_override (ignition/preparation/aot.py:118-166) now matches such objects at line 157, builds state replacing every attribute whose id is not in self.guard_tree_values with _Missing('unguarded attribute') (lines 158-160), and reconstructs via _guard_object (aot.py:98-99, object.__new__). So an unpicklable attribute value is never pickled. Backed by the new unit test, which fails without the change (it would reach super().reducer_override and pickle _UnpicklableHandle, whose __reduce__ raises TypeError).
  2. "Guarded attributes keep their guard checks (no weakened guards)." — Backed in-test: guard_check True → False after scale = 5 → True after scale = 3.
  3. "Core ignition never imports hyperflare_recipes; test_core_boundary.py stays satisfied." — Backed by construction (string prefix comparison) and by the boundary test's AST scan (tests/preparation/test_core_boundary.py:39-47, assert at :40 that the directory does not even exist).
  4. "Unit & boundary tests passed on 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; see process note). The author flags that the run predated the rebase and asks for CI to confirm on the rebased tip.
  5. "End-to-end: 4-Spark TP4, 48-layer Inkling 2 Small, 154 multimodal graphs, no per-class __getstate__ workarounds." — Unverifiable here: the recipe lives in the external hyperflare-repo (local-inference-lab/hyperflare-recipes), the run left no logs/commands in the PR, and the PR gives no reproduction command or config (AGENTS.md:103-112 asks for exactly that). It is also the only evidence that the fix is needed in practice, since the in-repo test uses a synthetic class.
  6. Descriptions of scope — "No runtime, core-format, or Helios behavior changes": accurate for the two changed files; nothing in helios/, heliopause/, selene/, or the core format is touched. But it omits the _ForwardPickler effect (see the undeclared-effect note).
  7. Caveat honesty: the PR states the rebase gap explicitly; the cited commit hash is wrong (see process note), but the substance (a rebase happened; the predicate now lives in forward_metadata.py) checks out on main.

#6 [medium] People & Community: first-time contributor, three same-day PRs, no comments or reviews

#9 [medium] Related work: the same allowlist exists again in rebuild_manifest.py weight traversal

Second lifetime of the same allowlist in shared code: ignition/preparation/rebuild_manifest.py:338-374 weight_views() walks object graphs for exported weight metadata and only descends into objects whose type is a torch.nn.Module, a dataclass, or type(value).__module__.startswith(('b12x.', 'ignition.')) (line 365). Any hyperflare_recipes.* container type that is neither an nn.Module nor a dataclass is therefore reported as unavailable in the weight catalog rather than traversed (module docstring rebuild_manifest.py:10-15: objects without a declared classification are reported unavailable instead of being treated as weights). This PR does not touch that line and its description does not mention the sibling predicate, so the stale-allowlist question reappears in a second consumer with different (weight-payload) consequences. docs/preparation-development.md:37-43 says rebuild_manifest.from_plan builds PreparationManifest, and Heliopause still accepts rebuild_manifest for legacy cores (heliopause/src/export/weight_reuse.rs:234-247), so this file is live code. Confidence: read from source; whether a real recipe hits it is unverified.

#11 [medium] Leads checked and dismissed: #577/#575/#576/#516/#512 and the title-word matches

Orientation-packet leads I checked and judged not relevant (so the report can dispose of them):

#10 [low] Community/activity: nothing found — zero engagement, no conflicts, no injection

Nothing found on either count, recorded so the report can say so with a citation: