Hardware test plan — PR #615 helios: support thinking_token_budget for ContentHeaders (head 7dde009)
Bottom line
Run a narrow, ~2-hour, single-core non-regression plan — do not plan a speedup measurement, because there is no speedup claim to measure. PR #615 is a correctness/enhancement change (it makes a documented API field work on ContentHeaders cores and repairs a cut-boundary UTF-8 prompt). Triage applied performance at 65 %, but nothing in the PR claims a latency or throughput win, and at head 7dde009 the UTF-8 trim is O(1) (Frontend::token_bytes() lookups over ≤8 tokens, helios/src/server/runtime.rs:417-461, 2160-2162) with no decode() calls left — it is too small to measure against GPU noise. The only performance-shaped thing to check is a startup regression, not a speedup.
And one hard limit on scope: neither machine has an Inkling 2 checkpoint, so the headline behaviour of this PR cannot be exercised on our hardware. ContentHeaders (ReasoningParserKind::ContentHeaders, helios/src/model/contract.rs:68, 907) exists only for Inkling 2 Mini/Small (docs/model-preparation.md:324). cn5/cn7 carry GLM-5.3 and Qwen3.8, whose contracts are ThinkTags (helios/tests/support/contracts/glm53.json:24-30, qwen38.json:29-37) — they take the pre-existing OutputStart::Reasoning budget path (helios/src/server/request.rs:549-551). The <|message_model|><|content_text|> injection and the 1→3 injected-token accounting are unreachable there.
That splits the work cleanly:
- the real-tokenizer proof for the new request-preparation logic is CPU-only and free (Stage 0) — run it first;
- the GPU time buys proof that the shared hot path (
Worker::publish/Worker::park, used by every format) still behaves exactly likemainon formats we can serve.
If Stage 0 passes and Stage 1/2 show byte-identical behaviour, GPU evidence is complete for what is testable. If Stage 1 diverges, stop and report — the PR touches helios/src/server/runtime.rs, one of the most contended files in the repo, and has zero CI checks on 7dde009.
Stage 0 — CPU only, no GPU time, ~25 min (do this first; it is the highest-value check)
On cn5 (48 CPUs; cn7's 10 CPUs also suffice). Build once, then run tests.
git fetch origin pull/615/head:pr615 && git checkout pr615 # expect 7dde009
cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened)
python -m pip install -r tests/frontend/requirements.txt 2>/dev/null || python -m pip install huggingface-hub
python tests/frontend/prepare_templates.py (not opened) --output /tmp/flare-test-templates \
--recipe gemma4 --recipe glm53 --recipe mimo_v2 --recipe minimax_m3 --recipe nemotron_h --recipe qwen38 --recipe step5
export FLARE_TEST_TEMPLATE_DIR=/tmp/flare-test-templates
cargo test --locked --release --manifest-path helios/Cargo.toml \
--target-dir flare-cli/target --features runtime-core,server # the CI command, .github/workflows/native-serving.yml:63 (not opened)
0b — the one check that closes the real evidence gap (real Inkling 2 tokenizer, still CPU-only):
huggingface-cli download thinkingmachines/Inkling-2-Small \
--revision b0e7afb8892a07897c78ce1c5b801a0d9cbd5e7b tokenizer.json (not opened) \
--local-dir /tmp/inkling2-snapshot
FLARE_INKLING2_TEST_SNAPSHOT=/tmp/inkling2-snapshot \
cargo test --locked --release --manifest-path helios/Cargo.toml \
--target-dir flare-cli/target --features runtime-core,server -- --ignored tml_tests
Assertions that matter: thinking_budget_prepares_content_headers_cut (helios/src/server/request/tml_tests.rs:355-416) must produce cut.close == [200010, <|message_model|>, <|content_text|>], max_new_tokens == 16, after == 48; tools-active and json_object cases must give cut.close == [200010] only; the omitted-budget case must leave reasoning_cut == None. The five pre-existing tml_tests must also pass (they pin the <|end_message|> == 200010 assumption at tml_tests.rs:25 and the whole renderer parity).
Do not proceed to GPU stages until 0a and 0b are green. If 0b cannot be fetched, say so in the report: the ContentHeaders path then has no real-tokenizer evidence at all and that (not GPU time) is the merge blocker.
Stage 1 — Determinism A/B on GB10 / SM121 (cn7): 1 GPU, ~45 min
cn7 is the right first machine: GB10/SM121 is exactly the class the author reported live evidence on, it is one GPU away from idle, and a TP1 core is far cheaper than a TP4 export.
1.1 Reuse, don't build. No exported core is recorded for these checkpoints, so first check:
./flare-cli/target/release/flare models list --json
- Core present for
qwen3.8-27b(TP1) orglm-5.3-flash(TP1): skip the export entirely. PR #615 touches zeroignition/, model, kernel, or graph code and no wire/ABI, so a core exported frommainserves both binaries. - No core: export exactly one, TP1, once, on
main— budget 1–3 h of GPU time and note it, becauseignition exportruns b12x tuning,torch.compile, warmup and capture (docs/model-preparation.md:273-288). Prefer the smallest supported text core that fits 60 GiB unified RAM on GB10;nvidia/Qwen3.8-27B-NVFP4ornvidia/GLM-5.3-Flash-FP4-Local(docs/model-preparation.md:475-479: SM121 cores must be prepared on Spark). Rules of thumb:--autotune-effort offfor a functional test (it changes only kernel selection, not request semantics —docs/model-preparation.md:182-190), and one--no-mtp/reduced-capacity export is fine because the PR touches no speculative path. Gate: if export alone exceeds the time box, stop and reportblocked-style: the same non-regression evidence is already available CPU-side, and TP4 on cn5 would multiply the cost.
1.2 Boot the baseline and the candidate with one fixed request matrix. Same core, same GPU, --max-concurrency 1 (removes batching nondeterminism), only the binary changes.
# baseline
git checkout main && cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened)
./flare-cli/target/release/flare run CORE --gpus 0 --max-concurrency 1 --host 127.0.0.1 --port 8101
# candidate
git checkout pr615 && cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened)
./flare-cli/target/release/flare run CORE --gpus 0 --max-concurrency 1 --host 127.0.0.1 --port 8102
1.3 Request matrix — for each of seed in {7, 11} (seed is request-controlled, docs/api.md:44; note temperature 0 is not available — ranges are clamped, docs/api.md:775-795), fire each case against 8101 then 8102, saving the full JSON body:
| # | Case | Purpose |
|---|---|---|
| A | {"model":"m","messages":[{"role":"user","content":"Explain why quicksort terminates."}],"max_tokens":512,"seed":7} |
uncapped control — must be identical (proves no no-op drift) |
| B | same + "thinking_token_budget":64 |
cut fires; assert reasoning_budget_cuts_total == 1 after |
| C | same + "thinking_token_budget":8 |
tight budget → injected vs after arithmetic near the boundary |
| D | same + "thinking_token_budget":64 + "stop_token_ids":[[<the close token id>]] |
user stop vs injected token; must terminate cleanly, not corrupt usage |
| E | same + "thinking_token_budget":64 + "tools":[...] + tool_choice default |
tools path; cut.close stays 1 token either way, tool call must still parse |
| F | same + "thinking_token_budget":64 + "response_format":{"type":"json_object"} |
grammar active (grammar.is_none() false → no tail, single-token close enforced at runtime.rs:1995-1998); JSON must be valid |
| G | POST /v1/messages with "thinking":{"type":"enabled","budget_tokens":64} |
Anthropic parity (docs/api.md:845-848) |
| H | POST /v1/responses + "thinking_token_budget":64, "stream":true |
Responses/streaming parity |
| I | 32 variants of B with thinking_token_budget 1..32, prompt asking for long non-ASCII reasoning (CJK + math symbols + emoji) |
the only way to reach the UTF-8 trim on this tokenizer — a cut splits a multi-byte char only if the tokenizer splits characters |
1.4 Assertions.
- Cases A–H: response bodies byte-identical between ports (modulo
created/id), and/metricsdeltas identical. This is the strong result — forThinkTags,OutputConfig::reasoning_close_tail()returns empty (helios/src/output/pipeline.rs:26-41), socut.close == [close]and the PR is intended to be a strict no-op. - Where a cut fires (
reasoning_budget_cuts_totalincremented,flare_reasoning_budget_cuts_totalin/metrics): reasoning text stops at the cap,completion_tokens == budget + 1 + tokens emitted after the cut,usage.completion_tokens_details.reasoning_tokens <= completion_tokens, and the content after the cut is coherent text (not stray markers, not empty). - Case I differs from baseline in ≥1 instance ⇒ the trim path is exercised. For each divergence confirm the candidate's continuation remains coherent and that the streamed reasoning ends with
U+FFFDin both binaries (documented behaviour,docs/api.md:817-820; the PR repairs the prompt, not the client stream). Zero divergences across 32 budgets ⇒ report "trim not exercised on this tokenizer" and do not spend more GPU time chasing it — the deterministic coverage is the synthetic byte-level matrix athelios/src/server/runtime/phase_tests.rs:805-869(includinggenerated_len == 1, 2and a literalU+FFFD), plus a code ask for a real-tokenizer variant. - Any cut that does not fire is a void test, not a pass. Preconditions are budget present, single-token close delimiter,
budget < max_new_tokens, output starting in reasoning, reasoning still open at the cap (helios/src/server/request.rs:368-400,runtime.rs:1992-2005). Checkreasoning_budget_cuts_totalafter every case before believing the result.
Stage 2 — Preemption must stay untrimmed (cn7): ~20 min, same core, no new export
The trim is gated on !appended.is_empty(), so claiming preemption (park_if_preempted → park(slot, &[], remaining), helios/src/server/runtime.rs:2152) must be byte-for-byte untouched. This is the one place a wrong gate would corrupt client output (re-emitting a character), so it is worth 20 minutes.
- Restart the candidate with a deliberately small cache:
--kv-cache-limit contextor--memory-limit <tight>(docs/model-preparation.md:397-406). - Fire two concurrent requests (concurrency forced to 2 via
--max-concurrency 2), eachmax_tokens512 +thinking_token_budget64, one of them in non-ASCII text, solive.preempted()andphase == Finishingare reachable (runtime.rs:2133-2145). - Assert:
flare_checkpoint_skips_total/preempt-related counters move (proof preemption happened at all), both requests complete withfailed == 0, streamed text has no duplicated character at the park boundary, and the completion bodies match the same requests run at concurrency 1 (aside from usage identical, text equal). Repeat once with the baseline binary; results must match.
Stage 3 — Startup regression of the unconditional prepare_token_bytes() (cn7 + cn5): ~15 min, no export needed
helios/src/server/config.rs:281 now calls frontend.prepare_token_bytes()? for every core instead of only when max_top_logprobs != 0. This is the only performance-shaped change, and it is host-side (VocabularyBytes is host RAM, one Vec<u8> per vocabulary entry, helios/src/frontend/vocabulary.rs:14-39) — it must show zero VRAM change. The final review argues every exported core already had max_top_logprobs == 20, so the expected delta is zero; measure rather than assume, but do not build a benchmark around it.
For each binary, 3 boots of the same core:
- time from process start to
GET /healthreturning 200 (and to the first served token); nvidia-smi --query-gpu=memory.used --format=csvimmediately after health is 200, all 4 GPUs on cn5 / the one on cn7;- host RSS of
flare runafter health.
Pass: boot time and VRAM within noise of baseline; host RSS delta (predict: single-digit MiB for a 154 880-entry GLM vocab). Anything above ~50 MiB or >1 s of added boot time → report as an undeclared startup regression, which is what reviewers flagged as unmeasured.
Stage 4 — Optional, cn5 only, and only if Stage 1 left a real question: TP4 served-workload spot check, ~60–90 min
GLM-5.3-Flash NVFP4 TP4 fits cn5's exactly 4 × 96 GiB (docs/prefix-cache-offload.md:1429 (not opened), docs/roce-ring.md:349 (not opened) qualify TP4 but on four Sparks — this would be a new topology, so treat it as a smoke test only). Use it only for: serve, run cases B/F/E at concurrency 4, and confirm reasoning_budget_cuts_total equals the number of budgeted requests and failed == 0. Do not attempt to measure throughput: charter requires flare run CORE --embedding-table-storage ram with matched configuration for any performance claim (docs/performance-work.md:45-51), which is out of scope here. Skip cn5 entirely if Stage 1 and 2 pass — that is the main GPU-time saving in this plan.
Also skip, deliberately: the facebook/dinov2-base / timm/vit_base_patch14_dinov2 vision models (PR touches no vision path; the prompt-metadata extend_text invariant it relies on is unchanged), tensor-parallel > 1 as a correctness target for this PR, and any multi-host/Orbit work.
Server-level default check (2 min, fold into Stage 1)
Write ~/.config/flare/config.toml (not opened) with [server] thinking_token_budget = 32, boot the candidate on the GLM or Qwen core, then assert: server starts (this is the bootstrap validation the PR widened, helios/src/server/config.rs:416-418), GET /v1/models shows flare.thinking_token_budget == 32 (docs/api.md:842-843), a request that omits the field gets capped (reasoning_budget_cuts_total increments), and an explicit thinking_token_budget overrides it. This is the only "startup accepts the default on a real core" evidence obtainable without Inkling 2.
GPU-time budget
| Stage | Machine | GPU time | Blocking? |
|---|---|---|---|
| 0 — CPU tests + real Inkling-2 tokenizer | cn5 or cn7 CPU | 0 | yes, prerequisite |
| 1 — determinism A/B + trim sweep | cn7 (1 GPU) | ~45 min (+0–3 h if an export is needed) | yes |
| 2 — preemption untrimmed | cn7 (1 GPU) | ~20 min | yes |
| 3 — boot/RSS/VRAM | cn7, optionally cn5 | ~15 min | no |
| 4 — TP4 spot check, optional | cn5 (4 GPUs) | 0–90 min | no |
Single-GPU cn7 does everything essential; cn5 is contingency only. That is the whole point of the plan: this PR has no speedup to demonstrate and its headline path is untestable here.
Stop / report conditions
- Stage 0 red → stop; report failing test names. Do not spend GPU time.
- Stage 1 case A (uncapped control) differs between binaries → hard stop: the change is not format-isolated; report the diff with seed and body.
- Stage 1 case F produces invalid JSON or a
failedcount → hard stop: grammar/close interaction is broken (the single-token close requirement atruntime.rs:1995-1998would be the suspect). - Stage 2 shows duplicated/missing characters at a park boundary, or preemption counters stay at 0 while only one request is admitted → hard stop.
- Export for Stage 1 exceeds ~3 h → stop, report
blocked on export cost; recommend merging on CPU evidence plus maintainer sign-off, since no machine can validate the actual feature.
Residual risk the plan cannot retire (state this in the sign-off)
Real Inkling 2 continuation after <|end_message|><|message_model|><|content_text|> — i.e. whether a real ContentHeaders model keeps generating in a text frame rather than reopening <|content_thinking|> — remains unverified on our hardware, and no GPU on cn5/cn7 can change that. The cheapest way to retire it is the Stage 0b real-tokenizer suite (proves the right token ids for the right markers) plus one author-supplied flare run transcript on an Inkling 2 Mini core; the expensive-but-definitive option is provisioning an Inkling-2-Small core, which is out of this plan's scope.
Content-safety note
No prompt-injection or instruction-override attempts were found in the PR description, dossier, or comments; nothing in the reviewed material was treated as instructions. One oddity worth flagging as data cleanliness only: the second dossier pass carries a garbled phrase ("helios/src/output/{syntax honestly pipeline,tml}.rs") — noise in the case file, not a security issue.