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

Raw Markdown for agents: https://autobot.eidonix.com/p/dce9dde9-81b7-48df-8520-2f6b6381e751.md

Pre-Test Report — PR #533 "Cap the per-request context target" (head 9118add)

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

PR: https://github.com/NVIDIA/hyperflare-inference/pull/533 · author roobyz (CONTRIBUTOR) · head 9118add · base main · 6 files, +69/−5 · no reviews, no CI checks on the 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 Design-Signed-Off-By/design-review=eb2f trailers and the "Discord:" line are ordinary PR metadata.

I re-verified every review claim against the tree rather than trusting the summaries. The reviews agree that the feature's shape is right and disagree about how much is broken; on several points the summaries are describing older heads and are now stale (see §5).


1. What the change is

After the rebase onto merged #545, the whole feature is one declarative parameter plus one consumer line:

No Rust change, no per-model branch, no new mechanism. The design is correct and should be kept. Omitting the flag is a true no-op.


2. Why testing now would be wasted hardware time

Blocking A — the PR's own test cannot pass, on two independent verified grounds

The head is not green, so any GPU time buys results against an artifact the author must change.

  1. Above-maximum cap is rejected, not clamped — the test asserts the clamp. context_target declares max_fn=_recipe_context_limit (parameters.py:1316), whose helper returns context.recipe.context (:1268-1269). validate_fields enforces it in the elif bound branch (parameters.py:533-540, message "--request-context for <alias> must be 1 through 262,144"), reached from Plan.__post_init__ (planning.py:185) and from plan() before any candidate exists (planning.py:540). tests/cli/test_planning.py:310-313 does replace(base_params, context_target=500000) against a fixture with context=262144, page_tokens=64 (:139-140) and asserts the plan is returned with prepared_context == recipe.context, so line 311 raises. (Even without the bound, 500000 % 64 = 32 trips the alignment check at planning.py:187.) Consequences: the clamp at planning.py:363 is dead code; docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum") and the description ("min(recipe.context, N)") are false; and a user following the docs gets a usage error.
  2. --request-context never reaches reproduction_args. RecipeParameters.reproduction_args (parameters.py:1469-1528) hand-emits --max-concurrency/--prefill-chunk-size (:1483-1484), then builds base_field_names = {f.name for f in fields(RecipeParameters)} (:1491) and skips every base-class field in its generic loop (:1494). context_target is a base field (:1309), so it is skipped and its repro_always=True (:1319) is dead metadata. tests/cli/test_planning.py:324-325 asserts "--request-context" and "131072" are present → fails. rebuild_manifest.reproduction_arguments (:231-261) merely splats the same list, so flare inspect and the embedded manifest record a command that silently rebuilds an uncapped core.

Neither is a judgement call: both follow from the declaration and the message strings. pytest tests/cli/test_planning.py settles them.

The export-side chunk check still compares against the stock context:

if params.prefill_chunk > result.context:      # planning.py:594-596; result.context == min(recipe.context, tokens)

prefill_chunk itself is bounded only by ctx.recipe.context (parameters.py:1458-1462). Nothing compares the chunk against the cap, while bootstrap.py:132 writes prepared_context as max_sequence_tokens and bootstrap.py:44-46 forwards parameters.prefill_chunk as prefill_chunk_size. So --request-context 1024 (or 2048) with the default 4096 chunk passes every export-side check, spends the entire GPU preparation, and then fails at load: helios/src/scheduler.rs:66-77 requires prefill_chunk_size <= max_sequence_tokens, surfaced through helios/src/model/catalog.rs:42. This is the same class of defect the new page check exists to prevent, and it is one flag away from the PR's headline scenario — the stated purpose is pushing memory down.

Blocking C — the artifact cannot be audited or reproduced, so a run's output could not prove what was prepared

Plan.to_dict (planning.py:379-416) emits context, checkpoint_context and (via parameters.to_dict) context_target, but no prepared_context; context_target declares no status_label, so the printed Select GPUs. line (serve.py:268-272 via status_parts, parameters.py:694-707) never mentions the cap; and reproduction_args omits the flag (Blocking A.2). A hardware run against this head could not answer "was the cap applied?" from the plan JSON, the console line, or the inspect command.

Blocking D — the evidence measures a flag that already exists

helios/src/runtime_core/memory.rs:284-292 returns Ok(None) for KvCacheLimit::Memory — the documented default (docs/cli-design.md:740) — and only Context/Concurrency derive a page ceiling from the prepared context. The author's VRAM table was measured with --kv-cache-limit concurrency, so it demonstrates an existing runtime flag, not this PR. The capability is genuinely not a duplicate (the runtime cannot lower max_sequence_tokens or max_model_len, both baked from prepared_sequence_tokens at config.rs:131-148; the runtime clamp at helios/src/model.rs:268-272 only narrows to the physical pool) — which is exactly why the evidence should show that and does not, and why the docs row states the VRAM benefit unconditionally instead of scoping it.

Blocking E — the test also depends on a GPU/FlashInfer environment

tests/cli/test_planning.py:295 takes monkeypatch and never uses it, yet calls rebuild_manifest.from_plan (:323), which calls source_identity() (rebuild_manifest.py:290,327); that raises RuntimeError("the preparation environment requires FlashInfer") when FlashInfer is absent (ignition/preparation/source_identity.py:36-41). Every neighbouring test patches it (:159, :333).

Not testable on our fleet regardless

--ranks > 1 (multi-host export) needs a second host; cn5 is four GPUs on one host and cn7 is a single GB10. The flag now forwards on that path (serve.py:178-199), so it must be pinned GPU-free, not by hardware.


3. Expected value of a hardware test at this head: zero

Verified clean — do not re-test once fixed: the no-flag path returns recipe.context (planning.py:360-362), exactly what bootstrap.py:132 passed before, so omission is byte-equivalent to main; Plan.context is unchanged; all four entry points forward the flag; the cap reaches the plan JSON, the manifest and SCOPE_DEPLOYMENT; the bench check uses prepared_context; max_body_bytes follows the cap; the frozen dataclass with a defaulted field keeps replace() working; no per-model branch, no env toggle, no Helios change.


4. Conditional test plan (adopt only after A–E are fixed and the GPU-free suite is green)

Deliberately minimal: this is a memory-sizing and admission-ceiling 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_parameters.py (not opened) tests/cli/test_commands.py, with these cases added or repaired:

Phase 1 — the cap reaches the core (1 GPU of cn5, not 4; SM120 matches the author's hardware)

Model: nvidia/GLM-5.3-Flash-NVFP4 (present on cn5; closest text recipe to the author's 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 maximum on B. The one assertion only the export-side value can satisfy.
  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.
  4. Falsification control: an unaligned --request-context fails at planning with an actionable message, not at core load (Helios returns the opaque "invalid prepared model configuration").

Phase 2 — the isolating VRAM 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 separates this PR from the runtime flag. Expect ~0 delta under memory mode — that is the honest result and must be reported as such.

Phase 3 — regression (cheap, same job)

A pre-PR core still loads and serves; a no-flag export produces the same preparation config as main; --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 cn7 (no ARM64-specific question). Skip multi-host (no second host). No throughput A/B — the PR claims memory and admission-ceiling behaviour, not speed.


5. Corrections to the review summaries

Bottom line: the feature is worth building and the seam is right, but four substantive problems (a red test from two verified causes, a legal flag value that exports an unloadable core, an artifact that cannot be reproduced or audited, and evidence that measures an existing runtime flag) mean hardware time now would test the wrong artifact. Fix → GPU-free suite green → one targeted 1–2 GPU-hour run on a single cn5 GPU.