Repository navigation
scheduler: let strict sequences share the batched MTP verify under ATLAS_STRICT_SPEC - #343
Conversation
…LAS_STRICT_SPEC A speculating strict (response_format) sequence still took a verify forward of its own every step: plan_verify kept every strict grammar on the per-sequence path. N concurrent structured requests ran N verify forwards a step, and a lone one was cut to 3 drafts because the deep window (ATLAS_MTP_DYNAMIC_DEPTH) only runs through the batched verify. On a full-logits MTP verify the batched pick already runs the same host pipeline per member as the per-sequence verify (the non-strict grammars of Atlas-Inf#203 ride it), so strict sequences now join the batch, as decode rows too, where strict_spec::rides_batch holds. The argmax-only head and the DFlash batch keep the per-sequence verify. ATLAS_GRAMMAR_SERIAL_VERIFY restores it for every grammar, which is the A/B arm. No new variable. Tests: routing, two strict members in one forward (one sampled, with an illegal draft and an illegal raw top), a window crossing </think>, and a lone deep window. Not run on hardware. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The harness takes a third arm (lever on, one verify per structured request: ATLAS_GRAMMAR_SERIAL_VERIFY), names its columns after the records, and defaults to 2400 output tokens: 800 cut the 12-item reply short in every arm, which read as invalid JSON. docs/notes/HANDOFF_PR336_strict_spec.md was the plan written before any hardware run and still said so; the measured result is in the PR. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The previous commit's message describes this default, but the edit was left unstaged. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tep timing) The probe takes --final-tool-choice auto (tool_choice unset on the final turn, the union); the harness takes --cases and defaults to 2400 output tokens. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ol-call-or-JSON union A/B Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Follow-up measurementsSame pair, build and profile as the table in the description; fresh boot per arm, idle pair, no throttling. 1. Second workload: 6
All 12 replies are byte-identical across the three arms, alone and concurrent; 12/12 valid in every arm, 0 request errors. 2. Tool grammar on (served without
A request carrying 3. Step timing (
The grammar path is 3-4% of a strict step; the rest of the difference from plain is the deeper draft window ( |
|
Merged after an A/B on ONE GB10 (sparky). Setup: Qwen3.8-Flash-Next NVFP4 (the vendor pack, not FP4-Local), a local test merge of main
Receipts: |
…-f341) Campaign against frozen main f3f700a (#343 strict-spec batching + #350/#351 kv_budget/dflash follow-ups). Ten required gates run on two exclusive GB10 boxes; records split b4ee (echolp, ttft x2, ssm, decode-floor, concurrency, vision, video) / f341 (bfcl-subset, agentic-webserver). video-fidelity FAILS its gate floor: backend-parity leg — mp4 (32f/8fps) samples to 16 groups/928 tok while the zero-delay gif fixture lands at 4 groups/244 tok; deterministic divergence between the ffmpeg subprocess and in-process gif decoders on this tree. Record committed is the earlier ffmpeg-absent run (7/13 legs, 6 skipped); the full-ffmpeg rerun scored 12/13 and wrote no record because the run ended Failed. Required manual fixes this campaign needed: libssl-dev + ffmpeg on the gate boxes, soundfile in the bfcl venv, and a serve-override restoring the bfcl recipe's shell-quoted default_chat_template_kwargs as raw JSON.
Summary
Follow-up to #336. With
ATLAS_STRICT_SPEC=1, a speculating strict (response_format) sequence still took a verify forward of its own every step:plan_verifykept every strict grammar on the per-sequence path. N concurrent structured requests ran N verify forwards a step, and a lone one was cut to 3 drafts because the deep window (ATLAS_MTP_DYNAMIC_DEPTH) only runs through the batched verify.On a full-logits MTP verify the batched pick already runs the same host pipeline per member as the per-sequence verify (the non-strict grammars of #203 ride it). Strict sequences now join the batch, as decode rows too, where
strict_spec::rides_batchholds. The argmax-only head and the DFlash batch keep the per-sequence verify.No new environment variable.
ATLAS_GRAMMAR_SERIAL_VERIFYrestores one verify per grammar sequence, which is the A/B arm below.Measured
Qwen3.8-Flash-Next FP4-Local, two GB10 at TP=EP=2, 8 lanes x 262K,
--speculative --num-drafts=7, idle pair, GPU clock locked at 2,200 MHz on both nodes, no thermal throttling in any arm. Fresh boot per arm, same build.scripts/dev/strict_spec_ab.py, temperature 0 unless noted, 3 repetitions, one session. Aggregate wall tok/s (prefill included); noise floor from two records of theoffarm is about 2%.ATLAS_MTP_GATE_FORCE=1, which bypasses the throughput gate that could otherwise fall back to plain decode. This PR removes that loss.ATLAS_MTP_ACCEPT_DEBUG):serialverifies are almost alln=1;onreachesn=4andn=8. A lone structured request ends atdepth=k7 tok_step=3.63inonagainstdepth=k4 tok_step=3.16inserial.onrun at 2,400 output tokens: every structured reply ends withfinish_reason=stopand is schema-valid, 0 invalid in all 11 cases, 0 request errors.Not measured: the tool-call-or-JSON union (the tested profile serves with
--disable-tool-grammar, so it never forms), any model other than qwen4_exp, and the DFlash lane (unchanged by this PR).Test plan
cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --testsbash scripts/check-license-headers.sh,typoscargo test -p spark-server --bin spark scheduler::: 695 passed, 1 ignored (CPU, stubbed CUDA libraries)mtp_step/one_forward_strict_tests.rs), each failing with the lever off: routing; two strict members in one forward, one sampled with an illegal draft and an illegal raw top; a window crossing</think>; a lone deep windowNotes for reviewers
ATLAS_STRICT_SPECstays opt-in here. Measurements that would flip it to default: the tool-call-or-JSON union on hardware, and the same A/B on a second full-logits model.docs/notes/HANDOFF_PR336_strict_spec.md, which still said nothing had run on hardware) with the three-arm harness that produced the table. Its default output budget is now 2,400 tokens; 800 truncated the 12-item reply in every arm.ATLAS_*name.scripts/check_env_budget.pyalready fails onmain.CLA