Full review — PR #518, "Add recipe-declared --target-head-quantization preparation flag"
Reviewed at head f54928b (branch feat/target-head-quantization → main, 10 files, +126/−10). Lenses combined: architecture/scope, conventions/duplication, correctness, simplicity, prose, and a subtractive pass whose headline claim was checked and rejected (see "Claims checked and rejected").
Key findings
- The design is right. The setting is an Ignition-only
PreparationParameterunderPREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT, omitted from the manifest when unset (ignition/preparation/rebuild_manifest.py:363-364,add()skipsNoneat:350-352), soflare combineand--reuse-weightscompatibility comes free from the generic scope compare inhelios/src/runtime_core/preparation.rs:286-347(:337-342for the target-weight slice). Nohelios/,*.protoorignition/components/file changed. Existing default-precision cores stay byte-identical. - One blocker: the setting never reaches memory planning.
Plan.target_head_quantizationis validated and recorded but no byte computation consumes it, so the planner still charges the full BF16 target head — the exact bytes the flag exists to free, on the memory-constrained hardware the PR targets. - Four should-fix items, all stemming from the same root or from text: where the flag enters the pipeline (after planning instead of inside
fit/plan), a doc row that claims a model and a conversion effect this repository cannot provide, and two gaps in the PR description (unreproducible evidence; the ownership/dataflow fact and check results left unstated). - Nine nits, all style/consistency/discoverability: redundant
getattrfallbacks, a plan-dict shape that forced churn inbench, asymmetric format validation, a missing help-list entry and design-doc entry, test duplication. - One research finding was rejected. The subtractive pass called the whole flag a duplicate of
--online-mxfp8-scopeand blocking. That does not hold in this tree:docs/cli-design.md:474states--online-mxfp8leaves "target vocabulary weights" at checkpoint precision, and the cited precedent (PR #312's--online-mxfp8-scope with-vocabulary-head) is open and unmerged, with its recipe-side code removed from this repository in17bb3c4a. It is recorded below as a maintainer question, not a request to the author.
BLOCKERS
B1. The flag never reaches memory planning, so the size estimate still charges the BF16 head
Finding. Plan.target_head_quantization is a real field (ignition/planning.py:199) validated in Plan.__post_init__ (:289-293) and reported in to_dict() (:411-412), but it is used in no byte computation:
fithas no such parameter — signatureignition/planning.py:445-453(... language_model_only: bool = False, mla_compute_mode: str | None = None, row_shard_prefill: bool = False).fit's only weight call isrecipe.weights_bytes(checkpoint, len(gpus), speculation, expert_scale_compression)(:526).Recipe.weights_bytes(checkpoint, world_size, speculation, expert_scale_compression=None)(ignition/declaration.py:363-374) selectscheckpoint.device_bytesorcheckpoint.scale_compressed_device_bytes[...]and has no head-format term — it returns the full stored-precision total.
Consumers of that number: Plan.fixed_bytes (planning.py:325) → fits (:383-385); _shortfall's "needs X GiB weights" (:551-559); the option list / CapacityError (:697-725); automatic()'s GPU choice (:674-680); to_dict()["weights_bytes"] (:431) and every printed plan JSON (ignition/cli/serve.py:215, :488, ignition/cli/bench.py:182).
Request. Give the planner the quantized head's resident bytes — either declare them on Checkpoint beside scale_compressed_device_bytes (ignition/declaration.py:85-86), which is exactly how the analogous --expert-scale-compression reaches weights_bytes (declaration.py:367-368), or subtract inside Recipe.weights_bytes — and thread target_head_quantization through fit/plan (and therefore derive, _export_hosts, _prepare, debug_serve, bench; same change as S1). Settle it with a planning test asserting weights_bytes drops for a recipe that declares head bytes.
Why. The PR's stated benefit is ~600 MiB of BF16 head on TP1 (a 1.21 GiB, 248,320 × 2,560 head) on DGX Spark GB10, where memory is the binding constraint. Because the estimate still charges that head, plan() can raise CapacityError (planning.py:725) for a configuration the flag would make fit; automatic() can choose a larger TP size or "the GPUs with the most free memory"; _shortfall can suggest --max-concurrency N, --no-mtp, reserve="0" or --language-model-only for a plan that already fits; and every printed plan overstates residency. AGENTS.md:452-456 requires an advanced flag to be "carried through the plan … so the plan, its printed report, and its recorded measurements describe what was prepared" — here the plan describes the setting but not its resource effect.
Scope correction (important, and in the author's favour). This is a planning/selection defect only. The exported/served capacity comes from the recipe's measured usage() (ignition/declaration.py:214; helios/src/runtime_core/model.rs:156 (not opened)), not from Plan.weights_bytes, so serving capacity is not understated. The peak-during-conversion argument does not justify the omission either: weights_bytes feeds steady-state fits, while preparation peak is governed by the memory inventory.
SHOULD FIX
S1. The flag is patched onto the Plan after planning instead of being a planning input
Finding. derive calls planning.plan(...) (ignition/cli/preparation.py:60-69; signature ignition/planning.py:581-589, no such parameter) and then patches the result:
result = replace(result, compile_workers=workers, ...,
target_head_quantization=target_head_quantization, ...) # preparation.py:70-75
_export_hosts (ignition/cli/serve.py:206-211), _prepare (via derive) and debug_serve (serve.py:475-480) and bench (bench.py:162-177) follow the same shape. Every sibling option is a real fit/plan parameter validated before any GPU is chosen: mla_compute_mode (planning.py:465-467), draft/markov heads (:487-495), expert_scale_compression (:498-500), online_mxfp8_scope (:603-606), row_shard_prefill (:627-632).
Request. Add target_head_quantization: str | None = None to fit and plan; validate it beside the draft-head loop (planning.py:487-495) and in plan's pre-GPU checks, raising the same UsageError; keep the Plan.__post_init__ check (:289-293) as the invariant; drop the replace(...) plumbing and the four getattr(args, …) guards (nit 1).
Why. The only current validation runs in Plan.__post_init__, i.e. after sizing — on a constrained host an undeclared format surfaces as a memory message (CapacityError) instead of the intended UsageError naming the alias and format, so the error text depends on free memory. It also means no fit/plan caller can express the setting at all, which is why B1 exists. Charter: "Solve the right problem in the right place."
S2. The doc row claims a model and a conversion effect this repository cannot provide
Finding. docs/cli-design.md:454:
--target-head-quantization {mxfp8}| Prepare the target vocabulary head as MXFP8 for recipes that declaretarget_head_quantizations(such as Qwen3.8 Flash Next with a BF16 checkpoint head), freeing the temporary BF16 vocabulary weight after conversion. Recipes that do not declare the requested format reject it. Command line only; changing it requires re-export. | Checkpoint precision
- No in-tree recipe declares
target_head_quantizations; searching the tree finds only the field (ignition/declaration.py:278), its validator (:328-329), the plan field/check (planning.py:199,:289-293), the CLI flag (ignition/cli/__init__.py:212), the manifest entries and tests. Recipes live inlocal-inference-lab/hyperflare-recipes(AGENTS.md:379-384), and companion PR #40 is unmerged — so in this tree the flag is reachable but inert. - Nothing here converts or frees the BF16 head: no
ignition/components/module changed, noignition/recipes/exists in-tree, and the conversion isRecipe.prepare, supplied externally (ignition/declaration.py:212-215). - The row also sits beside
:474, which says--online-mxfp8leaves "target vocabulary weights" at checkpoint precision; without wording tying the two, they read as contradictory. - "Qwen3.8 Flash Next" is a third variant of a name the same table writes as "Flash Next" (
:449,:453,:466,:472) and the repo aliases asqwen3.8-flash(:405,:1067).
Request. State that the flag takes effect only for recipes that declare target_head_quantizations in external recipe repositories; drop the named checkpoint and the unmeasured "freeing the temporary BF16 vocabulary weight after conversion" effect (or land together with the recipe PR and cite the measurement there); use the existing name form; and qualify :453's "while retaining target-head precision", which now describes only the draft flag alone — both flags can be selected together and nothing rejects the pair (planning.py:212-293, :487-495).
Why. AGENTS.md:194-198 forbids presenting scaffolding or partially wired features as supported; docs/design-review.md:125-136 (P15/P16) rejects scope-expanding prose. A reader will otherwise believe target-head MXFP8 works in this tree, when every in-tree recipe rejects the flag.
S3. The description's evidence paragraph is not reproducible
Finding. The "Claimed Benefit / Result" paragraph reports +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. Problems: the four tok/s figures carry no concurrency labels and no baseline or delta; abbench occurs nowhere in this repository; 44/44 and 100% "quality gate" are undefined (no reference set, criterion or threshold); C1 is not expanded. The combined-stack attribution itself is correct and needs no change ("belong to the paired core + recipe stack, not this core flag alone" satisfies AGENTS.md:100) — this is a labelling gap, not an attribution one.
Related, milder: "so existing default-precision cores remain 100% compatible across flare combine and --reuse-weights" is an assurance, not a stated condition. The checkable statement is that the parameter is omitted when None (rebuild_manifest.py:363-364, :350-352), so the SCOPE_TARGET_WEIGHT slice compared at helios/src/runtime_core/preparation.rs:337-342 is unchanged.
Request. Name the benchmark tool and its configuration, label each figure with its concurrency, give baseline and delta, define the quality gate, and replace the compatibility assurance with the manifest-omission condition. Point at the recipe PR for measurement detail, as the paragraph already does for attribution.
Why. AGENTS.md:95-112 requires the headline comparison with scope and material limitations; :122-128 requires resolvable references; :109 states that test counts and "qualified" labels cannot stand in for the tested contract. As written the only quantitative support for the headline claim cannot be reconstructed by a reader.
S4. The description omits the ownership fact that makes a declaration-only PR sufficient
Finding. "Why"/"What Changed" describe a recipe-free core and reference the companion PR, but never state plainly that this repository only declares, validates and records the setting, that Recipe.prepare in the external recipe repository performs the BF16→MXFP8 conversion and releases the copy, and that a recipe without the declaration rejects the flag at planning time (ignition/planning.py:289-293).
Request. One or two sentences stating that dataflow and ownership.
Why. AGENTS.md:84-87 requires "the relevant dataflow, ownership, or execution constraint that makes the approach valid". It also explains why the diff contains no conversion code, and warns a future core-side reader that a declaring recipe whose prepare() ignores the field would export a silently unchanged BF16 head whose manifest claims a different weight layout — flare combine and --reuse-weights would then refuse it (safe, but with no export-time error).
S5. Validation section: the PR's own test result, the absent CI, and the unexercised Rust path
Finding. The validation bullet discloses the one deselected legacy test (good) but never says whether the PR's own new test — test_target_head_quantization_validation_and_preparation_manifest (tests/cli/test_planning.py:212-253), which pins declaration rejection (:217-218), the UsageError naming the alias (:251-253), to_dict() presence (:224), and the SCOPE_TARGET_WEIGHT parameter with reproduction args (:230-248) — passed. It also does not mention that no CI check ran on head f54928b. And "Rust cargo test not run because no Rust or Protobuf files were modified" is accurate, but the combine/--reuse-weights argument rests on unchanged Rust behaviour that no executed test exercised (helios/src/runtime_core/preparation.rs:330-347).
Request. State the new test's result, note the absent CI, and state the basis of the compatibility claim (Python-side omission plus unchanged Rust code).
Why. AGENTS.md:306 ("report a skipped test as an unrun check"), :57-58, and item 4's "keep material failures, skipped checks, and measurement limitations visible".
NITS
getattrwhere every sibling uses direct attribute access —ignition/cli/serve.py:210,:278,:479;ignition/cli/bench.py:170. All three commands register the flag via_preparation_arguments(ignition/cli/__init__.py:50,:53,:60; flag at:212-214), so the attribute always exists, and the neighbouring keywords on those same calls are direct (args.force_moe_decode_a16,args.joint_tuning,args.row_shard_prefill,args.online_mxfp8atserve.py:288). The fallback converts broken parser wiring into "the user did not request the flag" — a silent wrong-precision export, which is exactly whattests/cli/test_commands.py:102-113exists to catch. Use direct access. (getattrremains correct fordcp_sizeatserve.py:197,:283, whose attribute is genuinely optional.)- Two access styles for one field —
ignition/preparation/rebuild_manifest.py:302usesgetattr(plan, 'target_head_quantization', None) is not Nonewhile:363readsplan.target_head_quantizationdirectly. Neighbours are direct (plan.force_moe_decode_a16at:300, also:306,:308,:310). Request: direct access at:302. - Plan-dict shape forced churn in another file —
Plan.to_dict()(ignition/planning.py:411-412) is the only key whose presence changes with its value; every other optional field is emitted withNone(expert_scale_compression:401,mla_compute_mode:402,benchmark_selection:429). That requiredignition/cli/bench.py:243-253to turn a flat key-tuple comprehension into two**{}splats (:250-251) re-testing the same condition, and leaves aKeyErrorlandmine for future callers adding the key to such a tuple. Request: emit"target_head_quantization": self.target_head_quantizationunconditionally and add the key to the existing tuple atbench.py:244-249;tests/cli/test_planning.py:224becomes... is None. Keep the omission in the manifest (rebuild_manifest.py:363-364) — there it is what keeps existing cores byte-identical forcombine/--reuse-weights; that requirement does not extend to a diagnostic dict. - Asymmetric format validation and a third unlinked literal —
Recipe.__post_init__rejects unknown names (ignition/declaration.py:328-329) while its three sibling tuples (draft_head_quantizations,draft_body_quantizations,markov_head_quantizations,:277-280) have no recipe-level check (membership is enforced atplanning.py:487-495), and("mxfp8",)now appears as a third independent literal (CLIchoicesatignition/cli/__init__.py:212,declaration.py:328, plan membership viaplanning.py:289). Request: either deletedeclaration.py:328-329to match the draft/markov precedent, or hoist one module-level constant used by both theRecipecheck and the CLIchoices. Honest counterpoint: failing at recipe load is arguably better than the draft path's delayed failure; if maintainers prefer it, make all four consistent in a follow-up. - Discoverability —
ignition/cli/help.py:76-91builds "Optional features for this recipe" from--expert-scale-compression,--mixed-prefill,--no-context-paralleland--no-stream-overlap;--target-head-quantizationis absent, soignition export MODEL --helpgives no hint the flag applies. Request: add it. The draft/Markov head flags share the gap, so this is a consistency improvement, not a regression. - Design doc not updated —
docs/runtime-core-design.md:374-377enumerates thePREPARATION_PARAMETER_SCOPE_TARGET_WEIGHTmembers (online_mxfp8, resolvedonline_mxfp8_scope,expert_scale_compression). Request: addtarget_head_quantization. - Unannounced comment edit —
ignition/declaration.py:276dropped "used only by proposals". The edit is correct now thattarget_head_quantizationsjoins the group, but it is not mentioned in the description andAGENTS.md:188-193treats unsolicited comment edits as churn. Request: a half-sentence, or defer it to the commit that needs it. - Test duplication and negatives-only assertions —
test_target_head_quantization_flag_is_model_agnostic(tests/cli/test_commands.py:102-113) parametrizes three commands but asserts only a negative ("Qwen" not in section) on help text produced by one shared_preparation_argumentscall; the undeclared-recipeUsageErroris asserted twice (test_commands.py:135-138andtest_planning.py:251-253); andtest_planning.py:231-243repeats the manifest encode/decode/ordering round-trip already present at:94,:153,:189in the same file. Request: one non-parametrized positive help assertion, keep the planning-sideUsageError(it pins the alias), and keep only the scope/reproduction-args assertions in the round trip. - Untested paths — multi-host
_export_hosts(ignition/cli/serve.py:210),debug_serve(serve.py:479) and the bench configuration output (bench.py:250-251) have no coverage; only a GPU export with a declaring recipe can confirm the conversion and the ~600 MiB saving.
Claims checked and rejected
- "The whole flag duplicates
--online-mxfp8-scope; delete the diff." Not supported by this tree.docs/cli-design.md:474documents--online-mxfp8as leaving "target vocabulary weights" at checkpoint precision, so the two mechanisms are complementary. The cited precedent — PR #312's--online-mxfp8-scope with-vocabulary-head— is open and unmerged, and the recipe-side code it depends on (ignition/components/vocabulary.py(not opened),ignition/recipes/inkling2/*) was removed from this repository in17bb3c4a;ignition/components/vocabulary.py(not opened) does not exist atpr/518head. So "reuse the existing scope group" is not a mechanism available here today. Recorded as a maintainer question (below), not a request to the author. - "The exported capacity is understated." Corrected and dropped: exported rank memory comes from the recipe's measured
usage()(ignition/declaration.py:214;helios/src/runtime_core/model.rs:156(not opened)), notPlan.weights_bytes. Only planning/selection accuracy is affected (see B1). - "The sizing gap is deliberate conservatism." No evidence for that in the diff or description, and the analogous
--expert-scale-compressiondoes reachweights_bytes(declaration.py:367-368), so the expectation is established rather than new.
Open questions for maintainers
- Where should the quantized head's resident bytes live — declared on
Checkpointlikescale_compressed_device_bytes(ignition/declaration.py:85-86), or computed insideRecipe.weights_bytes? Either fixes B1; a maintainer decision plus a declaring recipe settles which. - One mechanism for projection precision. This is now the fourth parallel projection-precision flag (target head, draft head, draft body, Markov head), each with its own declaration tuple, validator,
to_dictentry, reproduction pair and manifest parameter — drift from the charter's "implemented once via a single general mechanism". This PR is right to follow the existing shape; the single-overrides decision is worth having before a fifth arrives. Relatedly, open unmerged PR #312 reaches the same vocabulary-head outcome through a recipe-declared--online-mxfp8-scopegroup; the repository now has two shapes for one concept. - Does the companion recipe PR (
local-inference-lab/hyperflare-recipes#40) land alongside this one? If it merges with atarget_head_quantizations=("mxfp8",)declaration, S2 reduces to a cross-repo link plus a measured citation, and S5's Rust caveat narrows. If it declares the field but its loader ignoresplan.target_head_quantization, export would silently produce a BF16 head whose manifest claims MXFP8 — refused bycombine/--reuse-weights, but with no export-time error. - Is pairing
--draft-head-quantizationwith--target-head-quantizationintended? Nothing rejects it (planning.py:212-293,:487-495). If legal,docs/cli-design.md:453's "retaining target-head precision" needs qualifying; if not,Plan.__post_init__should reject the pair like--row-shard-prefill+--joint-tuning(planning.py:282-283).
What is right (no action)
- Layering. Ignition-only preparation parameter under
SCOPE_TARGET_WEIGHT, omitted when unset, matchingdocs/runtime-core-design.md:345-358and:374-377; Rust compares scopes generically (helios/src/runtime_core/preparation.rs:286-347), soruntime_core.proto(not opened),core.proto(not opened),helios/andignition/components/(13 Helios-ABI modules plus__init__.py, none touched) are unchanged, andcombine/--reuse-weightsvalidation comes for free. - Shape mirrors precedent.
target_head_quantizations: tuple[str, ...] = ()(ignition/declaration.py:278) sits with the three sibling head tuples; the flag is an explicit CLI option rather than an environment switch (AGENTS.md:446-451, design-review P10), and an opt-in rather than silent requantization (design-review P9). - Propagation is sound. The field is a real
Planfield, so tuning replicas inherit it (tuning_replicas.py:179-185rebuilds fromfields(root)); recording is conditional in the plan dict (planning.py:411-412), the reproduction args (rebuild_manifest.py:302-303) and the startup status (serve.py:314), so omitting the flag leaves plans, manifests and exports unchanged. - The description itself answers the four required questions in order, gives before/after per area, correctly separates the paired-stack numbers from this PR's contribution, and ends with the required
Discord: neroline (AGENTS.md:142-153). No text in the PR attempts to instruct a reviewing agent. ignition/cli/bench.py:243-253's restructure is a consequence, not a choice — it preservesPlan.to_dict()'s omit-when-unset contract without adding a helper. Nit 3 removes the need for it.
What could not be verified from this repository
- The MXFP8 byte reduction for the target head (needed for B1's numeric fix) and the ~600 MiB / +7.5–9.0% / 44-44 gate / TP2
abbenchnumbers all live inlocal-inference-lab/hyperflare-recipes#40and its run logs; nothing here can confirm them. - Whether a CI workflow is expected on PRs in this repository or simply did not trigger for
f54928b— no policy document states a required check set, so this is framed as a disclosure gap, not a policy violation. - Whether any consumer outside this repository asserts on key presence in the plan JSON. The four in-repo consumers are
serve.py:215,serve.py:488,bench.py:182,bench.py:237, all of which treatNoneand absent identically — which is what makes nit 3 safe. - No tests were executed for this review; every finding above is established by reading the code at
f54928b.