Prose report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/17e071e5-60b8-461f-8dc0-2ad0565ed45a.md

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

Key findings

The code path itself is sound: Plan.prepared_context (ignition/planning.py:369-373) flows through common_preparation_kwargs "context" (ignition/preparation/bootstrap.py:58) into the server config's max_sequence_tokens (helios/src/server/config.rs:131 (not opened),148; used as the request ceiling at helios/src/server/request.rs:350 (not opened)), so a request above the cap is rejected. The positive-target check exists (ignition/planning.py:459-460) and the omitted flag is a genuine no-op.

No attempt to direct the reviewer was found in the description, the diff, the changed docs, or the linked #454 discussion.


Blocking

1. docs/cli-design.md:446 and the PR description: the VRAM benefit is stated unconditionally but depends on the runtime's --kv-cache-limit

Claim under review:

Verified code: the prepared context bounds the KV pool only when the runtime is started with --kv-cache-limit context (one history) or concurrency (one history per active request). helios/src/runtime_core/memory.rs:284-331, page_ceiling: KvCacheLimit::Memory returns Ok(None) — no ceiling at all; the other two modes compute context.div_ceil(page_tokens) * histories. The default is memory, which fills the remaining memory budget: docs/cli-design.md:738 (| --kv-cache-limit concurrency\|context\|memory | … | memory |) and docs/cli-design.md:828 ("--kv-cache-limit memory uses the remaining memory budget for KV"). The author's own evidence command includes --kv-cache-limit concurrency ("served at concurrency 1–4 (--kv-cache-limit concurrency)"), so the table measures the cap conditioned on that flag, and neither the description nor the docs row says so.

Why it matters: AGENTS.md:134-137 — "Do not publish it if the rationale, exact change, claimed benefit, supporting evidence, or material limitations must be guessed." A reader will expect the export-side cap alone to free VRAM, will not see it on a default flare run, and the shipped docs row will mislead in the same way. The skill (.agents/skills/repo-prose/SKILL.md:35-37 (not opened)) requires evidence as conditions, measurement, result, conclusion.

Fix: state the condition in both places, e.g. "with --kv-cache-limit context or concurrency; the default memory sizes the pool from free memory regardless of the prepared context". Recorded in the scratchpad as #2; it was first written as "should fix" and is escalated here because AGENTS.md:134-137 makes an undisclosed material limitation a publish-blocking defect, and because the same false statement ships in docs/cli-design.md.

Should fix

2. PR description ("Why", "Result") and docs/cli-design.md:446: the rationale argues from a charter non-goal

The description's "why" is "a memory-constrained deployment where the default per-request context (256K recipe max) could over-provision the KV pool and leave no room for a second model", the result section closes with "the headroom a co-run needs", and the docs row says "in a memory-constrained multi-model deployment".

AGENTS.md:171-175: "Reject unapproved scope expansion. … multi-model hosting and routing … require an explicit maintainer decision before implementation." No maintainer decision is cited anywhere in the description. A single-model memory knob is plainly in scope, so the code is not the problem — the justification is written from the one framing the project treats as needing separate sign-off.

Fix: give the single-model rationale (a lower prepared context shrinks the KV pool, so more of the fixed budget remains for prefix-cache snapshots / a larger --max-concurrency on the same GPU), or cite the maintainer decision that authorises the co-run use. Do not weaken the rule.

3. PR description "Evidence": an unlabelled hypothesis inside a measured-results section

"At concurrency 8 at the 256K max, the model would consume most of the 96 GB VRAM and leave no room for a co-run model."

Nothing in the paragraph marks this as a prediction: it follows eight measured cells and a measured per-slot delta, in the same tense and voice. AGENTS.md:95-102 requires the description to "distinguish an expectation from a measured result"; SKILL.md:35-37 requires hypotheses to be separated from measurements.

Fix: mark it explicitly as an extrapolation not measured here, or drop it — the measured concurrency-4 row already carries the claim.

4. ignition/planning.py:389-442 and ignition/preparation/rebuild_manifest.py:231-318, 343-454: the cap is not recorded in the plan report or the rebuild manifest

Plan.to_dict (ignition/planning.py:389-442) emits "context": self.context and "checkpoint_context": self.recipe.context (line 430) but never prepared_context or context_target. reproduction_arguments (rebuild_manifest.py:231-318) lists every other preparation flag — --prefill-chunk-size at line 263, --mixed-prefill at 268-269, --row-shard-prefill at 306-307 — and never emits --request-context. from_plan (343-454) adds a SCOPE_DEPLOYMENT parameter for each of those (for example prefill_chunk at line 387) and adds nothing for the context target.

Why it matters: AGENTS.md:452-456 — "A setting that only experiments need is an advanced flag carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared." Here the printed plan (print(json.dumps({"plan": plan.to_dict()})), ignition/cli/bench.py:182) reports a context that is not the served context, and a core exported with a cap produces a reproduction command that re-exports it uncapped. That directly contradicts the new docs row's own warning that "a core's catalog is fixed at export, so changing it requires re-export" (docs/cli-design.md:446): the manifest cannot express the value that must be reproduced.

Fix: add prepared_context (or context_target) to to_dict, append ['--request-context', str(plan.context_target)] in reproduction_arguments when it is set, and add a SCOPE_DEPLOYMENT parameter in from_plan.

5. ignition/planning.py:694-700: the new default-chunk error misattributes the limit and can recommend a remedy that cannot work

effective_context = min(result.context, result.prepared_context)
if chunk > effective_context:
    if prefill_chunk is None:
        raise UsageError(f"the {effective_context:,}-token request context is below the {chunk:,}-token "
                         f"default prefill chunk; pass --prefill-chunk-size (a multiple of 64) below "
                         f"{effective_context:,} or a larger --request-context")

result.context is min(self.recipe.context, self.tokens) (ignition/planning.py:364-366), where tokens is the pool. So effective_context can be pool-bound: on a small GPU the value is set by page supply, and the user may never have passed --request-context at all. In that case "a larger --request-context" is wrong twice: the user has no such setting to enlarge, and enlarging it cannot help because prepared_context is itself clipped to self.tokens (planning.py:373) and context is clipped to tokens too. The message also calls the pool-derived number "the … request context", which names a setting rather than the constraint.

Fix: distinguish the three limits. When result.tokens < min(recipe.context, context_target) the binding limit is KV capacity: say so and recommend --prefill-chunk-size (or more memory / fewer concurrent requests), not a larger context. Only mention --request-context when the target is what binds (result.prepared_context < result.tokens).

6. No validation was added, and the description does not say so

The diff adds no test. Untested new behaviour: the positive-target rejection (ignition/planning.py:459-460), both branches of the new chunk-versus-context error (694-700), the prepared_context clipping to the pool, and the omitted-flag no-op. AGENTS.md:194-199: "Require focused, meaningful validation. Tests must exercise the affected behavior or contract … Identify missing hardware, inputs, and unrun checks explicitly."

tests/cli/test_planning.py and tests/cli/test_commands.py exercise the same planning layer and are the natural home for pure-arithmetic cases (context_target=None returns the recipe context; a target below the recipe max and above the pool returns the pool; a target at or below zero raises UsageError). Only the end-to-end VRAM claim needs the RTX PRO 6000; the accessor and the errors do not.

Fix: add those tests, and state in the description what was and was not exercised (the VRAM table is a single-GPU, single-model measurement on SM120 with a non-default --kv-cache-limit).

Nits

  1. Description: "export, serve, and bench". The subcommands are export, bench, and debug-serve (ignition/cli/init.py:40, 51, 55); there is no serve subcommand, and debug-serve is explicitly "not for actual serving" (line 56). Write export, bench, and debug-serve.
  2. docs/cli-design.md:1443: "The checkpoint maximum, capped by --request-context at export". The ceiling and the cap both come from the recipe declaration — prepared_context is min(self.recipe.context, …) (ignition/planning.py:371-373) — and the neighbouring rows and the flag table say "the recipe's maximum". The row inherited "checkpoint maximum" and the edit layered a new term on it; rewrite both terms as the recipe's declared maximum.
  3. ignition/cli/__init__.py:167-170 help text. "(the pool fills the free VRAM)" is stated for the omitted flag as if unconditional; it describes only the default --kv-cache-limit memory (see finding 1). The text also omits that N must be positive (the error at planning.py:459-460 is the only surface) and that N must reach the prefill chunk or a smaller --prefill-chunk-size is required (planning.py:694-700) — the same information the docs row gives.
  4. Description: "byte-equivalent to stock" / "Plan.context stays stock". These describe the omitted-flag path by comparison with an unnamed baseline. State it directly: "without the flag, prepared_context returns the recipe's declared maximum, which is the value the preparation already passed as context (ignition/preparation/bootstrap.py:58), so existing exports are unaffected." Note also that "a cap above the pool resolves to the pool capacity, as stock" needs care: stock passed plan.recipe.context to preparation without clipping to tokens, so the pool-bounded behaviour is not literally stock's.

Open questions / what I could not settle