Subtractive scratchpad · NVIDIA/hyperflare-inference #518

Raw Markdown for agents: https://autobot.eidonix.com/p/4e7911f0-b8c8-4b2d-b170-0e236678a3ed.md

#1 [high] Blocking: entire flag duplicates the existing --online-mxfp8-scope conversion-group mechanism

The PR adds a second mechanism for exactly the thing --online-mxfp8 --online-mxfp8-scope GROUP already does.

Evidence the existing mechanism already covers a target-vocabulary-head conversion group:

And the group this PR wants already exists in the tree's design precedent: PR #312 (--online-mxfp8-scope with-vocabulary-head) selects a group that "reads 239 MB of vocabulary weights per rank", i.e. it quantizes the target vocabulary head, and "the scope enters the tuning identity and the rebuild manifest" with "No kernel, Helios code, Protobuf field or package contract changes" (#312 section 7, files: ignition/components/vocabulary.py, ignition/recipes/inkling2/*). Kimi K3.1 likewise declares the kda-input vs all groups today.

So the companion Qwen3.8 recipe can declare online_mxfp8=True and add a vocabulary-head entry to online_mxfp8_scopes; the exported plan, Plan.to_dict(), and the SCOPE_TARGET_WEIGHT manifest entry all follow from code that already exists.

What goes (the whole diff, +126/−10): declaration.py:278 + 328-329; planning.py:199, 289-293, 411-412; cli/init.py:212-214; cli/preparation.py:57, 73; cli/serve.py:210, 278, 314, 479; cli/bench.py:170, 250-251; rebuild_manifest.py:302-303, 363-364; docs/cli-design.md:454; and all ~88 test lines in tests/cli/test_commands.py:22-23, 52, 102-139 and tests/cli/test_planning.py:23, 54, 212-253.

Saves ~126 lines. Nothing is lost: the opt-in is still recipe-declared, still CLI-only, still carried through Plan into SCOPE_TARGET_WEIGHT, still rejected by recipes that do not declare it — via a mechanism that is already documented, already tested, and already used by two other recipes. Repository rules it collides with: charter "Solve the right problem in the right place … a way to solve it without new code at all"; AGENTS.md "Reject unsupported abstractions and churn. Do not add … configuration switches without a concrete requirement"; docs/design-review.md principle 10 ("Settings belong in recipe declarations, configuration files, or CLI flags") is satisfied equally by the existing flag.

#2 [high] Should fix: the ~88 new test lines repeat three existing tests verbatim in shape

Even if the flag were kept, the tests prove nothing the suite does not already prove:

Saves ~88 lines. What already covers the contract: test_row_shard_prefill_* proves the same CLI-forwarding-into-Plan shape, and test_preparation_manifest_resolves_scopes_and_dflash2_inheritance proves the same manifest scope/round-trip machinery, including the "changing a target-weight parameter rejects combine and reuse" case in helios/src/runtime_core/preparation.rs:530-539.

#6 [high] Research summary

Reviewed PR #518 (+126/−10, 10 files) against the charter, AGENTS.md and docs/design-review.md, strictly for subtraction.

Central finding (blocking): the flag duplicates a mechanism the repository already has. --online-mxfp8 --online-mxfp8-scope GROUP is already recipe-declared, free-form in group name (ignition/declaration.py:267-269, planning.py:223-229, validated only by membership), already carried through Plan and recorded as SCOPE_TARGET_WEIGHT in PreparationManifest plus reproduction args (rebuild_manifest.py:294-297, 358-360), already wired to export/bench/debug-serve via the shared _preparation_arguments (cli/init.py:50/53/60), and already documented as "select a conversion group declared by the recipe" (docs/cli-design.md:475). PR #312 shows the target-vocabulary-head case is exactly such a group (--online-mxfp8-scope with-vocabulary-head, no Rust or Protobuf change). So the whole diff, ~126 lines, can go: the companion recipe declares a vocabulary-head group instead.

Secondary findings: the ~88 new test lines clone the row_shard_prefill CLI/planning/manifest tests; the bench preparation dict grows from 12 to 21 lines for one optional key (a one-expression filter does both jobs in 6) plus five dead getattr(..., None) fallbacks; Recipe.__post_init__'s new 2-line check duplicates the plan-level check that actually produces the user-facing error, while its three sibling override tuples have no recipe-level check at all; the extra startup-status line and doc row restate what the online-MXFP8 scope line and rows already say, and target_head_quantization has no consumer outside ignition/ and tests/.

Total estimated removable: ~126 lines (essentially the whole change), of which ~27 lines could still go if the flag were kept.

#7 [high] Summary: change size, ranked line savings, and cited rules

Change size, measured from the diff: 10 files, +126 / −10.

Ranked findings and their line savings (entries 1–5):

  1. Blocking — whole flag duplicates --online-mxfp8-scope group mechanism: ~126 lines (entry 1).
  2. Should fix — 88 test lines clone existing row_shard_prefill tests: ~88 (entry 2).
  3. Should fix — bench.py:243-252 dict splat + 5 dead getattr fallbacks: ~5 + 5 sites (entry 3).
  4. Nit — Recipe.post_init validation duplicates Plan's: 2 (entry 4).
  5. Nit — duplicate status line (serve.py:314) and doc row (cli-design.md:454): 2 (entry 5).

Relationship: 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 (88 test lines + ~9 code/doc lines).

Rules cited: charter line 12 ("Keep the runtime small and model-agnostic … Standard model extensions … 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 "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement" and "Every contribution must address … a measured performance or memory problem"; docs/design-review.md principle 10 (settings belong in recipe declaration, config file, or CLI flag — satisfied by the existing flag), principle 15 (reject scope expansion).

Nothing in the change touches helios/, heliopause/ or Protobuf — confirmed by grep (no target_head_quantization outside ignition/ and tests/), matching the description's own claim. So there is no leftover/deprecated code elsewhere in the repo for this change to remove; the subtraction is entirely within the diff.

#3 [medium] Should fix: bench preparation block grows 12→21 lines for one optional key; 5 dead getattr fallbacks

ignition/cli/bench.py:243-252 — the change replaces a 12-line dict-literal comprehension with a 10-line pair of **{} splats, purely to append one optional key. A membership filter does both jobs in one expression and 6 lines:

"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},

Saves ~5 lines and removes the special case: 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 only this 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.

Same getattr noise, 4 sites, no behaviour: getattr(args, "target_head_quantization", None) at serve.py:210, serve.py:278, serve.py:479, bench.py:170 and getattr(plan, 'target_head_quantization', None) at rebuild_manifest.py:302 — every command that reaches these functions builds its parser through _preparation_arguments (cli/init.py:50/53/60), so the attribute always exists, and neighbouring fields in the same calls read it directly (args.row_shard_prefill, args.online_mxfp8, plan.force_moe_decode_a16 at rebuild_manifest.py:300, plan.row_shard_prefill at :308). Use args.target_head_quantization / plan.target_head_quantization.

#5 [medium] Nit: status line and doc row restate what the online-MXFP8 scope line/rows already say

What the change leaves behind or repeats for one sentence of output:

#4 [low] Nit: Recipe validation of target_head_quantizations duplicates Plan's check; siblings have none

ignition/declaration.py:328-329 — if any(name not in ("mxfp8",) for name in self.target_head_quantizations). The three sibling override tuples this 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 (ignition/planning.py:487-495). The new tuple gets validated twice: here and in Plan.__post_init__ (planning.py:289-293), which is the check that produces the user-facing UsageError and the only one a CLI path can reach. Removing the recipe-level check makes the field match its neighbours and loses nothing: an unsupported name still fails at plan(), with the alias named. Saves 2 lines.

Also ignition/declaration.py:276 — the comment "Preparation overrides for vocabulary and transition projections" was reworded from "…used only by proposals" purely to stay true after adding a target-side field. If the flag goes, that edit goes with it (0 net lines, but it is churn against "Unsolicited … comment expansion … are not contributions").

ignition/declaration.py:208-243 — the class docstring documents online_mxfp8, language_model_only, mla_compute_modes, export_repository, b12x_environment, row_shard_prefill_world_sizes, but the new target_head_quantizations gets no docstring line. If the flag is kept it should be documented there like its siblings; if dropped the problem disappears. Folded into finding 1.