#1 [high] PR #533 diff verified: what changes
PR #533 "Cap the per-request context target", author roobyz, head 1a006c6, base main, 7 files +35/-15. Supersedes closed PR #454 (CHANGES_REQUESTED by yatesdr).
Functional lines:
- ignition/preparation/bootstrap.py:58
"context": plan.prepared_context(wasplan.recipe.context) — the only load-bearing line;common_preparation_kwargsis the single funnel to BasePreparationConfig (bootstrap.py:33). - ignition/planning.py:368-373
Plan.prepared_context= recipe.context if context_target is None else min(recipe.context, context_target, self.tokens). - ignition/planning.py:176
context_target: int | None = Nonefield on frozen Plan. - ignition/planning.py:459-460 positivity check inside fit().
- ignition/planning.py:694-700 new 2-arm prefill-chunk error (prefill_chunk is None branch mentions --request-context).
- Plumbing: planning.py:453,535,591,674; cli/preparation.py:56,68; cli/serve.py:289,472; cli/bench.py:177; cli/init.py:167-170 flag in shared "capacity" group.
- docs/cli-design.md:446 (new flag row), :1443, :1493.
- NO tests added anywhere (verified: no reference to request_context/context_target/prepared_context under tests/).
Verified plan.context (planning.py:363-366) untouched = min(recipe.context, tokens).
#2 [high] PR 533 verified findings with citations
-
SERVE.PY MULTI-HOST DROP (blocking, confirmed): ignition/cli/serve.py:193-206
_export_hostscalls planning.plan(...) endingrow_shard_prefill=args.row_shard_prefill)— nocontext=args.request_context, while the other three sites pass it: serve.py:289 (_prepare), serve.py:472 (debug_serve), bench.py:177. Flag registered once in _preparation_arguments (cli/init.py:167-170) soexport --ranks 2 --request-context Nparses and is silently ignored -> plan.context_target stays None -> prepared_context returns recipe.context (planning.py:371-372) -> bootstrap.py:58 prepares full context. Violates charter "Don't silently ignore API fields" (#417). -
NOT RECORDED (blocking-ish, confirmed): Plan.to_dict (planning.py:389-442) emits "context": self.context (:430) + "checkpoint_context": self.recipe.context only — no context_target/prepared_context, so printed plan (serve.py:215, serve.py:485, bench.py:182) reports a context the core does not serve. reproduction_arguments (rebuild_manifest.py:231-318) never emits --request-context (compares --max-concurrency :257, --prefill-chunk-size :263, --row-shard-prefill :306). from_plan (rebuild_manifest.py:368-395) has SCOPE_DEPLOYMENT entries for prefill_chunk/max_concurrency/etc but none for request context. AGENTS.md:452-456 requires plan+printed report+recorded measurements describe what was prepared. Consequence: flare inspect reproduction command rebuilds an uncapped core (inspect.rs:453-455).
-
PAGE ALIGNMENT (blocking, confirmed): prepared_context -> BasePreparationConfig.context (bootstrap.py:33,58) -> server config "max_sequence_tokens" (helios/src/server/config.rs:131,148). helios/src/model/catalog.rs:44-71 rejects core unless BOTH prepared_sequence_tokens (:50-52) and limits.max_sequence_tokens (:54-57) are multiples of page_tokens -> "invalid prepared model configuration" (:70). Only validations added: positivity (planning.py:459-460) and prefill-chunk (planning.py:694-700). A target like 200000 with page 128 bakes an unloadable core. plan.page_tokens exists (planning.py:326-330) so it is validatable/roundable.
-
BENCH CHECK (should-fix, confirmed): Plan.post_init planning.py:248
if selection.required_context > self.context— self.context is stock min(recipe.context, tokens) (planning.py:363-366), untouched by PR. With a cap, a --contexts list above the cap passes planning and fails only in ignition/bench/runner.py:388 after full GPU prep/graph capture. -
NO TESTS (blocking for hardware referral): grep tests/ for request_context|context_target|prepared_context|request-context -> zero matches. AGENTS.md:194-199 requires tests exercising affected behaviour. Natural homes exist: tests/cli/test_planning.py:71-138 (row_shard_prefill precedent, checks to_dict + reproduction_args + manifest scope in one loop) and tests/cli/test_commands.py:59-98 (parser + common_preparation_kwargs/BasePreparationConfig).
-
VRAM CLAIM CONDITIONAL (doc/claim defect, confirmed in code): helios/src/runtime_core/memory.rs:284-331 page_ceiling returns Ok(None) for KvCacheLimit::Memory (default per docs/cli-design.md:738) — no ceiling from the prepared context; only Context/Concurrency modes compute ceil(context/page)*histories using server_config["max_sequence_tokens"] (memory.rs:631). Author's table used --kv-cache-limit concurrency. docs/cli-design.md:446 (added by PR) states the benefit unconditionally -> misleading for default flare run.
-
NO-OP PATH VERIFIED: prepared_context returns recipe.context when unset (planning.py:371-372), identical to previous bootstrap input plan.recipe.context, so existing cores/exports unchanged. Plan.context untouched; context_target default None keeps frozen-dataclass construction and dataclasses.replace working (serve.py:207-211, bench.py:178-181). 6b) Motivation = co-run/second model => charter non-goal "multi-model hosting/routing" (charter Non-Goals; AGENTS.md:171-175). PR reportedly carries Design-Signed-Off-By/design-review=1af4 (unverified). 7b) Cap clamped by plan.tokens (planning.py:373) so the baked max_sequence_tokens depends on the EXPORT HOST's free VRAM; cap above recipe max silently clamped (nit).
#3 [high] Decision: no hardware referral yet + conditional test plan
DECISION for PR 533: DO NOT refer to hardware testing. Return to author.
Reasons (all verified in-repo):
- Multi-host export drop (serve.py:193-206) produces a wrong artifact while reporting success. Cannot be hardware-tested on our fleet either (cn5 = 4 GPUs on ONE host; cn7 = 1 GB10;
--ranks > 1needs a second host + rendezvous). Must be fixed by a GPU-free unit test. - Non-page-aligned --request-context bakes an unloadable core (catalog.rs:44-71). Fix changes validation behaviour; testing before the fix only re-confirms a known bug.
- Cap absent from Plan.to_dict / reproduction_arguments / from_plan -> flare inspect reproduces an uncapped core; the artifact cannot be audited. Adding keys changes what a test would assert.
- Zero tests: grep tests/ has no reference to the flag/field/property. The PR's headline "omitting the flag is a no-op" is prose only. AGENTS.md:194-199.
- Headline VRAM benefit is conditional on --kv-cache-limit context|concurrency (memory.rs:284-291 memory=>Ok(None); docs/cli-design.md:738 default=memory). Our hardware would measure the runtime flag's behaviour, not this PR. The isolating A/B is author-side and is what the charter ("Bring real evidence", #210) requires.
- End-to-end reachability of the cap needs a recipe that maps BasePreparationConfig.context -> core max_sequence_tokens; recipes live in external local-inference-lab/hyperflare-recipes (AGENTS.md:379-384) and author says recipe updates are "pending". Testing would depend on unpublished artifacts.
- Motivation = co-run/second model = charter non-goal "multi-model hosting/routing" needing maintainer sign-off (charter Non-Goals; AGENTS.md:171-175).
Expected value if tested now: LOW. Would mostly confirm already-known defects, and any result would be invalidated by the pending fixes (alignment validation, manifest keys, one-line export plumbing).
Conditional plan AFTER fixes (for reuse): P0 (GPU-free, must pass first): pytest tests/cli/test_planning.py + test_commands.py with added cases — prepared_context unset==recipe.context; ==min(recipe.context,N,tokens); <=0 rejected; unaligned N rejected/rounded; chunk-vs-cap both arms; to_dict/reproduction_args/manifest scope; _export_hosts forwards context. P1 cn5 (RTX PRO 6000, SM120) GPU0, one model: export A (--request-context 131072) vs export B (stock). Then: /v1/models max_model_len A=131072 B=recipe max; prompt>N rejected at admission, prompt just under accepted; flare inspect shows cap + reproduction command reproduces it; nvidia-smi delta A vs B under BOTH default --kv-cache-limit memory and --kv-cache-limit concurrency (the pair isolates this PR from the runtime flag); unaligned N fails at planning. P2 regression: a pre-PR core still loads + one debug-serve with no flag matches main. Budget: ~2 exports + ~4 serve starts on cn5 ≈ 1-2 GPU-hours; skip cn7 unless ARM64 reasons appear. Skip: multi-host (no second host), and do not re-benchmark throughput (no perf claim in this PR).