Pre-Test Report — PR #533 "Cap the per-request context target" (head 448f70a)
Recommendation: REFER TO HARDWARE TESTING — narrowly, and after two one-line reporting fixes and a green GPU-free suite.
PR: https://github.com/NVIDIA/hyperflare-inference/pull/533 · author roobyz (CONTRIBUTOR) · open · base main · head 448f70a · 8 files, +91/−28 · no CI checks on the head, no human review at this 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, the Discord: rzr2020 line and the @flare-autobot boilerplate are ordinary process metadata; the bot's #autobot:ignore opt-out line was not treated as an instruction).
This reverses my recommendation at the two previous heads. At e623985 and again at 9118add I recommended no referral. I re-verified every one of those blockers against the tree at 448f70a, and all four are genuinely fixed in code, not merely claimed in the description. What remains is reporting fidelity and help wording — no behaviour change, no unloadable core, no silently dropped flag. That is the first head at which hardware time buys information instead of confirming known defects.
1. What the change is (verified at 448f70a)
ignition/parameters.py:1309-1319—context_target: int | Noneon the universalRecipeParametersbase:--request-context N, group "capacity and compression",min_value=1,manifest_key="context_target",DEPLOYMENTscope. Nomax_fn, so a target above the recipe maximum clamps rather than being rejected.ignition/planning.py:357-363—Plan.prepared_context:recipe.contextwhen unset, elsemin(recipe.context, target).Plan.context(:352-355,min(recipe.context, tokens)) is deliberately untouched.ignition/planning.py:186-190— page-multiple rejection, correctly gated ontarget <= self.recipe.context, i.e. exactly the set whereprepared_context == target, leaving an oversized unaligned target the documented no-op.ignition/preparation/bootstrap.py:132—"context": plan.prepared_contextincommon_preparation_kwargs. This is the only line that changes the exported core:BasePreparationConfig.context(bootstrap.py:33) → Heliosprepared_sequence_tokens(helios/src/server/config.rs:131) andlimits.max_sequence_tokens(:148) → advertised asmax_model_len(helios/src/server/models.rs:81) and enforced at admission (helios/src/server/request.rs:349-355), then pool-clamped at load (helios/src/model.rs:268-272).ignition/parameters.py:1483-1484—--request-contexthand-emitted inreproduction_argsahead of the base-class-field skip at:1491-1495;rebuild_manifesttherefore carries it into the manifest andflare inspect. Printed report shows the clamped value (parameters.py:1560-1561); plan JSON carriesprepared_context(planning.py:396); bench record carries the whole parameter dict (bench.py:263-266);max_body_bytesandcontext_hintfollow the cap (serve.py:67-70);MODEL --helplabels the recipe context a maximum (help.py:46);--request-contextcorrectly absent fromflare run(cli/__init__.py:22).
Verified fixed since my last report — do not re-raise: test env + seam pin (tests/cli/test_planning.py:296, :318); clamped status line; prepared_context in to_dict; pool-aware bench bound. I also read the new test's arithmetic against the fixture (:139-142, context=262144, page_tokens=64) and all five of its cases should pass: 131072 caps, 500000 clamps (page check correctly skipped above the max), 0 trips min_value, 100 trips the page check, and the manifest round-trip matches. Claims in several review summaries that "the test cannot pass" describe older heads (de1b5b5, 02023eba, 9118add), and the recurring claim that "reverting bootstrap.py:132 leaves the test green" is false at this head — :318 is a chained comparison, so kwargs["context"] == 131072 fails on a revert.
2. Should fix before the run (two one-liners, reporting only)
Neither blocks merge on correctness grounds; both matter because they are what a test engineer reads to decide whether the cap took effect.
ignition/planning.py:320-321—demand_pagesstill uses the uncapped recipe max, and it is printed at:407inside the same plan JSON that now carriesprepared_context. With a cap the KV demand row is ~2× the served extent — the exact number this PR exists to lower, in the artifact used to explain the VRAM result. Sole consumer isto_dict; useprepared_context.ignition/planning.py:396—to_dictreplaces main'scheckpoint_contextkey withprepared_contextinstead of adding. No in-repo reader (search_code checkpoint_context→ no matches), so it is reporting fidelity only, but the plan record then cannot state the recipe's declared maximum and the served extent at once. Emit both.
Everything else is nits and should not hold hardware time: the page-multiple rule is hand-written in __post_init__ rather than ParamSpec.multiple_of/RecipeParameters.validate and its message omits the for {alias} clause every sibling flag error carries (parameters.py:520,531,539); the help says "must be a multiple of the page token count" unconditionally though planning.py:187 skips the check above the recipe maximum; parameters.py:1561 dereferences context.recipe without the None guard used at :1268-1269; and the pre-existing --prefill-chunk-size bound still advertises recipe.context (parameters.py:1301) while the plan now rejects above min(context, prepared_context) (planning.py:594-597).
3. Expected value of the hardware test
The capability is real and no runtime flag duplicates it. --kv-cache-limit context|concurrency and --memory-limit shape the KV pool (helios/src/runtime_core/memory.rs:238-331 (not opened)). Neither can lower the exported max_sequence_tokens or the advertised max_model_len, both baked from prepared_sequence_tokens at export/load (config.rs:131-148, server/models.rs:81). Honest under-capacity advertising is an export-time decision, and bootstrap.py:132 is the smallest seam that reaches it.
But the PR's own VRAM table does not isolate this PR. page_ceiling returns Ok(None) for the default KvCacheLimit::Memory, and the author's commands all used --kv-cache-limit concurrency. Export-side page sizing is untouched. So the headline 16 GB largely re-measures an existing runtime flag — which the description now concedes. The high-value test is not VRAM; it is the admission ceiling and the advertised max_model_len, which only this flag can produce. The plan below weights accordingly and reports the default-mode VRAM delta honestly even if it is ~0.
Reachability depends on code outside this repository. Recipes live in local-inference-lab/hyperflare-recipes (AGENTS.md:379-384) and the author states recipe updates are still pending. Step 1 of Phase 1 is therefore a reachability gate: if max_model_len does not move, the correct conclusion is "blocked on external recipe", not "PR broken".
Not testable on our fleet at all: --ranks > 1 needs a second host with a rendezvous address. cn5 is four GPUs on one host; cn7 is a single GB10. Multi-host must be pinned GPU-free.
4. Test plan (minimal, one host, one GPU, one model)
Phase 0 — GPU-free, must pass before any hardware booking (zero GPU time).
pytest tests/cli/test_planning.py tests/cli/test_commands.py (not opened) tests/cli/test_parameters.py (not opened) — this head has never run in CI, so a green run is itself the first result. Add: common_preparation_kwargs(...)["context"] == 131072 capped and == recipe.context unset through BasePreparationConfig(**kwargs) (the seam is asserted as a dict at :318, not as a constructed config); one pytest.raises(UsageError, match="prefill-chunk-size") for context_target=2048 with the fixture's 4096 chunk — planning.py:594-597 is a new safety check with no test; reproduction_args contains --request-context 131072; manifest context_target present with DEPLOYMENT scope; flag present on export/bench/debug-serve and absent from flare run; and a --ranks 2 plan carrying the cap (the only available pin for multi-host). Also run the two one-liners from §2 and re-run.
Phase 1 — the cap reaches the core (1 GPU of cn5, not 4; SM120 matches the author's card).
Model: nvidia/GLM-5.3-Flash-NVFP4 (cached on cn5; GLM uses 256-token pages per docs/core-design.md:1480). Read the recipe maximum from MODEL --help and choose N = half that, rounded down to a page multiple. Two exports from the same command differing only in the flag: A --request-context N, B unset.
- Reachability gate:
/v1/models→max_model_lenisNon A. On B expectmin(recipe max, pages × page_tokens)(Helios'sfit_contextclamps at load, so B may legitimately read below the recipe max on 96 GiB). If A does not move, stop and report "external recipe does not forwardcontext". - A prompt just over
Ntokens is rejected at admission on A with the context error; a prompt just under is accepted and generates. This is the one assertion no runtime flag can satisfy. flare inspect Ashows the capped extent and its reproduction command re-exportsN.- Falsification control: an unaligned N (e.g. 130000 on a 256-token page) fails at planning with an actionable message, not at core load with Helios's opaque "invalid prepared model configuration" (
catalog.rs:50-57,70).
Phase 2 — the isolating VRAM comparison, at concurrency 1 and 4, for A and B, under both --kv-cache-limit memory (default) and --kv-cache-limit concurrency. The A/B × kv-limit pairing is what separates this export-time flag from the runtime flag. Under memory the delta may be ~0 — report that as the result, not as a failure.
Phase 3 — regression, same job. A pre-PR core still loads and serves unchanged; a no-flag export at this head yields the same preparation config as main (prepared_context returns recipe.context, exactly what bootstrap.py:132 passed before); --request-context still absent from flare run.
Budget and efficiency. 2 exports + ~6 serve starts on a single cn5 GPU ≈ 1–2 GPU-hours, one host, one model, one GPU. Skip cn7 (no ARM64-specific question). Skip multi-host (no second host — pin GPU-free in Phase 0). No throughput A/B — the PR claims memory and admission-ceiling behaviour, not speed; a perf sweep would burn time on a claim the PR does not make.
5. Bottom line for the referral decision
- Substantive architectural or quality problems that must be fixed before testing: none. The design is right and needs no rework — one optional field on the universal base, one accessor, one consumer line, no Helios change, no per-model branch, strict no-op when omitted.
- Two one-line reporting fixes worth landing first (
demand_pages, plan-JSON key) because they are the artifact the test reads; neither requires re-review. - Expected value of the hardware run: moderate, and concentrated in Phase 1. The VRAM headline is largely a runtime flag's behaviour; the admission ceiling and
max_model_lenare unique to this change and are worth 1–2 GPU-hours. - Order of operations: two one-liners → GPU-free suite green → one targeted job on a single cn5 GPU. If Phase 1 step 1 shows no movement, stop and report the external-recipe dependency rather than spending further hardware time.