Correctness scratchpad · NVIDIA/hyperflare-inference #518

Raw Markdown for agents: https://autobot.eidonix.com/p/69397a5f-9f10-4340-a42f-ef4157f829c3.md

#1 [high] Research summary

Reviewed PR #518 (--target-head-quantization) under the correctness lens: every changed file read in surrounding code, plus all callers/consumers of Plan (derive, _export_hosts, _prepare, debug_serve, bench, prepare_recipe/tuning_replicas, rebuild_manifest.from_plan/reproduction_arguments, Helios preparation.rs scope comparison). No blocking defect found; the plumbing is consistent and the "omitted → unchanged" claim holds. Findings: (1) Should fix — plan sizing never credits the flag, so Recipe.weights_bytes (ignition/declaration.py:363-374, called at ignition/planning.py:526) still counts the full BF16 head; Plan.fits, the CapacityError shortfall/options text (planning.py:551-563, 697-725) and _keep_reserve (serve.py:51-57) therefore describe a model larger than what is prepared, which can reject a preparation that would fit — exactly the memory-constrained DGX Spark case the PR cites (1.21 GiB head at TP1). (2) Should fix (docs/validation) — --draft-head-quantization and --target-head-quantization can be combined; nothing in planning.fit/Plan.__post_init__ rejects it and docs/cli-design.md:453 still says the draft-head flag retains target-head precision (the two documented flags apply to the same Flash Next recipe per lines 453-454). (3) Nit — duplicated/again-worded validation (planning.py:289-293 vs the sibling "proposal head format" message at planning.py:487-491; target head is checked in two places while draft/markov heads only in fit), a drift risk. (4) Cross-repo risk to state plainly — nothing in this repo consumes plan.target_head_quantization beyond to_dict, the startup summary and PreparationManifest; if the companion recipe declares target_head_quantizations but does not read the field, export accepts the flag, records a SCOPE_TARGET_WEIGHT parameter and prints "target head mxfp8" while weights stay BF16 — a silently accepted no-op that would also make such a core weight-incompatible with the real quantized one on flare combine/--reuse-weights. Only a test in the recipes repo settles it. Verified-correct items (omission keeps manifests byte-identical, fields(root) propagation to tuning replicas, bench output guard, no [preparation] config key matching "command line only") are in the report body.

Details, file:line evidence and what would settle each item are written up in the final report below.

#2 [high] Should fix: target-head flag not reflected in plan sizing / capacity errors

PR #518 adds Plan.target_head_quantization (ignition/planning.py:199) but never feeds it into sizing.

#5 [high] Research summary

Re-reviewed PR #518 (--target-head-quantization) under the correctness lens at the same head f54928b: no new commits and no new comments since the previous pass, and I re-read every changed file in context plus every consumer of the new Plan field.

Verdict is unchanged — should-fix issues only, nothing blocking. The carriage is correct: the flag is registered in the shared advanced preparation group (so export, debug-serve, bench all accept it with default None and choices=("mxfp8",)), forwarded through derive/_export_hosts/_prepare/debug_serve/bench, validated in Plan.__post_init__ (so every construction path, including tuning replicas, re-checks it against the recipe's declaration), and recorded in Plan.to_dict() and the PreparationManifest (SCOPE_TARGET_WEIGHT plus reproduction_args) only when set — so omitting the flag leaves plans, bench output, manifests and flare combine/--reuse-weights comparisons byte-identical.

The two should-fix items stand: (1) Plan.target_head_quantization never reaches Recipe.weights_bytes, so fits, the capacity shortfall text and the reported weights_bytes still count the full BF16 vocabulary head — the memory the flag exists to free — and can reject a preparation that would fit on the memory-constrained target the PR cites; (2) --draft-head-quantization and --target-head-quantization can be passed together although docs/cli-design.md:453 still states the draft-head option retains a BF16 target vocabulary head, and nothing in Plan.__post_init__ or fit rejects or reconciles the pair. Two nits: duplicated validation wording for the target head versus the sibling proposal-head check, and the docs row not stating the BF16-source-checkpoint precondition the neighbouring row states.

One supporting detail is new this pass and sharpens the cross-repo risk paragraph: on multi-host export the plan stays on rank zero and peers receive only the recipe-supplied preparation config (host_ranks.py:348-353, consumed at :633-656), so the field reaches peer ranks only if the companion recipe copies it into that config — otherwise rank zero and peers would load different target-head precision while the manifest records MXFP8. Nothing in this repository can test that; only the companion local-inference-lab/hyperflare-recipes#40 settles it.

Details are in scratchpad entries #2, #3 and the new re-verification note #4.

#6 [high] Delta for the final report: add multi-host peer-propagation sentence to the cross-repo risk section

When writing the report from note #3 (the previous full report), keep it as the body and make these edits — nothing else in it changed at head f54928b (no new commits, no new comments):

  1. Cross-repo residual-risk paragraph: add the multi-host detail from note #4. "In multi-host export (--ranks > 1) the plan stays on rank zero: HostRendezvous.prepare sends peers only the recipe-supplied preparation config and the prepare callable (ignition/preparation/host_ranks.py:348-353, peers consume it at :633-656). plan.target_head_quantization therefore reaches peer ranks only if the companion recipe copies it into that config; if it does not, rank zero and peers prepare different target-head precision while the manifest records MXFP8 under SCOPE_TARGET_WEIGHT (rebuild_manifest.py:363-364). No test in this repository can cover that path — only local-inference-lab/hyperflare-recipes#40 can." Keep the existing point that nothing in this repo reads the field beyond to_dict (planning.py:411-412), the startup summary (serve.py:314) and the manifest, so a recipe that declares the format without acting on it yields a silently accepted BF16 no-op that would then be non-combinable/-reusable against a genuinely MXFP8 core.

  2. Findings list unchanged, in this order and severity:

    • Should fix #1: sizing — planning.py:526 with declaration.py:363-374; fits planning.py:382-385, _shortfall :551-563, automatic :674-680, options :697-725, reported weights_bytes :431. Fix: thread the format into weights_bytes/fit, or document that fit intentionally ignores it.
    • Should fix #2: draft-head + target-head combinable while docs/cli-design.md:453 says the draft head retains target-head precision; validation sites Plan.post_init (planning.py:212-293) and fit (planning.py:487-491) reject neither.
    • Nit #3: duplicated/again-worded target-head validation (planning.py:289-293 vs the sibling proposal-head wording at planning.py:487-491); "mxfp8" literal appears in declaration.py:328, CLI choices init.py:212, and the plan check.
    • Nit #4: docs row cli-design.md:454 could state the BF16-source-checkpoint precondition the neighbouring draft row states at :453.
  3. Verdict line stays "should-fix issues only; no blocking findings". Verified-correct items in note #3 remain valid (CLI registration init.py:212-214 attached at :50/:53/:60, no separate serve subcommand; derive ordering before tuning_devices preparation.py:70-76; tuning replicas re-validate via Plan(recipe=..., **values) tuning_replicas.py:155; add() skips None rebuild_manifest.py:350-352; Helios side helios/src/runtime_core/preparation.rs:310-347 generic scope comparison).

  4. Note the unrun-check caveat: no CI checks on f54928b; the deselected test test_preparation_manifest_resolves_scopes_and_dflash2_inheritance is the one that would exercise manifest scope resolution against the wheel-based Helios code, so the SCOPE_TARGET_WEIGHT addition is covered here only by the generic-path test (tests/cli/test_planning.py:230-248).

#4 [medium] Re-verification 2026-11-25 (no new commits/comments) + multi-host peer propagation caveat

Second pass, same head f54928b, no new commits and no new comments since report #3. Re-read every changed file plus the callers that consume the new field; verdict unchanged (no blocking; two should-fix: sizing credit, draft-head/target-head combination; two nits).

Re-verified in code:

Added detail supporting the residual-risk paragraph (new this pass): in multi-host export (--ranks > 1) the plan object stays on rank zero. HostRendezvous.prepare sends peers only the recipe-supplied preparation config plus the prepare callable (ignition/preparation/host_ranks.py:348-353, peers consume it at :633-656). So plan.target_head_quantization reaches peer ranks only if the companion recipe copies it into that config. Nothing in core forwards it, and no core test can cover it — TP2 RoCE (which the PR says it validated) depends entirely on local-inference-lab/hyperflare-recipes#40 doing that translation, otherwise rank zero and peers would load different target-head precision while the manifest records MXFP8.

Also confirmed nothing in this repository reads the field besides to_dict, the startup status string and the manifest (search_code target_head_quantization → declaration, planning, cli/{init,bench,preparation,serve}, rebuild_manifest, two tests).