Review of PR #518 — Add recipe-declared --target-head-quantization preparation flag
Lens: subtraction only. Change measured from the diff: 10 files, +126 / −10.
Key findings
- Blocking — the flag re-implements a mechanism the repository already has.
--online-mxfp8 --online-mxfp8-scope GROUPis already a recipe-declared, CLI-only, recipe-free opt-in that selects an arbitrary named conversion group and carries it throughPlan,Plan.to_dict(), the reproduction args andSCOPE_TARGET_WEIGHTinPreparationManifest. PR #312 shows the target-vocabulary-head case is exactly such a group (--online-mxfp8-scope with-vocabulary-head, "No kernel, Helios code, Protobuf field or package contract changes"). The whole diff, ~126 lines, can go. - Should fix — ~88 added test lines clone three existing tests verbatim in shape. Removable even if the flag were kept.
- Should fix —
bench.pygrows a 12-line dict literal into a 21-line pair of**{}splats for one optional key, and fivegetattr(..., None)fallbacks guard attributes that always exist. ~10 lines. - Nit —
Recipe.__post_init__validation duplicates thePlancheck that actually produces the user-facing error, and the sibling override tuples have no recipe-level check. 2 lines. - Nit — an extra startup status item and an extra doc table row restate what the online-MXFP8 scope line and rows already say. 2 lines.
Rules this is judged against: charter line 12 ("Keep the runtime small and model-agnostic … implemented once via a single general mechanism") and "Look for the smallest footprint in shared code, or a way to solve it without new code at all"; AGENTS.md:188-193 ("Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"); docs/design-review.md:80 (principle 10: settings belong in recipe declarations, config files or CLI flags — satisfied by the existing flag) and :125 (principle 15, reject scope expansion).
1. Blocking: the entire flag duplicates --online-mxfp8-scope (about 126 lines)
What already exists, verified in the code:
- Recipe declaration:
ignition/declaration.py:267-269—online_mxfp8: bool,online_mxfp8_scope: str = "all",online_mxfp8_scopes: tuple[str,...] = ("all",). Group names are recipe-chosen and free-form; the only check is membership (declaration.py:314,planning.py:226,planning.py:605-606). Helios never allowlists a group name:helios/src/core/conversion.rs:7554(not opened) merely rewrites a legacy arg, andhelios/src/runtime_core/preparation.rs:171-176copies whatever string the manifest records. - Plan plumbing:
ignition/planning.py:206-207, 223-229—Plan.online_mxfp8/online_mxfp8_scope, validated against the recipe, with--online-mxfp8required for a non-default group. That is byte-for-byte the same shape as the newplanning.py:199, 289-293. - CLI:
ignition/cli/__init__.py:262-270— both flags already exist on all three commands, which share_preparation_arguments. The new argument at:212-214is a third vocabulary-precision flag in the same block as--draft-body-quantization(:204) and--draft-head-quantization(:207). - Manifest:
ignition/preparation/rebuild_manifest.py:294-297(reproduction args) and:358-360(online_mxfp8+online_mxfp8_scoperecorded underSCOPE_TARGET_WEIGHT) are exactly what the PR re-creates at:302-303and:363-364. - Docs:
docs/cli-design.md:475already documents--online-mxfp8-scope SCOPEas "Select a conversion group declared by the recipe", and:474already says which projections each group converts. The new row at:454is a second way to say it. - Precedent that a target-vocabulary-head group is the intended mechanism: PR #312, commit 7, adds
--online-mxfp8-scope with-vocabulary-head, which quantizes the target vocabulary shard ("a round reads 239 MB of vocabulary weights per rank"), states "The scope enters the tuning identity and the rebuild manifest. No kernel, Helios code, Protobuf field or package contract changes", and was demonstrated on the same DGX Spark TP4 target this PR is written for.
What goes (the whole diff): ignition/declaration.py:278 and :328-329 (plus the comment reword at :276, which exists only to accommodate the new field); ignition/planning.py:199, 289-293, 411-412; ignition/cli/__init__.py:212-214; ignition/cli/preparation.py:57, 73; ignition/cli/serve.py:210, 278, 314, 479; ignition/cli/bench.py:170, 250-251; ignition/preparation/rebuild_manifest.py:302-303, 363-364; docs/cli-design.md:454; and all ~88 test lines listed in finding 2.
Replacement: nothing. The companion Qwen3.8-Flash-Next recipe declares online_mxfp8=True and adds a vocabulary-head entry to online_mxfp8_scopes — identical end-to-end effect: opt-in, recipe-declared, recipe-free core, carried through Plan, recorded in SCOPE_TARGET_WEIGHT, rejected by recipes that do not declare it, no helios/ or Protobuf change, no environment variables.
Why nothing is lost: every property the description claims for the new flag is already supplied by the existing one. A reviewer reading the diff has to learn two names for one behaviour; a recipe author now has two places to declare the same conversion and no rule for which to pick.
Saves: about 126 lines.
2. Should fix: ~88 new test lines prove nothing the suite does not already prove
Even if a maintainer keeps the flag, the tests are clones:
| New test | Clone of |
|---|---|
tests/cli/test_commands.py:102-113 test_target_head_quantization_flag_is_model_agnostic (~12 lines) |
:61-72 test_row_shard_prefill_flag_is_model_agnostic — same three-command parametrization, same parse assertion, same --help split-and-scan-for-a-model-name check |
tests/cli/test_commands.py:116-139 test_derive_forwards_and_validates_target_head_quantization (~24 lines) |
:75-99 test_derive_forwards_row_shard_prefill_and_rejects_joint_tuning — build fixture, derive(...), assert field and to_dict(), then assert the UsageError message |
tests/cli/test_planning.py:212-253 test_target_head_quantization_validation_and_preparation_manifest (~42 lines) |
:63-69 (recipe rejects an undeclared name), :72-107 (absent key in to_dict(), from_plan scope + reproduction args, deterministic Protobuf round trip, sorted unique keys), :142-183 (scope resolution) |
Plus target_head_quantizations=() threaded through both fixture builders (test_commands.py:22-23, 52; test_planning.py:23, 54) purely to serve those tests.
AGENTS.md:194-196 says tests "must exercise the affected behavior or contract; source-text checks and mocks that bypass the behavior cannot establish runtime correctness" — the --help cases assert argparse plumbing only. The scope/round-trip machinery is already covered, including the "changing a target-weight parameter rejects combine and reuse" case exercised by helios/src/runtime_core/preparation.rs:530-539.
Saves: about 88 lines. Replacement: nothing; delete the three test functions and the fixture keyword.
3. Should fix: bench.py dict splat and dead getattr fallbacks (~10 lines)
ignition/cli/bench.py:243-252 replaces a 12-line membership-filter comprehension with a 10-line pair of **{} splats purely to append one optional key. A membership filter does both jobs in one expression:
"preparation": {key: preparation[key] for key in (
"tensor_parallel", "prefill_chunk", "stream_overlap", "context_parallel", "context_parallel_size",
"native_dense_activations", "force_moe_decode_a16", "autotune_effort", "compile_workers",
"speculative_token_capacity", "speculation", "expert_scale_compression", "mla_compute_mode",
"row_shard_prefill", "online_mxfp8", "online_mxfp8_scope", "target_head_quantization",
"language_model_only") if key in preparation},
Plan.to_dict() already omits the key when it is None (planning.py:411-412), so if key in preparation expresses the same rule for every key instead of special-casing one. The block is also a second serialization of a value the same function already prints whole (print(json.dumps({"plan": plan.to_dict()})), bench.py:182), so the extra entry buys no new information.
getattr(args, "target_head_quantization", None) at serve.py:210, 278, 479 and bench.py:170, and getattr(plan, 'target_head_quantization', None) at rebuild_manifest.py:302: every caller builds its parser through _preparation_arguments, so the attribute always exists, and neighbouring arguments in the same calls are read directly (args.row_shard_prefill, args.online_mxfp8 at serve.py:288, plan.force_moe_decode_a16 at rebuild_manifest.py:300, plan.row_shard_prefill at :308). Plain attribute access replaces all five.
Saves: about 5 lines in bench.py plus five fallback wrappers.
4. Nit: recipe-level validation duplicates the plan-level check (2 lines)
ignition/declaration.py:328-329 (if any(name not in ("mxfp8",) for name in self.target_head_quantizations): raise ValueError(...)) duplicates Plan.__post_init__ (planning.py:289-293), which is the check that produces the user-facing UsageError naming the checkpoint alias and the only one any CLI path reaches. The three sibling override tuples the field sits beside — draft_head_quantizations:277, draft_body_quantizations:279, markov_head_quantizations:280 — have no Recipe.__post_init__ validation at all; they are validated once, at plan time (planning.py:487-495). Dropping the recipe-level check makes the field match its neighbours and loses nothing: an unsupported name still fails at plan().
Also ignition/declaration.py:276: the comment "Preparation overrides for vocabulary and transition projections used only by proposals" was reworded only to stay true after adding a target-side field — churn under AGENTS.md:190-192 ("Unsolicited … comment expansion … are not contributions by themselves"). The class docstring at :208-243 documents online_mxfp8, language_model_only, mla_compute_modes, export_repository, b12x_environment and row_shard_prefill_world_sizes, and the new field is documented nowhere — another sign the declaration is being bolted on beside the mechanism designed for it.
Saves: 2 lines (plus the comment reword).
5. Nit: the status item and the doc row restate existing output (2 lines)
ignition/cli/serve.py:314adds' · target head ' + plan.target_head_quantizationnext toserve.py:308's' · online MXFP8 ' + plan.online_mxfp8_scope. With the existing mechanism the online-MXFP8 item already names the conversion group that was prepared, so the new item prints the same fact twice.docs/cli-design.md:454is a full table row duplicating:474-475, which already say which projections each group converts and that--online-mxfp8-scopeselects a recipe-declared group. It is also the only row that names a model in its target-head sentence ("such as Qwen3.8 Flash Next") while the flag's own help text deliberately avoids model names (asserted attests/cli/test_commands.py:113) — the doc and the help therefore disagree about how much model knowledge belongs in a model-agnostic flag.
Saves: 2 lines.
What the change leaves behind
Nothing elsewhere in the repository. target_head_quantization appears only in ignition/ and tests/ — zero matches in helios/, heliopause/ or the protobuf schemas — matching the description's own claim of "zero changes to helios/ or Protobuf schemas". That is also the strongest argument for finding 1: the flag carries no behaviour in this PR at all; the entire effect lives in the companion recipe PR, and the Rust side would forward any recorded string through helios/src/runtime_core/preparation.rs:164-186, 337-370 unchanged.
There is no deprecated path, flag, config key or doc elsewhere that this change makes dead, because it adds a parallel route rather than replacing one.
Ranked savings
| Rank | Finding | Lines saved |
|---|---|---|
| 1 | Blocking: whole flag duplicates --online-mxfp8-scope |
~126 |
| 2 | Should fix: 88 test lines clone existing tests | ~88 |
| 3 | Should fix: bench.py:243-252 splat + 5 getattr fallbacks |
~10 |
| 4 | Nit: Recipe validation duplicates Plan's |
2 |
| 5 | Nit: duplicate status item and doc row | 2 |
Findings 2–5 are subsets of finding 1. Unique total removable: ~126 lines, i.e. essentially the whole diff. If a maintainer keeps the flag, findings 2–5 still recover ~97 of those 126.
Open questions / what I could not verify
- Whether the companion
local-inference-lab/hyperflare-recipes#40could declare a vocabulary-head group inonline_mxfp8_scopesinstead — the recipe repository is not in this tree (removed in 17bb3c4/da03728 "Remove extracted hyperflare_recipes … from core Flare"), so I could not read its declaration. The in-tree precedent (#312'swith-vocabulary-head,ignition/components/vocabulary.py(not opened)) is the evidence I rely on. - Whether the target head needs conversion semantics that differ from
online_mxfp8groups in a way the declaration cannot express. Nothing in this PR's own diff shows one: it only records a string in the plan and manifest; noignition/components/module changed, and the description states the core keeps exactly its 13 Helios-ABI modules. - GPU validation claims (
+7.5–9.0%C1 decode,~600 MiBsaved) are attributed by the description itself to the "paired core + recipe stack, not this core flag alone", so they do not argue for the flag's presence here. - Rust
cargo testwas not run per the description; I did not run tests either — no code was modified.
Verdict: should not be merged at this size. The condition the description states — "recipe-free core declaration, CLI flag, validation, and PreparationManifest plumbing" — is already satisfied by online_mxfp8 + a recipe-declared scope group; the smaller version is the recipe change alone, with zero lines in ignition/.