Explore scratchpad · NVIDIA/hyperflare-inference #518

Raw Markdown for agents: https://autobot.eidonix.com/p/9518767f-6bd1-44e0-bcf5-ad3944eabdec.md

#1 [high] Change: what PR #518 adds, file by file, verified against the diff

PR #518 "Add recipe-declared --target-head-quantization preparation flag", by nero- (CONTRIBUTOR), open 2026-11-25 14:52, head f54928b, base main. 10 files, +126/-10.

Diff inventory (verified via pr_diff, ref pr/518):

  1. ignition/declaration.py:277-278 — Recipe.target_head_quantizations: tuple[str, ...] = () added next to existing draft_head_quantizations. Comment above them changed from "used only by proposals" to "vocabulary and transition projections". :328-329 — __post_init__ rejects any name not in ("mxfp8",) with ValueError "target_head_quantizations must name supported target vocabulary head formats".
  2. ignition/cli/init.py:212-214 — new --target-head-quantization in the "advanced options" argument group, choices=("mxfp8",), help "prepare the target vocabulary head as MXFP8 for recipes that declare it (default: checkpoint precision)". No model names in help text (contrast: neighbouring --draft-head-quantization at :207-211 names DeepSeek/Qwen/Kimi models).
  3. ignition/cli/preparation.py:57 — derive(...) gains keyword target_head_quantization: str | None = None; :73 forwards into replace(plan, target_head_quantization=...). Note: it is NOT passed into planning.plan(...) — it is set by dataclasses.replace after planning, so Plan.post_init validation runs on the replaced instance.
  4. ignition/cli/serve.py — three call sites forward getattr(args, "target_head_quantization", None): _export_hosts (:210, multi-host/--ranks>1 path), _prepare (:278, single-host export/prepare path), debug_serve (:479). Startup status summary adds · target head mxfp8 (:314).
  5. ignition/cli/bench.py:170 forwards the flag into derive; :244-252 rewrites the details["configuration"]["preparation"] dict comprehension to add target_head_quantization only when the key is present.
  6. ignition/planning.py:199 — Plan.target_head_quantization: str | None = None; :289-292 __post_init__ raises UsageError("--target-head-quantization {fmt}: {self.checkpoint.alias} does not prepare this target head format") when not in recipe.target_head_quantizations; :411-412 to_dict() includes the key only when not None (same idiom as draft_body_quantization at :423-424).
  7. ignition/preparation/rebuild_manifest.py:302-303 reproduction_arguments appends --target-head-quantization <v> when set; :363-364 from_plan adds target_head_quantization under SCOPE_TARGET_WEIGHT (PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT) when set.
  8. docs/cli-design.md:454 — one table row in the preparation-flag table.
  9. tests/cli/test_commands.py +42: _fixture_recipe gains target_head_quantizations=(); test_target_head_quantization_flag_is_model_agnostic parametrized over export/debug-serve/bench asserts default None, accepts mxfp8, --help exits 0 and the help section between --target-head-quantization and --markov-head-quantization contains no "Qwen"; test_derive_forwards_and_validates_target_head_quantization asserts plan value, to_dict, and UsageError message.
  10. tests/cli/test_planning.py +46: _recipe(...) gains the kwarg; test_target_head_quantization_validation_and_preparation_manifest asserts Recipe rejects "nvfp4", base plan omits key, replace(...) sets it, reproduction_args has the flag iff set, Protobuf round-trip via json_format.ParseDict → PreparationManifest, parameter scope == PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT, value "mxfp8", keys sorted/unique; and unsupported recipe raises UsageError "not prepare this target head format" — test regex is "--target-head-quantization mxfp8: plain-alias".

Total: 5 production files touched in ignition/{cli,planning,declaration,preparation} + 1 doc + 2 test files. No Rust, no .proto, no helios/, no heliopause/, no ignition/components/.

#2 [high] Change: the flag is declaration/plumbing only — nothing in-repo consumes it

Verified by exhaustive grep target_head_quantization at ref pr/518: the only production readers of plan.target_head_quantization are

Symmetrically, no in-tree recipe declares target_head_quantizations — grep finds only declaration.py:277-278, the tests' fixture recipes, and planning.py:289. So in this repo the flag can currently only ever be rejected; it becomes usable only with the external local-inference-lab/hyperflare-recipes PR #40 (Qwen3.8-Flash-Next), which the PR description names.

This mirrors exactly the blocker Autobot raised on the sibling PR #516 ("Nothing in the repository consumes or verifies the selection"; see case note "Related work: #516"). Unlike #516, #518 also does not add a bootstrap.py/BasePreparationConfig field or document a recipe-side contract, and does not touch ignition/cli/help.py (MODEL --help per-recipe output) or docs/runtime-core-design.md.

Also note: the declared mechanism is a CLI flag validated against a recipe declaration — the declaration is recipe-declared, but the default is never taken from the declaration. Omitting the flag always means "checkpoint precision", i.e. Recipe.target_head_quantizations only acts as an allow-list, never as a default. Compare online_mxfp8_scope, planning.py:223-225, which resolves the omitted value from the recipe.

Citation: pr_diff + search_code target_head_quantization at ref pr/518.

#3 [high] Why: target vocabulary precision was previously an invariant of conversion flags

Context that makes the flag's purpose clear: existing conversion paths deliberately exclude the target vocabulary head.

Citations: docs/cli-design.md:453-454, 474; docs/mtp-design.md:64; read_item 291, 312 (search hit), 229.

#4 [high] Change: flag applied by dataclasses.replace after planning, not inside plan/fit

Undeclared structural difference from sibling flags: target_head_quantization is NOT a parameter of planning.fit(...) (ignition/planning.py:445-453) or planning.plan(...) (:581-589), unlike row_shard_prefill, online_mxfp8, expert_scale_compression, mla_compute_mode, language_model_only. Instead ignition/cli/preparation.py:70-75 applies it with dataclasses.replace(...) after planning.plan(...) returns, and ignition/cli/serve.py:206-211, 475-480 do the same.

Consequences (verified by reading the code, not a design judgement):

  1. Memory planning can never see the flag. Plan.__post_init__ computes weights_bytes via recipe.weights_bytes(...) inside plan() (planning.py:524-533) before the replace; Recipe.weights_bytes (declaration.py:363-374) has no head-parameter. So the ~600 MiB TP1 saving the description attributes to this stack is not reflected in the weights_bytes/pages estimate, GPU auto-selection or fit/_shortfall capacity errors. Every other compression flag (expert_scale_compression via checkpoint.scale_compressed_device_bytes) is inside that estimate.
  2. Validation lives only in Plan.__post_init__ (planning.py:289-293), so any other caller that constructs a Plan directly (e.g. tests, planning.plan(...) without the replace) gets no rejection; fit/plan do not validate the value at all, so an unsupported recipe reaches the plan only through the CLI rewrite.
  3. derive()'s new kwarg is not forwarded to planning.plan, so derive and plan disagree on where the flag enters.

Also: three of the five forwarding sites use getattr(args, "target_head_quantization", None) (serve.py:210, 278, 479; bench.py:170) although _preparation_arguments always defines the flag for export/bench/debug-serve (cli/init.py:212 is inside _preparation_arguments, called at :50, :53, :60). The defensive getattr matches the file's local style for draft flags but a reviewer on #516 asked for exactly this redundancy to be removed (see "Related work: #516"). rebuild_manifest.py:302 uses getattr(plan, ...) while :363 uses the direct attribute.

Citations: ignition/planning.py:445-453, 524-533, 581-589; ignition/declaration.py:363-374; ignition/cli/preparation.py:70-75; ignition/cli/serve.py:206-211, 475-480; ignition/cli/bench.py:162-177.

#5 [high] Related work: #516 and #508 are same-shape concurrent PRs on the same files

Three near-identical, same-day PRs add a recipe-declared preparation flag to the same eight-to-ten files. All open against main as of 2026-11-25:

Shared-file overlap: #518 vs #508 share all 10 files; #518 vs #516 share 8 (declaration.py, planning.py, cli/{init,bench,preparation,serve}.py, rebuild_manifest.py, docs/cli-design.md) — all three touch ignition/cli/bench.py's _measure configuration dict and rebuild_manifest.from_plan's parameter list, so they will conflict textually. #499 (the merged sibling of #508, merged 2026-11-24 23:38) already landed the row_shard_prefill parameter/Recipe.row_shard_prefill_world_sizes pattern that #518 copies.

Autobot already reviewed both siblings with "Changes Requested" the same day:

Citations: read_item 516, read_item 508, read_item 499; related_items 518.

#9 [high] Claims: zero-change and recipe-free claims verified; performance numbers unattributed to this PR

Claims in the PR body vs what the diff supports:

  1. "omitting --target-head-quantization leaves plans, Plan.to_dict(), PreparationManifest entries, exports, and checkpoint precision completely unchanged." — SUPPORTED by the diff: all new emissions guard on is not None (planning.py:411, rebuild_manifest.py:302, 363), Recipe.target_head_quantizations defaults to (), and the CLI default is None. The one unconditional change is the docs/cli-design.md row and the refactored dict literal in bench.py:243-252 (same keys when the flag is unset).
  2. "Core ignition remains strictly recipe-free (ignition/components/ retains its exact 13 Helios-ABI modules), Helios runtime policy and PreparedContract are untouched." — SUPPORTED: tests/preparation/test_core_boundary.py:11-26 pins the 13 modules and the diff touches none of them; no helios/, heliopause/ or .proto file is in the diff (10 files, all Python/docs).
  3. "with automatic TARGET_WEIGHT scope validation in flare combine and --reuse-weights." — PARTLY MISLEADING, but mechanically true: helios/src/runtime_core/preparation.rs compares target_weight-scoped parameters generically via scope_slice equality (:286-347), so any new key participates with no Rust change. It is not validation of the value — a core prepared with the flag simply cannot be combined with or reused by one prepared without it, because the parameter lists differ. Note compatible_for_combine (:310-321) requires exact equality of all non-deployment parameters, so this new key becomes a hard combine gate between two logs of the same recipe; that is the intended behavior but is a new compatibility constraint introduced by an Ignition-only change.
  4. "End-to-end serving gains ... +7.5–9.0% C1 decode, ~600 MiB saved on TP1, 44/44 quality gate PASS; plus combined-stack TP2 RoCE 116.0 / 164.2 / 230.5 / 332.4 tok/s abbench and 100% quality gate — belong to the paired core + recipe stack, not this core flag alone." — No measurement of this PR alone; the description explicitly disclaims attribution. The body does not give the C1 baseline tok/s, the two package identities, the exact commands, or a link to the recipe PR's evidence, and hyperflare-recipes#40 is not readable from this repository. So: claimed, not evidenced within this repo.
  5. "144 passed, 0 failed in 4.35s" with one test deselected — reproducible command given, host and base commit named, reason for the deselection given. One unrun check disclosed (cargo test, justified because no Rust changed). No CI run exists to corroborate the 144.
  6. "freeing the temporary BF16 vocabulary weight after conversion" (docs row and PR body) — this is a recipe-side behavior claim. Nothing in ignition/preparation/ can free or convert a head; BasePreparationConfig/common_preparation_kwargs (bootstrap.py:24-65) does not carry the flag, so the only route for a recipe to see the choice is plan.target_head_quantization on the Plan object it is handed in prepare(snapshot, plan, ...) (serve.py:231). That route works but is undocumented in the repo.
  7. PR body says the flag is "model-agnostic" and the tests enforce no model name in help — SUPPORTED, except that the docs row and the PR body themselves name Qwen3.8 Flash Next; help text does not (cli/init.py:212-214), unlike the neighbouring --draft-head-quantization help, which names DeepSeek/Qwen/Kimi models.

Citations: pr_diff; helios/src/runtime_core/preparation.rs:286-347; tests/preparation/test_core_boundary.py:11-26; ignition/preparation/bootstrap.py:24-65; ignition/cli/serve.py:231; read_item 518.

#10 [high] Project fit: matches the no-env-var / explicit-config rules; allow-list tuple is the contested point

Charter/docs facts that bear on this change (read_charter; docs/cli-design.md:15-49, 439-441): Aligned:

Citation: read_charter; docs/cli-design.md:15-49, 439-441, 474; docs/design-review.md:76-83, 97-105, 125-136.

#11 [high] Reach: new TARGET_WEIGHT key becomes a hard combine/reuse gate; no wire or serving impact

Compatibility surface of the new SCOPE_TARGET_WEIGHT parameter target_head_quantization (helios/src/runtime_core/preparation.rs):

Reach summary: affects ignition export, ignition debug-serve, ignition bench (all three define the flag through _preparation_arguments, cli/init.py:50/53/60), the startup status line, the bench JSON configuration.preparation block, Plan.to_dict() (consumed as JSON on stderr by export/debug-serve/bench), and PreparationManifest.reproduction_args + parameters. It does not affect flare run/Helios serving (serving ignores preparation metadata, preparation.rs:10-12), flare combine/--reuse-weights except through the new equality gate, config.toml, or any dependency/pin.

Citations: helios/src/runtime_core/preparation.rs:10-12, 82-138, 310-347, 351-383; helios/src/runtime_core/protobuf.rs:27-28; ignition/cli/init.py:50-60; ignition/cli/bench.py:243-252.

#6 [medium] Process: open, unlabeled, zero comments, no CI; single squashed commit

Verified from the diff and status:

Citations: read_item 518; search_history (ignition/planning.py, ignition/declaration.py) at pr/518; docs/design-review.md:161-208; .githooks/commit-msg.

#7 [medium] People: author history — recipe-declaration pattern from #433, one PR already relocated to the recipe repo

Author: nero- (GitHub handle), commits as "Nero" and "Jonathan Gutierrez". GitHub association with the repo: CONTRIBUTOR (not one of the listed priority contributors — charter/docs name @voipmonitor, @original-el8, @lukealonso). Discord: nero. History in last 180 days: 3 merged, 2 closed, 2 open PRs plus 2 open issues (#119 orbit package-cache eviction, #118 DeepSeek positions<128). Merged work touched helios/src (2), ignition/preparation (2), ignition/recipes (2), tests/preparation (2), tests/recipes (2):

Who else works here: ignition/{cli,planning,declaration} is dominated by Luke Alonso (77-255 commits per area in 180 days), then Martin Vit and jasonc; ignition/preparation by Luke Alonso (149), Martin Vit (48), Eugene Rakhmatulin (36). Luke Alonso authored the PreparationManifest deprecation (2771618) and the manifest-scope design in docs/runtime-core-design.md — i.e. the reviewer most likely to decide on the SCOPE_TARGET_WEIGHT placement. #291 (its pattern source) was merged by voipmonitor, a priority contributor.

Citations: orientation packet (author history); read_item 467; read_item 291; search_items "head quantization mxfp8" (hit #433 comment by nero-); search_history ignition/planning.py.

#8 [medium] Reach: docs updated in one table row only; per-model help and scope docs untouched

Only docs/cli-design.md:454 was edited (one table row). Nothing else in the repository documents the flag:

Citation: pr_diff (docs/cli-design.md hunk); read_file help.py; read_file docs/runtime-core-design.md:355-400; read_file ignition/cli/config.py:20-51.

#12 [medium] Related work: lead triage — followed vs not relevant; no prior issue asks for this flag

Leads in the orientation packet followed (for the report's completeness):