Prose report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/a37c447e-6c8a-4cf6-87b0-46651081d522.md

Prose review — PR #533 "Cap the per-request context target"

Head reviewed: e623985 (base main; 8 files, +79/−10). Verdict: should-fix issues only. All three code-vs-description blockers from earlier rounds are fixed at this head (see "Resolved since the last review"); what remains is description ordering, a measured claim stated without its scope, one misdescribed Helios call, a docs row missing the promised consequence, and a test fixture that silently makes a planning test need FlashInfer.

Rules applied: AGENTS.md:72-140 (four required answers, in order; name components and material changes; attach scope and material limitations to a measured claim; distinguish expectation from measurement), docs/design-review.md:137-152 (principle 16, "Reject messages that leave these answers implicit, omit them, or present them out of order"), and the prose skill it points at. Everything below was read at this head. Nothing was executed: the head has no CI checks, so S5 is the only finding a test can settle.

Key findings

Blocking

None.

Should fix

S1. The description answers the four questions out of order, with the "why" buried in Evidence. AGENTS.md:74-80: "Every description must answer these four questions, in this order: why, what exactly changed, what benefit or result is claimed, and what evidence supports it." docs/design-review.md:141-150 repeats the order and adds "Reject messages that leave these answers implicit, omit them, or present them out of order." The body runs What Changed → Result → Evidence. The only causal explanation of why is the Workload sentence inside Evidence ("a memory-constrained deployment where the default per-request context (256K recipe max) over-provisions the KV pool, leaving insufficient VRAM for the desired concurrency"). A reviewer must therefore reach the last section to learn what problem is being solved. Fix: open with one or two sentences of why — the deployment cannot fit the desired concurrency at the 256K default, and the per-request context bounds the pool — then What Changed, then Result, then the table.

S2. The measured VRAM benefit is stated unconditionally, though it needs a non-default runtime flag. AGENTS.md:95-102 requires a measured improvement to be given "with its scope and material limitations attached" and to distinguish component from service results. The headline "At concurrency 4 the 131072 cap frees 16 GB vs the default" holds only under --kv-cache-limit concurrency: page_ceiling returns Ok(None) for KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:284-292), and memory is the documented default (docs/cli-design.md:740, semantics at :831-838). The flag appears only inside the evidence command line — never on the Result sentence, never on the docs row (docs/cli-design.md:468). Load-bearing detail behind this: the cap does not change export-time sizing at all. demand_pages still uses self.recipe.context (ignition/planning.py:319-321) and guaranteed_tokens too (ignition/planning.py:365-368); prepared_context (planning.py:357-363) affects only the prepared extent passed at ignition/preparation/bootstrap.py:132. So the saving is the core's smaller max_sequence_tokens meeting a runtime page bound — an interaction with a runtime flag, not a property of the cap alone. Fix: attach the condition to the Result sentence and to docs/cli-design.md:468 ("with --kv-cache-limit context|concurrency; under the default memory mode the pool is sized by free memory and the cap only lowers the per-request ceiling"), and say the table was measured with the runtime flag.

S3. The description's mechanism sentence names the wrong operands. Description: "at serve time Helios's fit_context applies min(context, prepared_context), so a cap above the pool still shrinks the export artifact without changing the serve-time pool bound." ModelConfig::fit_context is self.limits.max_sequence_tokens = self.prepared_sequence_tokens.min((pages − draft_pages) × page_tokens) (helios/src/model.rs:261-273). It takes the minimum of the prepared extent and the physical page pool; neither prepared_context nor Plan.context (min(recipe.context, tokens), ignition/planning.py:352-355) is an operand of that minimum. Fix: "at serve time fit_context narrows max_sequence_tokens from the prepared extent to the physical page pool, so the cap sets an export-time ceiling and never raises the runtime bound."

S4. The docs row omits the operational consequence the description promises. docs/cli-design.md:468 records the cap ("Cap the prepared per-request context and max_sequence_tokens at N tokens; resolves to the smaller of N and the recipe maximum") but not that a request above it is rejected. The description states "a request that would exceed the cap is rejected", and Helios does reject at admission (prompt over max_sequence_tokens, helios/src/server/request.rs:349-355; helios/src/model/admission.rs:150-158 (not opened)). The adjacent --prefill-chunk-size row (:467) carries its consequence, so this row should too. Fix: "… so a request whose prompt plus requested output exceeds N is rejected at admission."

S5. The new test accepts monkeypatch and never uses it, so a pure planning test needs FlashInfer. tests/cli/test_planning.py:295 defines test_request_context_target_prepared_context_and_manifest(monkeypatch), but the body never calls monkeypatch. Its three siblings do stub the identity (monkeypatch.setattr("ignition.preparation.source_identity.source_identity", lambda: "test-source") at :159, :223, :333). The new test calls rebuild_manifest.from_plan (:323), which calls source_identity() (ignition/preparation/rebuild_manifest.py:327); that imports flare_heliopause and raises RuntimeError("the preparation environment requires FlashInfer") when it is absent (ignition/preparation/source_identity.py:35-41). Fix: add the same stub line as the siblings — the unused fixture is the tell that it was meant to be there. Settled by: pytest tests/cli/test_planning.py -k request_context on a host without FlashInfer.

Nits

  1. ignition/parameters.py:1319 — the help string names an internal quantity and omits the real floor. "must be a multiple of the page token count" has no antecedent in MODEL --help (the page size is only shown in the epilog, ignition/cli/help.py:46), and it states a rule enforced only below the recipe maximum (ignition/planning.py:186-190). Say "page size", and note the floor: a cap below --prefill-chunk-size is now rejected by ignition/planning.py:594-597, so lowering the cap that far also needs a smaller chunk.
  2. ignition/cli/help.py:46 — "--request-context can lower this" states no floor, so a user learns about the chunk bound only from the failure.
  3. docs/cli-design.md:468 — verbatim repetition. "a core's catalog is fixed at export, so changing it requires re-export" is copied from the --mixed-prefill row at :469, which sits immediately below; true, but redundant on adjacent rows.
  4. Three spellings of one quantity. docs/cli-design.md:468 and :1436 say "the recipe maximum context" (both new text from this PR), :1486 says "the prepared context ceiling", and the row this PR replaced said "checkpoint maximum". All three mean Recipe.context (ignition/declaration.py:176 (not opened)). Pick one — "the recipe's maximum context" — and use it in both new lines.
  5. docs/preparation-development.md:17-20 — a stranded list item. The added context_target pushes lock_gpu_clocks, onto a line of its own (:19) inside a prose list; reflow so the bullet reads as two full lines.
  6. Description table units. Headers read "192k"/"128k" while the command records 196608/131072; state once that 128k = 131,072 tokens so the package cannot be built two ways.
  7. Description table metric undefined. "Total VRAM (GB)" does not say per-GPU or process-wide, nor whether it is nvidia-smi total or allocator reserved, so the table cannot be reproduced from the text as written.
  8. ignition/parameters.py:1318 — the printed plan reports the requested cap, not the served one. status_label=lambda v: f"request context {v:,} tokens" if v else None is called with the raw field value (getattr(self, dc_field.name), ignition/parameters.py:1555-1560), so --request-context 500000 on a 262,144-token recipe prints "request context 500,000 tokens" while Plan.prepared_context clamps to 262,144 (ignition/planning.py:357-363) and no cap is in effect. The Select GPUs. line (built at ignition/cli/serve.py:270-274) is meant to describe what will be prepared. status_parts receives the ParameterContext, whose recipe is available, so the label can clamp: min(context.recipe.context, v) when context.recipe is set. Low impact — only caps above the recipe maximum.

Resolved since the last review — do not re-raise

Verified in the code at e623985; earlier rounds raised these as blockers:

  1. Above-maximum caps clamp instead of failing. context_target declares only min_value=1 (ignition/parameters.py:1309-1320; the previous max_fn=_recipe_context_limit is gone), and Plan.prepared_context returns min(self.recipe.context, target) (ignition/planning.py:357-363). tests/cli/test_planning.py:310-313 (cap 500000 → recipe max) passes by reading; the alignment check is correctly gated on target <= self.recipe.context (planning.py:186-190), so a no-op cap need not be page-aligned.
  2. --request-context reaches the reproduction command. if self.context_target is not None: args.extend(["--request-context", str(self.context_target)]) (ignition/parameters.py:1484-1485), so tests/cli/test_planning.py:324-325 hold and the description's "reproduction arg" claim is true — the base-class skip at :1492-1496 is compensated explicitly.
  3. The prefill-chunk guard uses the served extent. effective = min(result.context, result.prepared_context) (ignition/planning.py:594-597), matching Helios's load-time prefill_chunk_size <= max_sequence_tokens; a cap below the chunk is rejected at export rather than at flare run, as the description says.
  4. status_label exists (parameters.py:1318), context_hint is guarded on plan.prepared_context < recipe.context (ignition/cli/serve.py:68-70), max_body_bytes uses plan.prepared_context (:67), help.py:46 names the new flag, and both closed field enumerations include it (docs/cli-design.md:449, docs/preparation-development.md:18).

Checked and clean (for completeness)

Open questions and what could not be settled