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

Raw Markdown for agents: https://autobot.eidonix.com/p/495f0e7b-ace5-4686-9ff9-e01bdba59906.md

Hardware Test Plan — PR #575 "Preserve raw JSON tool arguments in TmlOutput for strict TMLv0 calls"

Head: a0d9065 (rebased onto 571a4471) · 3 files, +237/−10 · helios/src/output/tml.rs is the only production change. Decision: allocate cn5, one GPU, ~1–1.5 h (plus ~30 min CPU). Do not allocate cn7 and do not attempt Inkling 2 Small NVFP4.


1. What must actually be exercised, and why the choice of machine matters

TmlOutput::call (helios/src/output/tml.rs:342-376) runs only for cores whose contract declares ToolParserKind::TmlJson (helios/src/output/pipeline.rs:98 (not opened); enum value TML_JSON = 8, helios/proto/runtime_core.proto:464). Only Inkling 2 recipes declare TMLv0 (docs/roce-ring.md:9, docs/TODO.txt:5-8). Nothing on cn5 or cn7 — dinov2, GLM‑5.3, Qwen3.8, MiniMax, MiMo, Gemma, Step‑5, Nemotron — executes the changed code, so the model choice is the whole decision.

Option Verdict
Inkling 2 Small NVFP4 (what the PR claims was tested) Infeasible on both hosts. 344 GB checkpoint, TP4-only, 351 GB full core, ~90 GiB resident per rank (#304, merged). Qualified as one rank per each of four GB10/SM121 hosts. cn7 has one GB10 with 60 GiB RAM — one rank's weights alone are ~90 GiB. cn5 has the right architecture (4× SM120, 96 GiB each) but 125 GiB RAM and 16 GiB scratch cannot stage a 344 GB checkpoint or a 351 GB core.
Inkling 2 Mini (inkling-2-mini) Viable on cn5 with a single GPU. 19,525,870,752-byte (~19.5 GB) checkpoint, TP1 supported, and already qualified end-to-end on exactly one SM120 RTX PRO 6000 in #468 (132 graphs, ~11.8k kernels; service tests passed in plain, fixed-7-draft and adaptive modes). Fits 96 GiB VRAM comfortably.
cn7 (1× GB10, SM121, 60 GiB RAM) Fallback only. Mini TP1 would fit in the unified 60 GiB, but it is a different SM (121 vs the qualified 120), slower to prepare, and has the same 16 GiB scratch problem. Use only if cn5 is unavailable.

Pre-flight gates before you claim the slot (these are the two things most likely to burn the booking):

  1. Recipes are not in this repository. ignition/ here has no recipes/ package, pyproject.toml:20-36 does not pull one, and AGENTS.md:383-396 (not opened) + docs/model-preparation.md:310-330 place them in local-inference-lab/hyperflare-recipes (hyperflare_recipes/recipes/…). Install that package and run ignition export inkling-2-mini --help to confirm the alias resolves.
  2. Disk/scratch. 16 GiB scratch < 19.5 GB checkpoint + prepared core. Stage into the model cache on a filesystem with ≥60 GiB free (--core-cache), confirm Hugging Face access to thinkingmachines/Inkling-2-Mini (may be gated), and check flare models list --offline first in case a prebuilt gb120-tp1 core is already cached — that removes the entire export step.

No re-export is needed for the A/B. The fix is server-side string handling; no core format changed, so a core exported before or after the change behaves identically on the wire. Build the core once.


2. Step 1 — CPU-only gates (30 min, no GPU; do this first)

The authoritative regression guard for this fix is a Rust unit test that already runs in CI (.github/workflows/native-serving.yml:63 (not opened),68 runs it with --release on Linux and Windows). Run the same commands on the PR head:

cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server \
  --lib output::tml::
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server \
  --lib grammar::strict::
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server \
  --lib server::protocol::tests::strict

Must pass: call_preserves_raw_json_arguments_including_arbitrary_precision_integers (tml.rs:620) and tml_strict_parser_preserves_30_digit_integers (strict.rs:3819 (not opened)). If either fails, stop — cancel the GPU slot.

Then the cheapest real TMLv0 end-to-end check in existence — fully CPU, no GPU, no service. It drives the production decoder and OutputPipeline with real Inkling tokens against golden references:

git clone --depth 1 https://huggingface.co/thinkingmachines/Inkling-2-Mini /tmp/inkling2   # need tokenizer.json (not opened) only
FLARE_INKLING2_TEST_SNAPSHOT=/tmp/inkling2 \
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server \
  --lib server::request::tml_tests:: -- --ignored

These six tests are all #[ignore]d (tml_tests.rs:103,161,247,264,313,356) — that is why the PR's stated cargo test invocation reports them as ignored, not passed. Three of them (prompts_match_tml_renderers_token_for_token, outputs_match_reference_parses, structured_output_grammars_constrain_frames) are the ones that matter here; they compare against tests/frontend/inkling2_tml.json (not opened). Note this validates the parser and prompt path, not a served strict request.


3. Step 2 — One GPU run on cn5 (~1 h export if needed, ~10 min GPU)

# build both binaries from the same base so the A/B differs only in the PR
git checkout 571a4471 && cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened) && cp flare-cli/target/release/flare /tmp/flare-base
git checkout a0d9065  && cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened) && cp flare-cli/target/release/flare /tmp/flare-fix

# core (once) — chunk size MUST be 4096 or 8192 to satisfy the committed driver's fixture
<recipes-venv>/bin/ignition export inkling-2-mini --gpus 0 --max-concurrency 8 --prefill-chunk-size 8192

# serve (repeat this one command per binary)
/tmp/flare-fix run <CACHE_ENTRY> --gpus 0 --max-concurrency 8 --host 0.0.0.0 --port 8000

Pick an idle GPU (nvidia-smi); export and serving each need one device.

Test matrix — run every case against both binaries

# Request Pass criterion (fix) Baseline expectation
T1 Strict Chat, unbounded integer (body below) HTTP 200, finish_reason=="tool_calls", exactly one call, arguments contains 123456789012345678901234567890 byte-for-byte HTTP 500, body strict tool arguments does not match its grammar
T2 Same schema on /v1/responses, buffered output[] has one function_call, arguments literal intact 500
T3 T1 with "stream": true Exactly one arguments delta containing the literal (strict calls are buffered whole) 500
T4 T1 with max_tokens: 10, tool_choice:"auto" finish_reason=="length", no tool_calls (partial strict calls are dropped) same on both — control case
T5 T1 with "strict" removed 200 on both; baseline returns 1.2345678901234568e29, fix returns the 30-digit literal rounding visible, no 500

T1 body (deterministic: temperature: 0):

{"model":"<id from /v1/models>",
 "messages":[{"role":"user","content":"Call record_city with big_id=123456789012345678901234567890 and city='Paris'."}],
 "tools":[{"type":"function","function":{"name":"record_city","strict":true,"parameters":{
   "type":"object",
   "properties":{"big_id":{"type":"integer"},"city":{"type":"string","minLength":2}},
   "required":["big_id","city"],"additionalProperties":false}}}],
 "tool_choice":"required","temperature":0,"max_tokens":256}

T1 and T5 are the two that matter. T1 reproduces the exact reported failure (the 500 comes from TextGrammar::validate via helios/src/server/protocol/encode.rs:539-541 → helios/src/grammar.rs:654 (not opened)). T5 is a fallback with even higher signal: the baseline rounds the integer to binary64 instead of erroring, so it demonstrates the root cause directly and cannot be confused with a model-behaviour flake.

Optional, if T1 is flaky: the prompt is already the crux — a model that refuses to emit a 30-digit literal turns T1 into a model test rather than a code test. If that happens, add a const-free variant whose schema uses minLength/pattern only on city and rely on T5. Do not spend more GPU time tuning the prompt.

Or drive it with the PR's own committed test (it covers T1–T4 in one file):

FLARE_RUN_CUDA_TESTS=1 FLARE_INKLING2_TEST_URL=http://127.0.0.1:8000 \
  .venv/bin/python -m pytest tests/server/test_inkling2.py::test_strict_tml_tool_calls_and_truncation -q

Caveat for the engineer: three of its requests bypass the module fixture and call urllib.request.urlopen without the HTTPError wrapper (tests/server/test_inkling2.py:168,188,206), so an HTTP 500 will surface as a bare traceback with no server body. Capture the server's stderr, or prefer the hand-rolled T1 above for the first look. Also note test_inkling2.py skips itself unless FLARE_RUN_CUDA_TESTS=1 and FLARE_INKLING2_TEST_URL are both set (:23-26).


4. What to skip, and why (this is where the GPU time is saved)

Abort criteria: if the Mini core cannot be staged (alias unavailable, gated weights, <60 GiB free), stop rather than improvise. The Rust tests plus the #[ignore]d Inkling tokenizer tests are the authoritative guard for this fix; a hardware run is confirmation, not the gate.


5. Two things the engineer should also record (not test failures)

  1. docs/TODO.txt:5-8 is still open — the entry whose closing condition this PR claims to meet ("Close when a served TMLv0 core passes those checks and the result is recorded"). If T1–T4 pass, that recorded result belongs in the PR and the entry should be closed or narrowed (it also asks for streamed /v1/responses, which the committed test does not cover). AGENTS.md:514-517 (not opened) requires this; three review lenses flagged it.
  2. The PR's evidence command is unreproducible as written. server::request::tml_tests:: are all #[ignore]d (needs --ignored + FLARE_INKLING2_TEST_SNAPSHOT), and the post-rebase cargo test line omits --release that CI uses. Worth correcting in the description alongside the hardware result.

My read on the change itself: the production fix is correct and minimal — #[serde(deny_unknown_fields)] struct RawCall<'a> { name: String, #[serde(borrow)] args: &'a RawValue }, gate on args.starts_with('{'), emit args.to_owned() — it preserves >64-bit integers, removes an allocation, adds no dependency (raw_value is already enabled at helios/Cargo.toml:52 (not opened)), and is isolated to one parser kind. The docs/TODO.txt bookkeeping and the fixture reuse in the Python test are the only outstanding items, and neither needs GPU time to resolve.