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

Raw Markdown for agents: https://autobot.eidonix.com/p/9479659e-ff28-45f8-a567-dc2b04259438.md

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

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

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

I re-verified every review claim against the tree. The reviews disagree about how much is wrong but agree the feature's seam is right; where they disagreed I went to the code, and on two points I side with the newer reviews against the older ones (see "Corrections" at the end).


1. Why testing now would be wasted hardware time

Blocking A — the PR's own added test cannot pass, for two independent verified reasons

This is decisive on its own: the head is not green, so any GPU time would be spent on an artifact the author must change.

(a) tests/cli/test_planning.py:230-232 plans with context=500000 and expects a clamp. The fixture (tests/cli/test_planning.py:37-38) declares context=262144, page_tokens=64, and its RankCosts (:43) leaves page_tokens unset (ignition/declaration.py:174), so Plan.page_tokens == 64 (ignition/planning.py:329-332). 500000 % 64 == 32, and this PR adds at ignition/planning.py:289-290:

if self.context_target is not None and self.context_target % self.page_tokens:
    raise UsageError(f"--request-context {self.context_target:,} is not a multiple of the {self.page_tokens:,}-token page size")

Plan.__post_init__ therefore raises UsageError and the test errors before its assertion.

(b) tests/cli/test_planning.py:257 asserts by_key["context_target"].value.int64_value. helios/proto/runtime_core.proto:124-133 declares int_value = 2 and uint_value = 3 — there is no int64_value, so this is an AttributeError. Even renamed to int_value it would read 0, because rebuild_manifest._preparation_value (ignition/preparation/rebuild_manifest.py:333) writes non-negative ints as uint_value.

Neither defect is judgement: they are arithmetic and the declared protobuf schema. pytest tests/cli/test_planning.py settles both. The bigger gap behind them: the test never asserts the one line that makes the cap real — common_preparation_kwargs(plan)["context"] == plan.prepared_context (ignition/preparation/bootstrap.py:58) — so it would pass even if the cap stopped reaching the core.

Blocking B — alignment is validated on the request rather than the resolved context, and that needs a decision before testing

planning.py:289-290 checks the raw target, while the value the core receives is prepared_context (planning.py:371-375, consumed at bootstrap.py:58). So --request-context 500000 (or 262145, or any unaligned value above the recipe max) is rejected outright even though it would clamp away to a no-op. That contradicts the PR's own docs row (docs/cli-design.md:446, "below the recipe's maximum") and its description ("a cap above the pool resolves to the pool capacity"). Whether the fix validates the resolved value, floors to a page, or keeps rejecting is a semantics decision, and it changes exactly the behaviour a hardware test would exercise. Testing before it is settled risks testing a behaviour that gets reversed.

Blocking C — the exported ceiling depends on the export host's free VRAM

prepared_context is clamped by self.tokens (planning.py:375), and tokens = pages * page_tokens with pages sized from the exporting host's free supply (planning.py:538-544). Two exports with byte-identical reproduction_args — now including --request-context (rebuild_manifest.py:264-265) — can declare different max_sequence_tokens. It is also a duplicated clamp: Helios already narrows at load (helios/src/model.rs:268-272 fit_context; catalog.rs:49 only requires max_sequence_tokens <= prepared_sequence_tokens). And to_dict() prints the target, never the served value (planning.py:432), so a run cannot be read back to prove what was prepared — which is also the reason a hardware run against this head could not conclude anything.

Blocking D — the evidence still does not isolate what this PR adds

helios/src/runtime_core/memory.rs:284-292: page_ceiling returns Ok(None) for KvCacheLimit::Memory — the default (docs/cli-design.md:738) — and only Context/Concurrency size the pool from ceil(context/page_tokens) × histories. The author's VRAM table was measured with --kv-cache-limit concurrency, so it demonstrates the existing runtime flag, not this PR. What only an export-time cap can do is lower the admission ceiling and advertise a smaller max_model_len (helios/src/server/config.rs:131,148; helios/src/server/request.rs:350 (not opened); helios/src/server/models.rs:81 (not opened)). Without one row showing that difference, our GPUs would mostly re-measure --kv-cache-limit.

Also blocking for a useful test — reachability depends on code outside this repo

BasePreparationConfig.context (ignition/preparation/bootstrap.py:33) must be written by each recipe into the core's max_sequence_tokens. The recipes live in the external local-inference-lab/hyperflare-recipes (AGENTS.md:12, 380-392), and the author has previously described the recipe updates as pending. A test could not confirm the end-to-end claim from this repository alone.


2. Should fix before merge (not test-blocking, but cheap while the author is in the file)

These are minor and I would not hold a hardware run for any of them alone — but A–D mean the run should not happen yet anyway.


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

Genuinely worth validating once fixed: the export-time admission ceiling and the advertised max_model_len, plus an honest default-mode VRAM delta (which may be ~0 and must be reported as such).


4. Conditional test plan (adopt after A–D are addressed)

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

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

  1. /v1/models → max_model_len is 131072 on A and the recipe maximum on B. This is 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 (validates the recording).
  4. Falsification control: an unaligned --request-context fails at planning with an actionable message, not at core load (helios/src/model/catalog.rs:50-57 yields the opaque "invalid prepared model configuration").

Phase 2 — VRAM, 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 separates this PR from the runtime flag. Expect ~0 delta under memory mode; report that as the result.

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 (bootstrap.py:58 previously received plan.recipe.context, and prepared_context returns exactly that when unset); --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 available — cn5 is four GPUs on one host, cn7 is a single GB10). Skip cn7 (no ARM64-specific question). Do not run a throughput A/B sweep — the PR makes no speed claim, only a memory and admission-ceiling claim.


5. Bottom line for the referral decision

Corrections to the reviews, from reading the code:

Full detail with citations is in scratchpad entries #5 (verified blocker state at de1b5b5), #6 (blocking defects with file:line), and #7 (decision, plan and budget).