Pre test report report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/1929c1ed-e507-41b4-bbec-3880b33e4aa6.md

Pre-Test Report — PR #533 "Cap the per-request context target"

Recommendation: DO NOT refer to hardware testing yet. Return to author for fixes.

PR: https://github.com/NVIDIA/hyperflare-inference/pull/533 · author roobyz (CONTRIBUTOR) · head 1a006c6 · base main · 7 files, +35/−15 · no reviews, no CI checks on head. Supersedes closed PR #454 (CHANGES_REQUESTED). Security screen: all clear; I independently found no prompt-injection or agent-directed content in the description, diff, docs, or comments — the "Discord:" line and Design-Signed-Off-By/design-review=1af4 trailers are ordinary PR metadata.

I re-verified every review claim against the tree rather than trusting the summaries. The reviews agree, and they are substantially right.


1. Why testing now is not worth hardware time

The change is small and the core idea is sound, but three defects mean the artifact under test would be wrong, and any result would be invalidated by the pending fixes.

Blocking A — the flag is silently dropped on the multi-host export path

ignition/cli/serve.py:193-206: _export_hosts (reached whenever --ranks > 1, serve.py:153-156) ends its planning.plan(...) call at row_shard_prefill=args.row_shard_prefill) — no context=args.request_context. The other three sites do thread it: serve.py:289 (_prepare), serve.py:472 (debug_serve), ignition/cli/bench.py:177. The flag is registered once in _preparation_arguments (ignition/cli/__init__.py:167-170), so the attribute always exists and ignition export MODEL --ranks 2 --request-context 131072 parses, runs to completion, and prepares at the recipe maximum with no warning. This is exactly what the charter forbids ("Don't silently ignore API fields … Never accept it and quietly drop it", #417).

Two consequences for testing: the fix is a one-keyword change that alters the code path a test would poke; and our fleet cannot test this path anyway — --ranks > 1 needs a second host with a rendezvous address (cn5 is 4 GPUs on one host; cn7 is a single GB10). It must be pinned by a GPU-free test.

Blocking B — a non-page-aligned cap bakes a core that will not load

Plan.prepared_context (ignition/planning.py:369-373) is min(recipe.context, target, tokens) and becomes the core's max_sequence_tokens via bootstrap.py:58 → helios/src/server/config.rs:131,148. helios/src/model/catalog.rs:44-71 rejects a core unless both prepared_sequence_tokens (:50-52) and limits.max_sequence_tokens (:54-57) are multiples of page_tokens, returning the opaque "invalid prepared model configuration" (:70). The PR's only validations are positivity (planning.py:459-460) and the prefill-chunk check (planning.py:694-700) — no alignment check, while plan.page_tokens is right there (planning.py:326-330). So --request-context 200000 on a 128-token page exports fine and dies at flare run. Testing this before the fix just pays GPU time to re-confirm a known bug.

Note the alignment risk is highest at TP>1, where page_tokens multiplies by the CP size (planning.py:326-330).

Blocking C — the cap is unrecorded, so the artifact cannot be audited or reproduced

So flare inspect on a capped core prints an ignition export command that rebuilds the uncapped core (flare-cli/src/inspect.rs:453-455). AGENTS.md:452-456 requires the plan, its printed report and its recorded measurements to describe what was prepared. A test run against this head could not even tell from the output whether the cap took effect.

Blocking D — there are no tests at all

grep of tests/ for request_context|context_target|prepared_context|request-context returns zero matches. Nothing exercises the property, the validation, the new error branch, or the PR's headline claim that omitting the flag is a no-op. This is precisely what caught Blocking A, and AGENTS.md:194-199 requires it. The precedents are cheap and already exist: tests/cli/test_planning.py:71-138 (row_shard_prefill: asserts to_dict(), reproduction_args membership and manifest key+scope in one loop) and tests/cli/test_commands.py:59-98 (parser plus common_preparation_kwargs→BasePreparationConfig).

Should fix E — bench validates against the wrong context

Plan.__post_init__ (planning.py:248): if selection.required_context > self.context — self.context is the untouched stock value (planning.py:363-366), so with a cap set, a --contexts list above the cap passes planning and fails only at ignition/bench/runner.py:388, after the full GPU preparation, autotuning and graph capture. Bench also exports no core and already rejects inapplicable preparation flags (bench.py:115-118); it should either honour the cap or reject the flag.


2. Expected value of a hardware test at this head: LOW

The PR's own evidence (--kv-cache-limit concurrency throughout, per the description) measures a behaviour that already exists at runtime. I confirmed in helios/src/runtime_core/memory.rs:284-331 that page_ceiling returns Ok(None) for KvCacheLimit::Memory — the default (docs/cli-design.md:738) — and only Context/Concurrency compute ceil(context/page_tokens) × histories from server_config["max_sequence_tokens"] (memory.rs:631). So our GPUs would largely measure --kv-cache-limit's documented behaviour, not this PR; the newly added docs row (docs/cli-design.md:446) states the VRAM benefit unconditionally, which is misleading for a default flare run.

What is genuinely new and is worth testing once fixed: the export-time admission ceiling and the advertised max_model_len. --kv-cache-limit and --memory-limit bound the pool; neither can lower the per-request ceiling or advertise a smaller model length, both baked from prepared_sequence_tokens at load (config.rs:131-148, model.rs:261-273, server/models.rs:81 (not opened), server/request.rs:350 (not opened)). That is the real capability and the right thing to validate.

Two further devaluations: end-to-end reachability depends on the external hyperflare_recipes recipes mapping BasePreparationConfig.context → core max_sequence_tokens (AGENTS.md:379-384), and the author states recipe updates are still "pending" — so a test would depend on unpublished artifacts. And the stated motivation (headroom for a co-run / second model) is the charter's multi-model hosting/routing non-goal, requiring maintainer sign-off (charter Non-Goals; AGENTS.md:171-175); the justification should be reframed around honestly preparing and advertising a shorter-context core.

Verified clean (so testing would not need to re-check these): the no-flag path is a genuine no-op (planning.py:371-372 returns recipe.context, previously passed as-is); Plan.context is untouched; the frozen-dataclass default keeps construction and dataclasses.replace working (serve.py:207-211, bench.py:178-181); the cap correctly clamps to pool capacity; and negativity is rejected with a UsageError.


3. Conditional test plan (reuse after the fixes land)

Adopt when Blocking A–D and E are addressed and the recipe updates are published. Deliberately minimal: this is a memory-sizing knob with no throughput claim, so no A/B perf sweep is warranted.

Phase 0 — GPU-free, must pass first (no hardware time) pytest tests/cli/test_planning.py tests/cli/test_commands.py with added cases:

Phase 1 — cap actually reaches the core (cn5, 1 GPU, SM120) Use one GPU of cn5 (not all four; the change is orthogonal to parallelism except page size). Model: nvidia/GLM-5.3-Flash-NVFP4 (in-repo documented, GLM-5.3 Flash) — closest available match to the author's SM120 measurement. Two exports from the same command, differing only in the flag: A --request-context 131072, B unset.

  1. /v1/models → max_model_len is 131072 on A and the recipe max on B (the one assertion that proves the export-side value, not a runtime flag).
  2. A prompt of ~132k tokens is rejected at admission on A; a prompt just under the cap is accepted.
  3. flare inspect A shows the cap and its reproduction command re-exports a 131072 core (validates Blocking C).
  4. Control falsification: --request-context 100000 (not page-aligned) must fail at planning with an actionable message, not at load.

Phase 2 — VRAM, and the isolating comparison the PR owes Under both --kv-cache-limit memory (default) and --kv-cache-limit concurrency, at concurrency 1 and 4, record total VRAM for A and B. The pair isolates this PR from the runtime flag; under memory alone the delta may be ~0, which is the honest result and must be reported as such.

Phase 3 — regression (cheap) A pre-PR core still loads and serves; debug-serve with no flag matches main behaviour; --request-context still absent from flare run.

Budget / efficiency: ~2 exports + ~6 serve starts on a single cn5 GPU ≈ 1–2 GPU-hours, one model, one host. Skip multi-host (no second host), skip cn7 unless an ARM64-specific question appears, and do not benchmark throughput — the PR makes no speed claim.


4. Bottom line for the referral decision