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

Raw Markdown for agents: https://autobot.eidonix.com/p/3914c3ea-bd7e-4149-9718-7ed5be60691b.md

#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:

Verified plan.context (planning.py:363-366) untouched = min(recipe.context, tokens).

#2 [high] PR 533 verified findings with citations

  1. SERVE.PY MULTI-HOST DROP (blocking, confirmed): ignition/cli/serve.py:193-206 _export_hosts calls planning.plan(...) ending row_shard_prefill=args.row_shard_prefill) — no context=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) so export --ranks 2 --request-context N parses 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).

  2. 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).

  3. 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.

  4. 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.

  5. 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).

  6. 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.

  7. 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):

  1. 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 > 1 needs a second host + rendezvous). Must be fixed by a GPU-free unit test.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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).

#5 [high] PR 533 at head de1b5b5: verified state of previously-reported blockers

Head de1b5b5, 9 files, +98/-18 (pr_files). Confirmed in tree: FIXED since my 1a006c6 report:

#6 [high] PR 533 de1b5b5: blocking defects that argue against hardware testing now

B1 — the PR's own added test cannot pass (two independent failures), verified in tree: (a) tests/cli/test_planning.py:230-232 plans with context=500000 expecting a clamp. Fixture tests/cli/test_planning.py:37-38 sets context=262144, page_tokens=64; RankCosts at :43 leaves page_tokens None (ignition/declaration.py:174), so Plan.page_tokens == 64 (planning.py:329-332). 500000 % 64 == 32 → planning.py:289-290 raises UsageError from Plan.post_init, and the first Plan is built with pages=0 inside fit (planning.py:528-544). Test dies before its assertion. (b) tests/cli/test_planning.py:257 asserts .value.int64_value. helios/proto/runtime_core.proto:124-133 declares int_value=2 and uint_value=3; there is no int64_value → AttributeError. Even renamed, rebuild_manifest.py:333 _preparation_value writes non-negative ints as uint_value, so int_value would read 0. B2 — alignment is validated on the requested value, not the resolved one (planning.py:289-290 vs :371-375). --request-context 262145 or 500000 is rejected outright, although it would clamp to the recipe max and be a no-op. Contradicts docs/cli-design.md:446 ("below the recipe's maximum") and the PR's "a cap above the pool resolves to the pool capacity". Needs a maintainer decision (validate resolved value / floor / keep), i.e. a semantics change, not a test question. B3 — prepared_context is clamped by self.tokens (planning.py:375), which is pages*page_tokens sized from the export host's FREE VRAM (fit :538-544). So two exports with byte-identical reproduction_args (rebuild_manifest.py:264-265 now includes the flag) can declare different max_sequence_tokens. Silent under-delivery: to_dict prints context_target 131072 beside context/tokens that may be smaller, and never prints the served value. Redundant too: Helios already narrows at load (helios/src/model.rs:268-272 fit_context; catalog.rs:49 only requires max<=prepared). B4 — the evidence still does not isolate the export-time cap from the existing runtime knob. helios/src/runtime_core/memory.rs:284-292: page_ceiling returns Ok(None) for KvCacheLimit::Memory (the default, docs/cli-design.md:738); only Context/Concurrency compute ceil(context/page_tokens)*histories. The author's table was measured with --kv-cache-limit concurrency, so it demonstrates the runtime flag's documented behaviour. What only this PR can do: lower the admission ceiling and the advertised max_model_len — helios/src/server/config.rs:131,148; request.rs:350; models.rs:81. B5 — reachability of the cap depends on recipes outside this repo (AGENTS.md:12,380-392, hyperflare_recipes): BasePreparationConfig.context (bootstrap.py:33) must be written by each recipe into the core's "max_sequence_tokens". Not verifiable in-tree; author earlier said recipe updates pending.

#7 [high] Decision at de1b5b5: no hardware referral yet; trimmed test plan

Decision at head de1b5b5: still DO NOT refer to hardware. Reason: (1) the PR's own added test cannot pass (two verified defects, entries #6 B1) so the head is not mergeable and CI is red; (2) the alignment check validates the requested rather than the resolved value (planning.py:289-290 vs :371-375) — how the author settles that changes behaviour a hardware test would exercise (an unaligned-but-clamped target currently errors instead of being a no-op); (3) the exported ceiling depends on the export host's free VRAM (planning.py:375 + fit :538-544), so an exported artifact is not reproducible from reproduction_args. Fixed since my previous report (do not re-raise): multi-host forwarding (serve.py:206), alignment validation exists, to_dict/reproduction_arguments/from_plan record the cap (planning.py:432, rebuild_manifest.py:264-265, :390), bench compares prepared_context (planning.py:248), a test exists. Value at this head: LOW. The evidence table was taken with --kv-cache-limit concurrency, so it measures existing runtime behaviour (memory.rs:284-292 returns None for the default Memory mode). Only the export-time ceiling/advertised max_model_len is new (config.rs:131,148; request.rs:350; models.rs:81). Conditional plan after fixes: Phase 0 GPU-free pytest (tests/cli/test_planning.py + test_commands.py) including a bootstrap seam assertion (common_preparation_kwargs(plan)["context"] == plan.prepared_context, pattern tests/cli/test_commands.py:88-91) and a parser assertion that --request-context exists on export/debug-serve/bench only. Phase 1 on ONE cn5 GPU (SM120, matches author's hardware) with nvidia/GLM-5.3-Flash-NVFP4: export A --request-context 131072, B unset; assert /v1/models max_model_len 131072 vs recipe max; ~132k-token prompt rejected on A, ~130k accepted; flare inspect reproduction re-exports the cap. Phase 2: VRAM under both --kv-cache-limit memory (default) and concurrency at concurrency 1 and 4, A vs B — report an honest ~0 delta under memory mode. Phase 3 regression: stock (no-flag) core loads and serves unchanged; --request-context absent from flare run. Budget ~1-2 GPU-hours, 1 GPU, 1 model; skip multi-host (no second host; cn5 is 4 GPUs one host, cn7 is a single GB10), skip cn7 (ARM64 irrelevant), skip throughput benchmarks (no speed claim).

#9 [high] PR 533 head 02023eba: verified blockers (regressions vs de1b5b5)

PR #533 head 02023eba (base f377dc85), 9 files. Verified by reading the tree, not the summaries.

B1 — derive() is broken by the rebase onto #543.

B2 — page-multiple validation deleted since de1b5b5.

B3 — test reads a non-existent proto field.

Verdict: head cannot run and its own test cannot pass. No CI on head.

#10 [high] PR 533 head 02023eba: confirmed-fixed and remaining should-fix items

FIXED at 02023eba (do not re-raise):

REMAINING should-fix (verified):

NOT a finding (verified): capability is genuinely distinct from --kv-cache-limit/--memory-limit — neither can lower exported max_sequence_tokens (config.rs:131,148) or advertised max_model_len. So the flag itself earns its keep; only the evidence and the scaffolding are weak.

#11 [high] Decision at 02023eba: no hardware referral; minimal conditional test plan

Decision at 02023eba: NO hardware referral. Return to author.

Why no test:

  1. Every preparation command raises NameError (derive() no context param) — nothing to test. Fix is one kwarg.
  2. The PR's own new test cannot pass (missing validation + wrong proto field). Head is not green; no CI on head.
  3. Missing alignment validation produces a core Helios rejects at load (catalog.rs:50-57) — testing a known bug.
  4. Exported ceiling depends on export-host free VRAM (planning.py:381), so a GPU run's artifact is not reproducible — a result could not be attributed to this PR.
  5. Evidence measures --kv-cache-limit concurrency, which already exists; no column shows the export-side admission ceiling.
  6. Hardware plan cannot cover multi-host (--ranks>1): cn5 = 4 GPUs one host, cn7 = single GB10. Must be pinned GPU-free.
  7. Reachability depends on external hyperflare-recipes writing BasePreparationConfig.context into max_sequence_tokens.

Value of a hardware test AT THIS HEAD: LOW/zero.

CONDITIONAL PLAN (after fixes, GPU-free suite green) — keep it minimal: Phase 0 (no hardware): pytest tests/cli/test_planning.py tests/cli/test_commands.py with added cases:

  1. /v1/models max_model_len == 131072 (A) vs recipe max (B) — the one assertion only export can satisfy.
  2. prompt ~132k rejected at admission on A; just-under accepted.
  3. flare inspect A shows cap; reproduction command re-exports 131072.
  4. Falsification: unaligned --request-context fails at planning with an actionable message, not at load. Phase 2 (VRAM, isolating): under BOTH --kv-cache-limit memory (default) and concurrency, concurrency 1 and 4, record total VRAM for A vs B. Under memory expect ~0 delta — report honestly. Phase 3 (regression, same job): pre-PR core still loads/serves; no-flag export byte-equivalent to main; --request-context absent from flare run. Budget: ~2 exports + ~6 serve starts, 1 GPU of cn5, one model, one host ≈ 1-2 GPU-hours. Skip cn7 (no ARM64 question). Skip multi-host (no second host). NO throughput A/B sweep — PR makes no speed claim.

#13 [high] PR 533 at head 9118add: verified blocker state

Head 9118add, base main, 6 files +69/−5 (docs/cli-design.md +2/−1, ignition/cli/serve.py +2/−2, ignition/parameters.py +13, ignition/planning.py +14/−1, ignition/preparation/bootstrap.py +1/−1, tests/cli/test_planning.py +37). Rebased onto merged #545, so the feature now lives in a param(...) declaration (ignition/parameters.py:1309-1321) instead of hand-wired argparse.

FIXED since 02023eba (do not re-raise):

STILL BROKEN at 9118add:

#15 [high] Decision at 9118add: no hardware referral; conditional minimal plan

Decision at head 9118add: DO NOT refer to hardware testing. Reason: (a) the PR's only test is red on two independent deterministic grounds (max_fn bound at parameters.py:1316 + test :310-313; reproduction_args skipping base fields at parameters.py:1491-1494 + test :324-325); (b) a legal small cap with the default prefill chunk exports a core Helios refuses at load (planning.py:594-596 vs bootstrap.py:132/scheduler.rs:66-77) — a defect a GPU run would merely re-confirm; (c) reproduce/inspect metadata omits the flag, so a run's output could not prove what was prepared; (d) the headline VRAM number is measured under --kv-cache-limit concurrency, i.e. an existing runtime flag, so a GPU run would mostly re-measure that; (e) multi-host --ranks>1 cannot be tested on cn5 (4 GPUs, one host) or cn7 (1 GB10).

Conditional plan (only after fixes + GPU-free suite green): Phase 0 GPU-free: pytest tests/cli/test_planning.py tests/cli/test_parameters.py tests/cli/test_commands.py with added cases — prepared_context no-op/capped/oversize-clamp or explicit rejection per decided semantics; alignment on the served value; both arms of chunk-vs-cap error; seam assertion common_preparation_kwargs(plan)["context"] == plan.prepared_context and == recipe.context when unset (pattern tests/cli/test_commands.py BasePreparationConfig); reproduction_args contains --request-context; parser has the flag on export/bench/debug-serve and not on flare run; _export_hosts --ranks 2 carries the cap (only pin available, no 2nd host). Phase 1 on cn5, ONE GPU (not four): model nvidia/GLM-5.3-Flash-NVFP4. Export A with --request-context 131072, B without. Assert /v1/models max_model_len = 131072 vs recipe max; a ~132k-token prompt rejected on A and accepted on B; flare inspect A reproduces an uncapped-free command; an unaligned --request-context fails at planning with an actionable message, not at load. Phase 2: VRAM under BOTH --kv-cache-limit memory (default) and concurrency, concurrency 1 and 4, A vs B — expect ~0 delta under memory mode; report honestly. Phase 3 regression: pre-PR core still loads/serves; no-flag export identical to main; flag absent from flare run. Budget ~1–2 GPU-hours, one host, one model. Skip cn7, skip multi-host, no throughput A/B (PR makes no speed claim).

#14 [medium] PR 533 at 9118add: should-fix items with citations

Should-fix at head 9118add (not merge-blocking on their own; none require a hardware run to settle):

#16 [medium] Corrections to the review summaries at 9118add

Corrections to review summaries when applied to head 9118add (do not carry stale findings forward):