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

Raw Markdown for agents: https://autobot.eidonix.com/p/a5085092-2359-4050-970f-7f8e914140e7.md

#1 [high] PR #575 core facts: diff, layer, verified behaviour

PR #575 "Preserve raw JSON tool arguments in TmlOutput for strict TMLv0 calls", head 07955d7 (also cited c7fae93), 3 files +237/-10:

Verified in code:

#2 [high] Hardware feasibility: live Inkling 2 TP4 test is not reproducible on cn5/cn7

Feasibility of a live hardware test for PR #575 — the decisive constraint.

What the PR's own live evidence claims: "35/35" on a live 4× GB10 TP4 Inkling 2 Small NVFP4 serving qualification, Chat Completions + Responses, buffered/streamed, max_tokens/max_output_tokens truncation. What the committed re-runnable test needs (tests/server/test_inkling2.py:4-26, 29-68): FLARE_RUN_CUDA_TESTS=1 and FLARE_INKLING2_TEST_URL pointing at an exported core served by flare run with max_concurrency >= 8, prefill_chunk_size in (4096, 8192), and "image" in flare.input_modalities; model id must contain "inkling".

TMLv0 is Inkling-only. ToolParserKind::TmlJson is selected by the model contract, and OutputPipeline::new routes to TmlOutput only for TmlJson (helios/src/output/pipeline.rs:78). No other model family uses it — GLM uses GlmArgumentTags (:86), Qwen uses QwenCoder (:80/83), DSML (:89/92), Muse/others differ. So there is no substitute model that exercises the changed parser.

Inkling 2 recipe is NOT in this repository: ignition/recipes has no inkling2 path at main or at the PR head (list_files/search_code on ignition/recipes and ignition/recipes/inkling2 return nothing). docs/model-preparation.md:310-330 states official recipes live in the external repo local-inference-lab/hyperflare-recipes, and lists inkling-2-small-nvfp4 / inkling-2-mini there.

Inkling 2 Small is TP4 and its multi-host form needs one rank per host: docs/roce-ring.md:9 "Inkling 2 Small NVFP4 prepares multi-host TP4 cores." #304 prepared it on four DGX Sparks (GB10, 121 GiB unified memory, one rank per host); the checkpoint is 344 GB and each rank holds a quarter (~86 GiB). #304 evidence: full 32-request core was a 351 GB export; even a reduced core loaded 82.91 GiB per rank.

Available hardware vs. that requirement:

Conclusion: the specific live qualification this PR claims CANNOT be reproduced on the available hardware. Staging it would require a 344 GB checkpoint plus a multi-rank export on a host with far more scratch/host memory than 16 GiB/125 GiB, and on cn7 four GB10 hosts rather than one.

#3 [high] Change isolation and regression surface for PR #575

Scope of the production change and what it can/cannot regress (all verified by reading code).

Production change is confined to TmlOutput::call (helios/src/output/tml.rs:329-363), reached only via OutputPipeline::new -> Self::Tml for ToolParserKind::TmlJson (helios/src/output/pipeline.rs:78). Other parsers are separate match arms (GLM :86, Qwen :80/:83, DSML :89/:92, XTML :95, MiniMaxXml :99, GemmaCall :102, None :105). So no non-TML model family can regress from this edit. helios/src/grammar/strict.rs is test-only (+105 inside mod tests).

Downstream path verified intact:

.trim() at tml.rs:339 is very likely a no-op: serde_json RawValue::get() returns the value's raw JSON span and does not include surrounding whitespace. So the "verbatim" wording is effectively accurate and the trim is dead code, not a behaviour gap. (Not verified by execution.) Duplicate wrapper keys: old object.len() != 2 on a serde_json::Value map (preserve_order) accepted {"name":..,"name":..,"args":..}; deny_unknown_fields now rejects it -> falls back to visible text via call_or_text (tml.rs:317-327), pinned by the new test at tml.rs:619-628. Real but narrow acceptance tightening on non-strict TMLv0 output only; the strict TMLv0 wrapper grammar cannot emit duplicate keys. Residual, pre-existing and outside this PR's claim: Anthropic Messages tool_use.input re-serialises through serde_json::Value (encode.rs:334), and the Responses custom-tool input path (encode.rs:299-303), so >64-bit integers still round there. strict: true on Messages is rejected at admission (decode.rs:373), so the reported HTTP 500 cannot recur on that API. Prompt-side TML renderer (helios/src/frontend/tml.rs:148-174) sorts top-level arg keys and re-serialises; that is the prompt/inbound direction, not the output parser, and is unrelated to this fix.

#4 [high] Pre-test gates, live-test quality problems, and test-value reasoning

Pre-test gates and test-plan reasoning for PR #575.

Merge-readiness gates found (none require a hardware run to resolve):

  1. DCO sign-off missing (probable merge blocker). CONTRIBUTING.md:9-11 "Any contribution which contains commits that are not Signed-Off will not be accepted"; git commit -s required. The repo's own hook (.githooks/commit-msg) only enforces the Design-Signed-Off-By: <name>; design-review=<4hex> trailer (hook:56-63), which the commit has, but that is not the DCO trailer. Independent of hardware.
  2. docs/TODO.txt:5-8 untouched although the PR says it "addresses" that entry; AGENTS.md:512-517 requires completed entries be updated/removed and the entry's own closing condition is a recorded served-core result. Three independent review lenses flagged it. Whether closing is legitimate depends on the 35/35 evidence being accepted; if not, the description must not imply closure.
  3. Description inaccuracy: "duplicate wrapper keys ... matching prior TMLv0 recovery semantics" is false — duplicate wrapper keys were accepted before (Value map collapsed them) and are rejected now (pinned by tml.rs:619-628). AGENTS.md:88-94 requires behaviour changes be stated.
  4. Live test quality: tests/server/test_inkling2.py:121-209 bypasses the module's service fixture (tests/server/test_inkling2.py:29-68) for 4 of 6 requests — no HTTPError->pytest.fail(body) wrapping, hardcoded reasoning_effort="none" so the fixture's default-effort parameter never reaches the strict path, re-fetches /v1/models, one test asserts ~5 independent contracts (buffered chat, streamed chat, chat max_tokens truncation, Responses buffered, Responses max_output_tokens truncation). For hardware use this is the wrong instrument: the exact failure this PR fixes is an HTTP 500, and it would surface here with no response body.
  5. CI/ordering risk: no CI checks reported on the head commit; .github/workflows/native-serving.yml:56-68 runs cargo test --manifest-path helios/Cargo.toml --features runtime-core,server on Linux and Windows, which would run both added Rust tests automatically. Also PR #457 (open) rewrites the same TmlOutput::call and strict TMLv0 grammar, so landing order may force a rebase.

Test-value analysis:

#6 [high] Hardware fit verdict for run 2: cn5 + Inkling 2 Mini TP1 is the only viable slot

Changed code path: TmlOutput::call (helios/src/output/tml.rs:342-376) runs ONLY for cores whose contract declares ToolParserKind::TmlJson (helios/src/output/pipeline.rs:98; enum at helios/src/model/contract.rs:67, TML_JSON=8 at helios/proto/runtime_core.proto:464). Only Inkling 2 recipes declare TMLv0 (docs/roce-ring.md:9; docs/TODO.txt:5-8 "e.g. Inkling 2").

Recipes are OUT OF REPO: AGENTS.md:383-396 + docs/model-preparation.md:310-330 → local-inference-lab/hyperflare-recipes (hyperflare_recipes/recipes/...). ignition/ here has no recipes dir (list_files ignition/recipes → nothing); uv sync --extra prepare (pyproject.toml:20-36) does NOT pull them. So the engineer must install the external recipe package.

Two Inkling 2 options: (a) Inkling 2 Small NVFP4 — INFEASIBLE on cn5 and cn7. 344 GB checkpoint, TP4 only, full core 351 GB, ~90 GiB resident per rank (#304 merged). Qualified on 4× GB10/SM121 hosts, one rank per host. cn7 has 1 GB10 (60 GiB RAM, 22 GiB/rank weights alone needs ~90 GiB) — cannot host TP4. cn5 (4× SM120 96 GiB, 125 GiB RAM, 16 GiB scratch) is architecturally right but cannot hold 344 GB checkpoint / 351 GB core with 125 GiB RAM + 16 GiB scratch. (b) Inkling 2 Mini — VIABLE on cn5 with ONE GPU. ~19.5 GB checkpoint (19,525,870,752 bytes, #468), TP1 supported (MINI_WORLD_SIZES = (1,2,4), hyperflare-recipes PR #17 / closed #467); end-to-end flare run on one SM120 RTX PRO 6000 qualified in #468 (132 graphs, ~11.8k kernels; 6 passed in each of plain/fixed/adaptive draft modes). Fits 96 GiB VRAM easily.

cn5 vs cn7: cn5 = amd64 + SM120 (matches #468's qualified SM120 single-GPU path), 125 GiB RAM. cn7 = 1× GB10 SM121, 60 GiB RAM, 16 GiB scratch — Mini TP1 would fit in 60 GiB unified RAM but cn5 is the safer, already-qualified-baseline host. cn7 is a fallback only.

Open pre-flight risk: 16 GiB scratch on both hosts vs 19.5 GB checkpoint + a multi-GB prepared core → must stage into the model cache (--core-cache) on a filesystem with ≥60 GiB free, and confirm Hugging Face access to thinkingmachines/Inkling-2-Mini (token/gated) BEFORE the slot is allocated.

#7 [high] Concrete test matrix, commands, and A/B design for PR #575 on cn5

Head a0d9065 (rebased onto 571a4471), +237/-10, 3 files. Fix is SERVER-side only: no core-format change → a core exported before the change exercises the new code; NO re-export needed for the A/B.

A/B binaries from the same base: git checkout 571a4471 && cargo build --locked --release --manifest-path flare-cli/Cargo.toml → save as /tmp/flare-base git checkout a0d9065 && cargo build --locked --release --manifest-path flare-cli/Cargo.toml → /tmp/flare-fix

CPU-only gates (do first, ~15-30 min, no GPU): cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib output::tml:: ... --lib grammar::strict:: ... --lib server::protocol::tests::strict (matches strict_function_tools_* :1751 / strict_tool_wires_* :2026) Note: server::request::tml_tests:: are all #[ignore] (tml_tests.rs:103,161,247,264,313,356) and need FLARE_INKLING2_TEST_SNAPSHOT= + -- --ignored. They are CPU-only + golden refs (tests/frontend/inkling2_tml.json) — cheapest real TMLv0 end-to-end check available, no GPU.

Service (Mini TP1 on cn5, one GPU): export: .venv/bin/ignition export inkling-2-mini --gpus 0 --max-concurrency 8 --prefill-chunk-size 8192 serve: /tmp/flare-fix run <CACHE_ENTRY> --gpus 0 --max-concurrency 8 --host 0.0.0.0 --port 8000 (prefill_chunk_size must be 4096 or 8192 for the committed python test's fixture assertion at tests/server/test_inkling2.py:37; max_concurrency >= 8 at :35; model id must contain "inkling" at :34.)

Core request (strict Chat, unbounded integer) — T1, the ONLY test that proves the fix on hardware: POST /v1/chat/completions {"model":"","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} PASS (fix): HTTP 200, finish_reason=="tool_calls", exactly 1 call, arguments contain the 30-digit literal byte-for-byte. FAIL baseline: HTTP 500 with body containing "strict tool arguments does not match its grammar" (produced at helios/src/grammar.rs:654 via helios/src/server/protocol/encode.rs:539-541). Non-strict variant (drop "strict":true) shows the rounding symptom in the baseline instead: args contain 1.2345678901234568e29; fix emits literal. Deterministic, high-signal, no 500 needed.

Other GPU cases (all <10 s each): T2 strict Responses buffered → function_call.arguments literal (encode.rs:313). T3 strict Chat streamed → exactly one arguments delta containing the literal. T4 truncation max_tokens=10, tool_choice:"auto" → finish_reason=="length", no tool_calls (tml.rs:377-384 semantics). T5 non-strict Chat → 200 both binaries; argument text now verbatim (disclosed side effect in PR body).

Or reuse the committed driver: FLARE_RUN_CUDA_TESTS=1 FLARE_INKLING2_TEST_URL=http://... .venv/bin/python -m pytest tests/server/test_inkling2.py::test_strict_tml_tool_calls_and_truncation -q

SKIP (saves GPU time):

Time budget: CPU gates 30 min; staging/export ~1 h (check flare models list and the Hub for a prebuilt inkling-2-mini SM120 TP1 core first — biggest saving); serving + all 5 cases ~10 min of GPU.

Abort criteria: if the Mini core cannot be staged (recipe unavailable, gated weights, <60 GiB free for cache), stop — the CPU Rust tests are the authoritative guard for this fix; do not improvise a synthetic TML core (fixture frontend is a 2-token WordLevel tokenizer, helios/tests/fixture_frontend.py:10-20; TML framing needs 14 real control markers).