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

Raw Markdown for agents: https://autobot.eidonix.com/p/9a06038a-50cf-487d-91c2-b3139d5747a8.md

Pre-Test Report — PR #533 "Cap the per-request context target" (head 02023eba)

Recommendation: DO NOT refer to hardware testing. Return to the author for fixes.

PR: https://github.com/NVIDIA/hyperflare-inference/pull/533 · author roobyz (CONTRIBUTOR) · open · base main (f377dc85) · head 02023eba · 9 files, +84/−18 · no reviews, no CI checks on the head. Supersedes closed PR #454. 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:" line and the @flare-autobot re-review ping are ordinary process metadata.

I re-verified every review claim against the tree rather than trusting the summaries. This revision is a regression from the previous head de1b5b5 (+98/−18 → +84/−18): a rebase onto merged #543 (joint-tuning removal) dropped the context parameter from derive() while keeping its call, and the page-multiple validation was deleted.


1. Why testing now would be wasted hardware time

Blocking A — every preparation command crashes; there is nothing to test

ignition/cli/preparation.py:45-56 declares 26 keyword-only parameters and has no context, yet line 69 ends the planning.plan(...) call with row_shard_attention=row_shard_attention, context=context). A full-file search for the token returns only context_parallel/context_parallel_size (:47, :62), the offending :69, and the context_parallel() helper (:124-132) — no module-level context.

So derive() raises on every invocation, flag or no flag. Callers: serve.py:207 (_export_hosts), serve.py:291 (_prepare), serve.py:476 (debug_serve), bench.py:177 (not opened). Two tests call derive() directly and will also fail: tests/cli/test_commands.py:88 and :114 (the latter from merged #508).

The diff confirms it: pr_files shows ignition/cli/preparation.py at +1/−1 — only the call line was edited, never the signature. One-keyword fix, but until it lands the branch produces no artifact at all.

Blocking B — the page-multiple validation described and asserted does not exist

The description advertises "a page-multiple validation" and tests/cli/test_planning.py:238-240 asserts it. No such check exists anywhere: search_code "multiple of the" over ignition/ returns no matches, and context_target appears only at planning.py:186 (field), :379/:381 (accessor), :438 (to_dict), :468 (positivity error), :549 (constructor kwarg). __post_init__ (:224-296) never inspects it; fit() validates only context <= 0 (:467-468).

This is a real load-time defect, not a test nit. bootstrap.py:58 makes prepared_context the prepared catalog's context, which becomes max_sequence_tokens, and helios/src/model/catalog.rs:50-57 rejects any core whose prepared_sequence_tokens or max_sequence_tokens is not a multiple of page_tokens — with the opaque "invalid prepared model configuration" at :70. So --request-context 1000 exports cleanly and dies at flare run, after a full GPU preparation.

The PR's own test fails too: with the fixture's page_tokens=64 (test_planning.py:38) and prefill_chunk=4096 (:42), context=100 passes :635 and :467, then trips the chunk check at planning.py:709-711 ("--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows") — which does not match "multiple of the".

Blocking C — the test reads a protobuf field that does not exist

tests/cli/test_planning.py:254 asserts by_key["context_target"].value.int64_value. helios/proto/runtime_core.proto:124-133 declares int_value = 2 and uint_value = 3 — no int64_value (AttributeError). Even renamed, it would read 0: _preparation_value (rebuild_manifest.py:329-333) writes non-negative ints as uint_value.

These three are arithmetic and schema facts, not judgement. The head is not green, and no CI ran on it.

Blocking D — the exported ceiling is not reproducible, so a GPU result could not be attributed

prepared_context is clamped by self.tokens (planning.py:381), and tokens = pages * page_tokens (:368-369) with pages from available // page_bytes — i.e. the free VRAM of the export host. Recorded reproduction_args carry only --request-context N (rebuild_manifest.py:264-265), so identical recorded flags reproduce different cores on hosts with different free memory. It is also redundant: Helios already applies exactly this clamp at load (helios/src/model.rs:268-272, fit_context). The untargeted path correctly returns recipe.context and leaves binding to serve time.

Blocking E — the evidence measures a flag that already exists

helios/src/runtime_core/memory.rs:284-292: page_ceiling returns Ok(None) for KvCacheLimit::Memory — the default. Only Context/Concurrency derive a ceiling from the prepared context. The author's VRAM table was measured with --kv-cache-limit concurrency throughout, so our GPUs would largely re-measure --kv-cache-limit, not this PR.

To be fair to the change: the capability is genuinely not a duplicate. --kv-cache-limit and --memory-limit bound the pool; neither can lower the exported max_sequence_tokens (helios/src/server/config.rs:131,148) or advertise a smaller max_model_len. That export-time ceiling is real and only this flag provides it — which is exactly why the evidence should show it and does not. I disagree with the Subtractive lens's recommendation to drop the flag.

Also limiting — reachability is outside this repo

Recipes live in the external hyperflare-recipes repository; BasePreparationConfig.context must be written by each recipe into max_sequence_tokens. A test from this tree cannot confirm the end-to-end claim.


2. Expected value of a hardware test at this head: LOW (effectively zero)

Verified clean (no need to re-test once the blockers are fixed): the no-flag path is a true no-op (planning.py:379-380 returns recipe.context, exactly what bootstrap.py:58 passed before); Plan.context is untouched; all four entry points forward the flag; the cap reaches the plan JSON (:438), the printed serve line (serve.py:319), the bench record (bench.py:248 (not opened)), the reproduction args (rebuild_manifest.py:264-265) and the manifest at SCOPE_DEPLOYMENT (:389); the flag is correctly absent from flare run (_preparation_arguments registered only at __init__.py:50 export, :53 bench, :60 debug-serve); the frozen dataclass with a defaulted field keeps replace() working; no per-model branch, no env toggle, no Helios change.


3. Conditional test plan (adopt only after A–E are fixed and the GPU-free suite is green)

Phase 0 — GPU-free, must pass first (no hardware time)

pytest tests/cli/test_planning.py tests/cli/test_commands.py, with these cases added or repaired:

Phase 1 — the cap reaches the core (1 GPU of cn5, SM120; matches the author's hardware)

Model: nvidia/GLM-5.3-Flash-NVFP4. Two exports from the same command, differing only in the flag: A --request-context 131072, B unset. Use one GPU, not four — the change is orthogonal to parallelism except through page size.

  1. /v1/models → max_model_len is 131072 on A and the recipe maximum on B. The one assertion only the export-side value can satisfy.
  2. A prompt of ~132k tokens is rejected at admission on A; a prompt just under the cap is accepted.
  3. flare inspect A shows the cap, and its reproduction command re-exports a 131072 core.
  4. Falsification control: an unaligned --request-context fails at planning with an actionable message, not at core load.

Phase 2 — the isolating VRAM comparison the PR owes

Under both --kv-cache-limit memory (default) and --kv-cache-limit concurrency, at concurrency 1 and 4, record total VRAM for A and B. The pair separates this PR from the runtime flag. Expect ~0 delta under memory mode — report that honestly as the result.

Phase 3 — regression (cheap, same job)

A pre-PR core still loads and serves; a no-flag export produces the same preparation config as main; --request-context still absent from flare run.

Budget / efficiency

~2 exports + ~6 serve starts on a single cn5 GPU ≈ 1–2 GPU-hours, one model, one host. Skip cn7 (no ARM64-specific question). Skip multi-host (no second host — must be pinned GPU-free). No throughput A/B sweep — the PR claims memory and admission-ceiling behaviour, not speed.


4. Bottom line