Full report — PR #518 "Add recipe-declared --target-head-quantization preparation flag"
Repository: NVIDIA/hyperflare-inference · PR: #518 · Author: nero- (CONTRIBUTOR, Discord: nero) · Branch: feat/target-head-quantization → main · Head: f54928b (base 2771618) · 10 files, +126/−10 · No CI checks on head, no human review yet. Companion PR: local-inference-lab/hyperflare-recipes#40 (unmerged).
Key findings
- Recommendation: Changes Requested — one blocker, four should-fix, nine nits, five maintainer open questions. The layering is genuinely right and needs no redesign: the setting is an Ignition-only
PreparationParameterunderSCOPE_TARGET_WEIGHT, omitted when unset, soruntime_core.proto(not opened),core.proto(not opened),helios/andignition/components/are untouched and existing cores remain byte-identical forflare combineand--reuse-weights. - Blocker (B1): the flag never reaches memory planning. It is validated and recorded but never sized, so the plan still charges the full BF16 target head and a memory-constrained host can reject a preparation the flag makes fit.
- Should fix (S1): it is patched onto the finished
Planwithreplace(...)instead of being afit/planinput, so validation runs after GPUs and capacity are reasoned about — an undeclared format can surface asCapacityErrorrather thanUsageError. - Should fix (S2): the one changed doc line claims a model and a conversion/free effect that only the unmerged companion recipe can provide.
- Should fix (S3, S4): the PR description's evidence paragraph is not reproducible, and the description omits the ownership/dataflow fact, its own new test result, and the absent CI.
- Two review lenses' stronger claims were checked and rejected, and are recorded as maintainer questions rather than requests to the author: "the whole diff duplicates
--online-mxfp8-scope" and "the exported core's capacity is understated".
BLOCKERS
B1. The flag never reaches memory planning, so the plan still charges the BF16 head
Finding. Plan.target_head_quantization (ignition/planning.py:199) is validated in Plan.__post_init__ (:289-293) and recorded in to_dict() (:411-412) and the manifest (ignition/preparation/rebuild_manifest.py:363-364 (not opened)), but it is never used in a byte computation:
fit(...)has no target-head parameter — signature atignition/planning.py:445-453(verified:expert_scale_compressionis there,target_head_quantizationis not).fit's only weight call isrecipe.weights_bytes(checkpoint, len(gpus), speculation, expert_scale_compression)atignition/planning.py:526, andRecipe.weights_bytes(checkpoint, world_size, speculation, expert_scale_compression=None)(ignition/declaration.py:363-374) returns the full stored-precision total (checkpoint.device_bytesorcheckpoint.scale_compressed_device_bytes[...]), plus expansion and draft terms — no head-format term.- Nothing else in the tree does byte math on the field.
Request. Give the planner the quantized head's resident bytes: declare them on Checkpoint beside scale_compressed_device_bytes (ignition/declaration.py:85-86), or subtract them inside Recipe.weights_bytes; then thread the setting through fit/plan from derive, _export_hosts, _prepare, debug_serve and bench (the same threading S1 asks for). Add a planning test asserting weights_bytes drops when the format is requested for a recipe that declares the capability.
Why. The PR's own stated benefit is ~600 MiB of BF16 vocabulary head at TP1 (the PR sizes that head at 1.21 GiB for 248,320 × 2,560) on DGX Spark GB10, where memory binds. Because the estimate still charges that head:
Plan.fits(:383-385, viafixed_bytes:325) can reject a configuration the flag makes fit;automatic()(:674-680) may pick a larger TP size or "the GPUs with the most free memory";_shortfall(:551-559) prints an overstated "needs X GiB weights" and the repair search (:697-725) may suggest--max-concurrency N,--no-mtp,reserve="0"or--language-model-onlyfor a plan that already fits;- every printed plan JSON (
serve.py:215,serve.py:488,bench.py:182) 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". The in-tree precedent is the analogous resident-weight option --expert-scale-compression, which does reach weights_bytes (ignition/declaration.py:367-368) — so this is an established expectation, not a new demand.
Scope note, for fairness. This is a planning/selection accuracy defect, not a serving one: exported rank capacity comes from measured recipe.usage() (ignition/declaration.py:214; helios/src/runtime_core/model.rs:156 (not opened)), not Plan.weights_bytes. Do not read B1 as "served capacity is understated". Also, --online-mxfp8 is likewise absent from weights_bytes, and docs/cli-design.md:36-41 calls the estimate deliberately rough — which is why this is one blocker tied to the PR's own memory claim rather than a general refactor request.
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; plan signature ignition/planning.py:581-589) and then repairs the result: replace(result, ..., target_head_quantization=target_head_quantization, ...) (preparation.py:70-75). _export_hosts (serve.py:206-211), debug_serve (serve.py:475-480) and bench (bench.py:162-177) repeat the pattern. Every sibling recipe-gated setting is a real fit/plan parameter validated before GPUs are chosen: online_mxfp8/scope (planning.py:603-606), row_shard_prefill (:627-632), expert_scale_compression (:498-500), mla_compute_mode (:465-467), draft/markov head formats (:487-495). The new flag's only validation is Plan.__post_init__ (:289-293), which on the CLI path can fire only on the post-planning replace.
Request. Add target_head_quantization: str | None = None to fit and plan, validate it beside the draft-head loop (:487-495) and in plan's pre-GPU checks with the same UsageError, keep Plan.__post_init__ as the invariant, and delete the replace(...) argument together with the four getattr guards.
Why. On a memory-constrained host an unsupported format surfaces as CapacityError from the option search (planning.py:697-725) — a memory message — instead of the UsageError that names checkpoint.alias and the format, so the error a user sees depends on free memory. It also means no plan/fit caller, including tuning replicas (tuning_replicas.py:179-185 (not opened)), can express the setting, which is exactly why B1 exists. Charter: "Solve the right problem in the right place." Fixing S1 is the vehicle for B1.
S2. The doc row claims a model and a conversion effect this repository cannot provide
Finding. The only changed doc line, docs/cli-design.md:454, reads: "--target-head-quantization {mxfp8} | Prepare the target vocabulary head as MXFP8 for recipes that declare target_head_quantizations (such as Qwen3.8 Flash Next with a BF16 checkpoint head), freeing the temporary BF16 vocabulary weight after conversion. …"
- A repository-wide search for
target_head_quantizationsfinds only the declaration (declaration.py:278), its validator (:328-329), the plan field/validation/to_dict(planning.py:199,:289-293,:411-412), the CLI wiring, the manifest and the tests. No in-tree recipe declares it — recipes live inlocal-inference-lab/hyperflare-recipes(AGENTS.md:379-384) and companion PR #40 is unmerged. - Nothing here converts or frees a weight: no
ignition/components/module changed, noignition/recipes/exists in-tree, and the conversion lives inRecipe.preparesupplied by the external recipe repo (ignition/declaration.py:212-215). - Contradiction risk: the neighbouring row
docs/cli-design.md:474documents--online-mxfp8as leaving "target vocabulary weights" at checkpoint precision. - Model-name drift: the same table uses bare "Flash Next" (
:449,:453,:466,:472) and the repo alias isqwen3.8-flash(:405,:1067); "Qwen3.8 Flash Next" is a third variant.
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 it with the recipe PR and cite the measurement there); use an existing model-name form; and qualify :453 ("while retaining target-head precision"), which is now inaccurate because --draft-head-quantization and --target-head-quantization can be combined — nothing rejects the pair (planning.py:212-293, :487-495).
Why. AGENTS.md:194-198 forbids presenting scaffolding or partially wired features as supported, and docs/design-review.md:125-136 (not opened) rejects scope-expanding prose. As written, a reader will 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 gives +7.5–9.0% C1 decode, ~600 MiB, 44/44 quality gate PASS for TP1, then four bare TP2 figures 116.0 / 164.2 / 230.5 / 332.4 tok/s "abbench" and 100% quality gate. No main baseline or delta is given, no concurrency label per figure, abbench occurs nowhere in this repository, and neither quality gate is defined (which gate, which reference set, what counts as a pass). C1 is not expanded.
Request. Name the benchmark tool and its configuration, label each tok/s figure with its concurrency, give the main baseline and delta, define the gate, and point at the recipe PR for measurement detail — the paragraph already correctly attributes the numbers to the paired stack, so the pointer is free.
Why. AGENTS.md:95-112 requires the headline comparison with its scope and material limitations, and :109 says test counts and labels such as "qualified" cannot stand in for the tested contract and result; :122-128 requires resolvable references. As written, the only quantitative support for the headline claim cannot be reconstructed by a reader. The combined-stack attribution is correct and needs no change.
Related, milder, same description: "so existing default-precision cores remain 100% compatible across flare combine and --reuse-weights" is a process assurance rather than a stated condition. The verifiable statement is that the parameter is added to the manifest only when non-None (rebuild_manifest.py:363-364 (not opened); add() skips None at :350-352), so the TargetWeight slice compared by compatible_for_weight_reuse (helios/src/runtime_core/preparation.rs:337-342 (not opened)) is unchanged. Say that instead.
S4. The description omits the ownership fact that makes a declaration-only PR sufficient, and leaves check gaps
Finding. The description says core ignition stays recipe-free and points at the companion PR, but never states plainly that (a) with this PR alone the flag changes no prepared weight — it needs a recipe that declares target_head_quantizations=("mxfp8",) and performs the conversion; (b) the BF16→MXFP8 conversion and the BF16 buffer release live in that recipe's prepare(), which is why this diff contains no conversion code; (c) a recipe without the declaration rejects the flag at planning time (ignition/planning.py:289-293) rather than silently ignoring it. Separately, the description never says whether the PR's own new test test_target_head_quantization_validation_and_preparation_manifest (tests/cli/test_planning.py:212-253 (not opened)) passed — the deselected legacy test is disclosed, but it covers a different path — and never mentions that no CI ran on f54928b.
Request. One or two sentences stating that dataflow/ownership, the new test's result, and the absent CI. Optionally state that the combine/--reuse-weights claim rests on the Python-side omission plus unchanged Rust rather than an executed Rust test.
Why. AGENTS.md:84-87 requires "the relevant dataflow, ownership, or execution constraint that makes the approach valid"; :57-58 and :306 require unrun and skipped checks to be visible. It also warns a future core-side reader that a declaring recipe whose prepare() ignores the field produces a silently unchanged BF16 head whose manifest claims MXFP8 — safely refused by combine/--reuse-weights, but with no export-time error. The multi-host case is the sharpest version: the plan object stays on rank zero (ignition/preparation/host_ranks.py:348-353 (not opened), peers consume at :633-656), so plan.target_head_quantization reaches peers only if the recipe copies it into the peer preparation config.
NITS
- Redundant
getattrfallbacks.getattr(args, "target_head_quantization", None)atignition/cli/serve.py:210,:278,:479,ignition/cli/bench.py:170. All three commands register the flag through_preparation_arguments(ignition/cli/__init__.py:50(not opened) export,:53bench,:60debug-serve; flag at:212-214), so the attribute always exists, and every neighbouring keyword on those lines is direct (args.force_moe_decode_a16,args.joint_tuning,args.row_shard_prefill). Request: direct attribute access. Why: the fallback converts broken parser wiring into "the user did not request the flag" — a silent checkpoint-precision export, which is the exact failuretests/cli/test_commands.py:102-113exists to catch.getattris legitimate only where the attribute can genuinely be missing (dcp_sizeatserve.py:197/:283; draft flags inpreparation.speculation). - Two access styles in one file.
ignition/preparation/rebuild_manifest.py:302(not opened) guards withgetattr(plan, 'target_head_quantization', None)while:363in the same change readsplan.target_head_quantizationdirectly. Request: direct access at:302, matchingplan.force_moe_decode_a16at:300. Why: the field is a declaredPlanfield with a default (planning.py:199); the defensive form protects nothing and makes two lines of one change disagree, and the next line would raise anyway if the attribute were truly absent. to_dict()omit-when-unset forces a second conditional inbench.ignition/planning.py:411-412is the only key in the dict whose presence varies with its value; every other optional field is emitted asNone(:401expert_scale_compression,:402mla_compute_mode,:429benchmark_selection). That forcedignition/cli/bench.py:243-252to replace a flat key-tuple comprehension with two**{}splats re-testing the same condition, and leaves aKeyErrorlandmine for any future caller that adds 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(beside"force_moe_decode_a16"), deleting:250-251;tests/cli/test_planning.py:224(not opened) becomes... is None. Keep omitting it from the manifest (rebuild_manifest.py:363-364(not opened)) — there the omission is what keeps existing cores byte-identical forcombine/--reuse-weights; that requirement does not extend to a diagnostic dict.- Format validation is asymmetric, and
("mxfp8",)is a third unlinked literal.Recipe.__post_init__rejects unknown names (declaration.py:328-329) while the three sibling head tuples (:277-280) have no recipe-level check — their membership is enforced atplanning.py:487-495. Consequences: a typo'ddraft_head_quantizationsis accepted and simply never matches, whiletarget_head_quantizations=("nvfp4",)fails at import; a recipe cannot declare a format this core release does not yet know. The literal also appears in the CLIchoices(ignition/cli/__init__.py:212(not opened)) and implicitly at plan time (planning.py:289-293). Request: either deletedeclaration.py:328-329to match the draft/markov precedent, or hoist one module-level constant used by both sites. Why: one rule should not live in two differently-worded places, and a second target-head format would currently need three coordinated edits. Honest counterpoint: failing at recipe load is arguably better; if maintainers prefer it, bring all four tuples into line in a follow-up. - Discoverability.
ignition/cli/help.py:76-91builds "Optional features for this recipe:" from--expert-scale-compression,--mixed-prefill,--no-context-parallel,--no-stream-overlap;--target-head-quantizationis absent, soignition export MODEL --helpgives no hint the flag applies to that recipe. Request: add it. Why: the "Optional features" block is where a user learns which advanced flags apply. 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 the members ofPREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT(online_mxfp8, resolvedonline_mxfp8_scope,expert_scale_compression); the new key belongs in that list. Request: addtarget_head_quantization. Why: that paragraph is the reference for what a target-weight-scoped parameter may be, and it is now incomplete. - Unannounced comment edit.
ignition/declaration.py:276dropped "used only by proposals" from the group comment. Request: one half-sentence in the description, or defer the edit to the commit that needs it. Why: the edit is correct now thattarget_head_quantizationsjoins the group, butAGENTS.md:188-193treats unsolicited comment churn as noise, and the description's file narrative and the file list should agree. - Tests: negatives-only assertion, duplicated
UsageError, third copy of an existing block. (a)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. (b) The undeclared-recipeUsageErroris asserted twice (test_commands.py:134-138,test_planning.py:250-253(not opened)). (c)test_planning.py:231-243(not opened) re-implements the manifest encode/decode/ordering round trip already present at:94,:153,:189. Request: one non-parametrized positive help assertion (assert "--target-head-quantization" in help_textplus theQwennegative), keep the planning-sideUsageError(it pins the alias in the message), and keep only the scope/reproduction-args assertions in the round trip. Why:AGENTS.md:188-193treats source-text checks and duplicated scaffolding as non-contributions; the behaviour worth pinning is the scope (PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT) and the--target-head-quantization/value reproduction pair. - Untested paths. Multi-host
_export_hostsforwarding (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. Request: note the gap in the description (it is a limitation, not a test to write here). Why:AGENTS.md:194-198and:103-112ask for untested paths to be stated rather than implied covered.
OPEN QUESTIONS FOR MAINTAINERS (not requests to the author)
- Where should the quantized head's resident bytes live — declared on
Checkpointlikescale_compressed_device_bytes(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 correctly follows the existing shape; the single-override decision is worth having before a fifth arrives. - Unmerged PR #312 reaches the same vocabulary-head outcome through a recipe-declared
--online-mxfp8-scope with-vocabulary-headgroup with the conversion in the recipe package. That mechanism is not available in this tree today:docs/cli-design.md:474documents--online-mxfp8as leaving target vocabulary weights at checkpoint precision, and PR #312 is open/stacked with a changes-requested review asking for the vocabulary-head change to be split out, while its recipe-side code (ignition/recipes/inkling2/*,ignition/components/vocabulary.py(not opened)) was removed in17bb3c4a. So this does not make PR #518 redundant — but the repository now has two shapes for one concept, and a maintainer should reconcile them. - Does the companion recipe PR (#40) land alongside this one? If it merges with a declaring recipe, S2 reduces to a cross-repo link plus a measured citation. If it declares the field but its loader ignores
plan.target_head_quantization(including on peer ranks), export silently produces a BF16 head whose manifest claims MXFP8 — refused bycombine/--reuse-weights, safely, 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" must be qualified; 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 follows
docs/runtime-core-design.md:345-377exactly. The key is an Ignition-onlyPreparationParameterunderSCOPE_TARGET_WEIGHT, omitted when unset (rebuild_manifest.py:363-364(not opened);add()skipsNoneat:350-352). Rust compares scopes generically (helios/src/runtime_core/preparation.rs:286-347(not opened)), soruntime_core.proto(not opened),core.proto(not opened),helios/andignition/components/(13 Helios-ABI modules, none touched) are unchanged, andflare combine/--reuse-weightsvalidation comes for free — satisfying the charter's "existing data, artifacts, and exported cores still load". - Shape mirrors precedent.
target_head_quantizations: tuple[str, ...] = ()(declaration.py:278) sits with the three sibling head tuples, same shape and default; thePlan.__post_init__check (planning.py:289-293) uses the house idiom and namescheckpoint.aliaslike its neighbours (:286,:472,:490,:494). It is an explicit CLI opt-in, not an environment switch (design-review P10) and not silent requantization (P9). The--helptext is model-agnostic. - Propagation is sound.
Planis a real dataclass field, so tuning replicas inherit it (tuning_replicas.py:179-185(not opened));derive'sreplaceruns beforetuning_devices, and recording is conditional in the plan dict, the reproduction args and the startup status (serve.py:314), so omitting the flag leaves plans, manifests and exports unchanged._preparation_valuealready handlesstr(rebuild_manifest.py:329-342(not opened)), so the value survives generic-parameter encoding. - CLI registration is right. The flag lives in the
advanced optionsgroup of_preparation_arguments(cli/__init__.py:212-214(not opened)), whichexport,benchanddebug-serveall attach — there is no separateservesubcommand, so the stated scope is complete. - The description's structure is good. It answers why / what / result / evidence in the required order, gives explicit before/after per area, correctly attributes the serving numbers to the paired core + recipe stack, honestly discloses the deselected legacy test and the unrun Rust crates, and ends with
Discord: neroin the required format (AGENTS.md:142-153). S3 is about labelling, not attribution. - No dead code, no parallel export path, no new fallback or switch in
helios/or the Protobuf schemas. Every changed file is on the direct path from flag to manifest.
CLAIMS CHECKED AND REJECTED
- "The whole flag duplicates
--online-mxfp8-scope; the entire diff should be deleted." Not supported by this tree.docs/cli-design.md:474documents--online-mxfp8as leaving "target vocabulary weights" at checkpoint precision, so the mechanisms are complementary; the cited precedent (PR #312,--online-mxfp8-scope with-vocabulary-head) is open and unmerged with a changes-requested review, and its recipe-side code was removed from this repository in17bb3c4a. Recorded as maintainer question 3 — the author should not be told to delete the PR. - "The exported core's capacity is understated." Corrected: exported rank memory comes from measured
recipe.usage(prepared)(declaration.py:214;helios/src/runtime_core/model.rs:156(not opened)), notPlan.weights_bytes. Only planning/selection accuracy is affected (B1). - "The sizing gap is deliberate conservatism." No evidence in the diff or the description, and the analogous
--expert-scale-compressiondoes reachweights_bytes(declaration.py:367-368). It remains a blocker scoped to planning, not to serving. - "The
Recipe.__post_init__check is clearly wrong." Not adopted as more than a nit: failing at recipe load is arguably better than failing at plan build, so nit 4 offers both directions and defers the four-tuple consistency call to maintainers.
WHAT COULD NOT BE VERIFIED HERE
- The MXFP8 byte reduction for the target head, and the
~600 MiB/+7.5–9.0% C1 decode/44/44gate / TP2abbenchfigures. All of it lives inlocal-inference-lab/hyperflare-recipes#40and its run logs; nothing in this repository declares the capability or converts a weight. This is why S3 is framed as a labelling/disclosure defect rather than an assertion that the numbers are wrong. - 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 S4 frames it as a disclosure gap rather than a policy violation. No test in the diff was executed for this review; every finding is established by reading the code atf54928b. - Whether any consumer outside this repository asserts on key presence in the plan JSON. The four in-repo consumers (
serve.py:215,serve.py:488,bench.py:182,bench.py:237) treat absent andNoneidentically, which is what makes nit 3 safe here. - Whether the companion recipe declares both
draft_head_quantizationsandtarget_head_quantizations, and whether its loader (and peer-rank path) readsplan.target_head_quantization. That decides how much of S2 and maintainer question 5 survives.
Note on review material: nothing in the PR description, diff or comments attempted to direct the reviewer's behaviour; the description's claims about scope, validation and compatibility were treated as claims to verify, and each is checked against the code above. The only discussion item is an automation case-file comment.