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

Raw Markdown for agents: https://autobot.eidonix.com/p/d9375d31-d99c-4ae9-acbb-cea62f32d37e.md

#1 [high] PR #615 scope and touched code (final head 7dde009)

PR #615 "helios: support thinking_token_budget for ContentHeaders". Files: docs/api.md, helios/src/output/{pipeline.rs,tml.rs}, helios/src/server/{config.rs,request.rs,runtime.rs}, helios/src/server/protocol/decode.rs, helios/src/server/request/tml_tests.rs, helios/src/server/runtime/phase_tests.rs. +614/-50, ~156 prod lines, 442 test lines.

Production changes:

  1. request.rs:539-560 thinking_budget_close() now also accepts OutputStart::RecipientFrame|RecipientHeader when syntax.kind == ReasoningParserKind::ContentHeaders (RecipientHeaders unchanged); still requires single-token close delimiter.
  2. request.rs:380-397 builds ReasoningCut.close: Vec once: [close] plus output.reasoning_close_tail() appended only when grammar.is_none() && tokens.len()+tail.len() < after.
  3. output/tml.rs:46-57 text_frame_opener() returns [MODEL, TEXT] ids from validated single-token output.control_tokens; output/pipeline.rs:26-41 OutputConfig::reasoning_close_tail() returns it when ContentHeaders && content.tools.is_empty().
  4. runtime.rs:1994-2048 Worker::publish: emits every token in cut.close through Active::close_reasoning() (runtime.rs:474-488) → observe_token + carried.generated_tokens += 1 + emit_output (stop matching, decoded stream); records each injected token in decoded history; metrics.progress(0, injected.len(), ...); remaining = cut.after.saturating_sub(injected.len()); grammar path requires cut.close.len()==1 && grammar.allows(close[0]).
  5. runtime.rs:417-461 trim_incomplete_utf8_tail() + called at runtime.rs:2156-2163 in Worker::park only when !appended.is_empty() (i.e. forced cut only; preemption passes &[] and the plain output limit does not trim). Truncates tokens at index >= live.prompt_tokens whose concatenated token_bytes() end in an incomplete UTF-8 suffix (Utf8Error::error_len().is_none()); 8-token window.
  6. config.rs:281 frontend.prepare_token_bytes()? now unconditional at Bootstrap::load (was gated on model.max_top_logprobs != 0). VocabularyBytes is host RAM.
  7. docs/api.md:813-843 documents ContentHeaders support, silent <|message_model|><|content_text|> injection when no tools/grammar, format-agnostic UTF-8 tail trim, forced tokens count as generated tokens.

Test/verification evidence in PR: CPU unit+worker tests (phase_tests.rs:679-869 includes ContentHeaders injection Case1/Case2 and UTF-8 trim Case matrix incl. literal U+FFFD and generated_len 1/2; decode.rs:2032-2194 request-prep cases; config.rs:663-696 bootstrap validation; tml_tests.rs:355-416 real Inkling-2 tokenizer test is #[ignore], needs FLARE_INKLING2_TEST_SNAPSHOT). Author reports one live GB10/SM121 Inkling-2-Mini run (7 scenarios) but zero CI checks on head 7dde009 and zero human reviews.

#2 [high] Available hardware vs reachable code paths

Hardware: cn5 = 4x RTX PRO 6000 Blackwell Max-Q (SM120), 96 GiB each, amd64, 48 CPUs/125 GiB RAM/16 GiB scratch. cn7 = 1x NVIDIA GB10 (SM121), arm64, 10 CPUs, 60 GiB RAM (unified memory), 16 GiB scratch. Models available: cn5: facebook/dinov2-base, timm/vit_base_patch14_dinov2.lvd142m (vision only), local-inference-lab/GLM-5.3-Flash-NVFP4, nvidia/GLM-5.3-Flash-NVFP4. cn7: incoai/Qwen3.8-27B-DFlash2, nvidia/Qwen3.8-27B-NVFP4, nvidia/Qwen3.8-Flash-Next-FP4-Local, local-inference-lab/GLM-5.3-Flash-NVFP4, nvidia/GLM-5.3-Flash-FP4-Local, zai-org/GLM-5.3-Flash. NO Inkling 2 checkpoint on either machine. Inkling-2 Mini/Small are the only ContentHeaders (ReasoningParserKind::ContentHeaders) format in the repo (docs/model-preparation.md:324 recipes inkling-2-small-nvfp4, inkling-2-mini), so the PR's headline path (silent <|message_model|><|content_text|> injection) cannot be exercised on real hardware here. GLM-5.3 contract (helios/tests/support/contracts/glm53.json): reasoning kind 1 ThinkTags open close , tools kind 2 GlmArgumentTags, vocab 154880. Tokenizer single tokens: =154841, =154842 (helios/tests/reasoning_delimiters.rs:68-78). Qwen3.8 contract (helios/tests/support/contracts/qwen38.json): reasoning kind 1 ThinkTags, tools kind 1 QwenCoder, =248068, =248069 (helios/tests/reasoning_delimiters.rs:59-66). Both GLM-5.3 and Qwen3.8 therefore take the pre-existing OutputStart::Reasoning|Content budget path (request.rs:549-551) — reachable on real hardware, and they still exercise the refactored Vec close, per-token close_reasoning accounting, and the format-agnostic UTF-8 trim. Ignition export needs no change (PR touches zero ignition/ files, zero model/kernel/graph code, no wire/ABI change), so an existing core exported from main serves both binaries; A/B = swap the flare binary only.

#3 [high] Key test-design facts for the hardware plan

  1. NO speedup claim exists in PR #615. Triage applied performance at 65% but the PR claims no perf win. Only perf-relevant deltas: (a) config.rs:281 now builds VocabularyBytes for every core at boot (host RAM, one Vec per vocab entry, frontend/vocabulary.rs:14-39) — previously gated on max_top_logprobs != 0; (b) trim_incomplete_utf8_tail does <=8 O(1) token_bytes() lookups per forced cut (no frontend.decode calls at head 7dde009). So hardware testing = non-regression, not speedup measurement.

  2. Strongest available assertion: for non-ContentHeaders formats the PR is intended to be a NO-OP. OutputConfig::reasoning_close_tail() (output/pipeline.rs:26-41) returns empty unless ReasoningParserKind::ContentHeaders, and cut.close == [close] then. So on GLM-5.3/Qwen3.8 (both ThinkTags) with identical seed + identical core + concurrency 1, main vs PR response bodies, usage and metrics should be identical. Divergence = regression; identical = strong pass.

  3. Observable signals (docs/api.md:317-345; helios/src/server/metrics.rs:70-129): GET /metrics (prometheus) and /metrics?format=json. Fields: reasoning_budget_cuts (flare_reasoning_budget_cuts_total), generated_tokens, completed, failed, replay_gpu_ns, first_response. A cut that never fires leaves reasoning_budget_cuts at 0 → test void, NOT a pass. Preconditions for a cut (request.rs:368-400, runtime.rs:1992-2005): budget present, format has single-token close delimiter, budget < max_new_tokens, output starts in Reasoning, reasoning still open at the cap, grammar allows the close.

  4. Accounting at head: injected tokens each run Active::close_reasoning (runtime.rs:474-488) → carried.generated_tokens += 1, emit_output (token-stop matching + decoded stream), metrics.progress(0, injected.len()), and remaining = cut.after.saturating_sub(injected.len()). So completion_tokens = budget + injected + after-emitted. For ThinkTags injected == 1 (same as main #167). For ContentHeaders it would be 3 — unreachable here.

  5. Trim (runtime.rs:417-461, called at 2160-2162) only runs when !appended.is_empty() i.e. forced cut; preemption passes &[] (runtime.rs:2152) and the plain output limit never appends. It rewrites only the re-prefilled prompt (tokens at index >= live.prompt_tokens), never client-visible output; a mid-character cut already flushed U+FFFD on main.

  6. Preemption reachability: park_if_preempted requires live.preempted() && phase==Finishing (runtime.rs:2133-2153); forced only under KV pressure → use low --memory-limit or --kv-cache-limit plus 2 concurrent long requests to force it.

  7. Cost drivers: no exported core is guaranteed (hardware list shows model checkpoints, 0 GiB). ignition export runs tuning + torch.compile + capture per rank → hours, and is the dominant GPU cost. Gate: run flare models list first; if a compatible core exists, reuse it (PR touches zero ignition/model/kernel/graph code and no wire/ABI, so a main-exported core serves both binaries). Prefer a TP1 core on cn7 (GB10/SM121, 1 GPU, matches the author's claimed live evidence) over a TP4 export on cn5.

  8. Zero-GPU, highest-value check: real Inkling-2 tokenizer #[ignore] tests (helios/src/server/request/tml_tests.rs:355-416 plus the 5 pre-existing ones) against snapshot thinkingmachines/Inkling-2-Small rev b0e7afb8892a07897c78ce1c5b801a0d9cbd5e7b (tests/frontend/generate_inkling2_fixtures.py:43-44). This validates real token ids for <|message_model|>/<|content_text|> (the 200010 = END_MESSAGE assumption, tml_tests.rs:25) with no GPU. CI command: .github/workflows/native-serving.yml:63 (cargo test --features runtime-core,server), needs FLARE_TEST_TEMPLATE_DIR from tests/frontend/prepare_templates.py (line 28-31).