Repository navigation
qwen4_exp: seven fixes for long-form serving of Qwen3.8-Flash-Next on a GB10 - #23
Conversation
…LE_MAX_TOKENS up to the floor Two independent caps refused every prompt past 8192 tokens on a default serve of Qwen3.8-Flash-Next. The prefill chunk is max_batch_tokens = prefill_budget + max_batch_size = 8193 wide, but the n-gram row cache was a fixed 65536 slots (sized for 2048 x 16 heads), so an 8193-token chunk pinned 131,088 rows and the cache bailed with "every one of 65536 slots is pinned by the batch in flight". Derive the default from max_batch_tokens x ngram_heads (rounded up to a power of two, floored at 65536; ~84 MB at the default chunk) and keep ATLAS_PLE_CACHE_SLOTS as the override; the load line now prints where the number came from. An ATLAS_PLE_MAX_TOKENS override below the derived floor was honoured after a warning and then refused the first wide prefill as a 500; it is now clamped up to the floor with the same warning. Co-Authored-By: Claude Fable 5.1 <[email protected]>
ATLAS_QSA_MAX_TOKENS defaulted to 32768 regardless of the served context,
so a --max-seq-len 65536 serve of Qwen3.8-Flash-Next died mid-stream the
moment a sequence reached position 32768 ("QSA: pos 32768 >=
ATLAS_QSA_MAX_TOKENS"), discarding 14.5K generated tokens.
ModelConfig now carries max_seq_len the same way it carries
max_batch_tokens (serve-time, serde-skipped), serve sets it from
--max-seq-len, and QsaIndexer::new sizes its per-sequence key caches from
it. The env var remains an override that can only raise the capacity; a
lower value is clamped up with a warning, and the two bounds guards name
the flag that actually controls them. A config built outside serve keeps
the historical 32768.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…"; log cuBLASLt fallbacks Every verify/MTP step handled an engine failure with `a.finished = true`, so the response layer reported a normal completion: on Qwen3.8-Flash-Next a speculative verify that hit an active QSA selection at position 2,051 ended a 1,679-token answer with a clean "stop". The client could not tell the truncation from success. ActiveSeq now records the cause (`engine_error`, set at every such site; `abort_on_engine_error` for the k3 step where the stamp pushed the file past the LoC cap). finish_sequence reports "error" — a new FinishReason variant on the wire — and a blocking client receives the error itself, so the request fails as a 500 instead of a completion with a strange reason. The GDN QKVZ projection also swallowed the cuBLASLt error before falling back to the scalar dense_gemm; that fallback is the kernel that faulted with CUDA_ERROR_MISALIGNED_ADDRESS on continuation prefill chunks. It now logs the cuBLASLt failure with M/N/K and the operands' low address bits and debug-asserts their alignment, so the next fault names its operand. Co-Authored-By: Claude Fable 5.1 <[email protected]>
After a sticky CUDA error (CUDA_ERROR_MISALIGNED_ADDRESS in a continuation prefill chunk on Qwen3.8-Flash-Next) the fault latch fired, /health went 503 and main.rs was ready to exit EXIT_GPU_FAULT — but the scheduler loop never returned control to it. The process kept the port open, answered /tokenize, 500'd every completion and held ~100 GB for hours until it was killed by hand. Check the global latch at the top of every scheduler iteration: mark the in-flight sequences as engine errors (they finish with reason "error" through the existing drain) and break, so the exit path that already exists runs. /health needs no change: it already reports the latched fault (api::tests::health_fault). Co-Authored-By: Claude Fable 5.1 <[email protected]>
The content-loop watchdog's rollback restored the SSM recurrent state from the decode ring and lowered seq_len, but nothing rewound the QSA indexer cursor or the PLE n-gram history: on Qwen3.8-Flash-Next the very next decode failed "QSA: decode at pos 2864 but 2932 tokens ingested — the indexer cache lost sync" and the request died with a 500. The only aux rewind in the tree was the speculative-verify commit hook; the watchdog path never touched aux state. Mirror the SSM treatment with the audited snapshot path instead of a new arithmetic rewind: the model gains save/restore_decode_aux_snapshot (byte-exact blobs from collect_aux_states/apply_aux_states, keyed by the same (slot, ring_slot) as the SSM ring) and requires_aux_state. snapshot_boundary_if_ssm saves both or drops the ring entry; rollback_to_boundary restores both, and declines with the new RollbackFallback::NoAuxSnapshot — a stream-safe hard stop — when the aux companion is missing or fails to restore. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The MTP lane's gate declines a batch only when a sequence is ALREADY at or past verify_context_limit (the QSA inert bound, 2051 on this card). A sequence admitted just below it gets a verify that ingests num_drafts + 1 rows across the bound, and the next verify runs with selection active on the batched multi-seq path, which refuses it — on Qwen3.8-Flash-Next with --speculative --num-drafts 1 every long answer died at position 2051. Latch a.disable_mtp one step early (seq_len + num_drafts + 1 >= limit), logged once per sequence; the serial lane handles active selection. The batched multi-seq entry also refuses before any QSA ingest when a row is already past the bound, so a future caller cannot mutate state before the late check fires. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…e GEMM Chunked prefill of Qwen3.8-Flash-Next faulted with CUDA_ERROR_MISALIGNED_ADDRESS on continuation chunks — a 1,117-token last chunk, or the default 8,193-wide chunk — while 1,074 / 1,862 / 4,092-token chunks were fine. Under CUDA_LAUNCH_BLOCKING the faulting launch is dense_gemm_bf16_pipelined with grid [80, 9] = [10240/128, 1117/128]: the `up_pre = low x up_wt^T` GEMM in hc_pre_gemm. Its scratch was packed as raw byte products: `inj_pre` is `lay * hc_mult * 2` = `lay * 8` bytes, so for an odd slab `up_wt` started 8 bytes off a 16-byte boundary and the kernel's vector loads faulted. Even slabs happened to align, which made the fault look random (and had the earlier odd-chunk-width theory half right). Place the sub-buffers with one shared layout function in spark-runtime (256-byte aligned) and size the region from the same function, so sizing and placement cannot disagree. Unit test covers odd and even slabs including the historical 1,117. Verified on the GB10: the 13,397-token prompt prefills at both 4,096 and the default 8,192 chunking. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Resolves the one conflict in multi_seq/mod.rs: main's nemotron serial early-return runs first, then the QSA pre-mutation guard from this branch. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Atlas fills request fields a client leaves unset from the selected MODEL.toml [sampling.*] category. For penalties this happened unconditionally, so Qwen3.8-Flash-Next's card presence_penalty = 1.5 (tuned for short chat turns) reached every plain chat/completions request. On a 20K-token single-file build it suppresses every token already emitted and the engine shipped dead/inert files; with presence 0 the identical engine and sampler wrote a working 51 KB game. New [behavior] key use_sampling_preset_penalties_for_core (default true, so no other model changes). Tool-calling requests always keep the [sampling.tools] penalties; explicit request values always win. Flash-Next's MODEL.toml opts out. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The checkpoint ships lm_head in BF16 and Atlas requantized it to NVFP4 at load. The 27B recipe already pins --lm-head-dtype bf16 for exact argmax; long-form single-file generation on Flash-Next is the same regime. --lm-head-dtype nvfp4 still forces the packed head. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Watchdog rollbacks fire from logits processing, after decode(last_token) pushed that token, so seq.tokens holds every generated token including the boundary token. apply_rollback re-points last_token at the boundary token and the next step decodes it again, but rewind_buffers popped only the dropped tokens: the boundary token was decoded twice, one position past the SSM/aux snapshot (taken before it was fed). Pure-attention models got a duplicate KV row; hybrid models with the QSA indexer failed with 'QSA: decode at pos 6050 but 6049 tokens ingested' after the aux restore landed. Pop dropped + 1. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…int precision The NVFP4 loader arm runtime-quantizes BF16-shipped attention projections to NVFP4 even though ModelOpt's own ignore list keeps every self_attn projection at BF16 (the qwen4_exp checkpoint does). The BF16 Q/K/V sources are already resident for the dense fallbacks; with the flag the layer gets no NVFP4 Q/K/V (dense GEMV/GEMM arms run) and keeps a BF16 O copy via set_o_dense_bf16. Serve-time config field, validated enum, default unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]>
c120f47 to
953820a
Compare
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…iscarded context
Two watchdog sites roll back at different points of the step. The
content-loop / inter-tool-prose handler runs BEFORE the step pushes its
sampled token, so seq.tokens holds every generated token; the fuzzy
detector runs AFTER the push, so the newest output token is not decoded
yet. A fixed pop count is wrong at one of them: popping dropped decoded
the boundary token twice at the before-push site ('QSA: decode at pos
N+1 but N tokens ingested'), popping dropped+1 discarded a real token at
the after-push site ('pos N but N+1 ingested', seen once the first fix
landed). rewind_buffers now takes the unfed tail (0 / 1) and pops every
fed token from the boundary onwards, which lands the re-fed boundary
token exactly where the SSM/aux snapshot expects it.
The before-push site also kept appending the token it had just sampled
from the discarded context: a phantom, never-decoded token that reached
the client and put every later rollback one position off.
handle_content_token now returns true on a rollback, refunds that
token's budget and content count, and the step drops it.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The single PLE layer released the previous gather's row pins behind a full stream synchronize once per token and uploaded the resolved slot list from a pageable Vec. Record an event behind the gather kernel and wait on that; stage the slot list through a pinned buffer rewritten only after that wait. GpuBackend gains thin event wrappers with a stream-sync fallback. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…oE through the grouped-GEMM arm A/B lever from the llama.cpp gap study: the scalar FP32-FMA decode arm vs the tensor-core grouped-GEMM arm (forward_prefill M=1) for all 48 layers. Default unchanged (scalar). Measured on the GB10: grouped 5.3 tok/s vs scalar 15.0. Co-Authored-By: Claude Fable 5.1 <[email protected]>
… host-parity check decode_select copied the block scores device-to-host (a stream sync per attention layer per token), sorted on the host and uploaded the selection. qsa_select_topk does the selection on the device with torch.topk's tie-break (lower index wins), in ascending block order, straight into sel_dev; n_sel never depended on the scores. Default stays on the host arm; ATLAS_QSA_TOPK_VERIFY=1 runs both and fails on the first mismatch. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ccumulation order nsys on the GB10 (C=1, 3.9K ctx) had this kernel at 121 us x 97 launches = 11.7 ms of a 69 ms token, ~54 GB/s on 6.5 MB of up_w: latency-bound, one dependent load+FMA per rank step per stream, and nvcc does not pipeline the runtime-bound loop. Unroll r by 8 with the 32 loads hoisted ahead of the 32 accumulations. Every accumulator still sums r = 0,1,2,... in that order into one FP32 register (--fmad=false), so the output is bit-for-bit unchanged; this is scheduling, not the reassociation the kernel's note rejected. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…cal accumulation order Stage 3 of the hyper-connection decode collapse is capped at H = 2560 threads per token (thread-per-d walking four dependent rank-320 chains): nsys measured 121 us x 97 launches = 11.7 ms of a 69 ms token. Give each of the four INDEPENDENT stream accumulators its own warp, lanes over 32 consecutive dims, so a token spans 80 blocks x 4 warps; the per-(d, s) sum still runs r = 0,1,... in one FP32 register (--fmad=false) and the four products still fold in s order in one thread, so the output is bit-for-bit the previous kernel's. ATLAS_HC_FIN_X4=0 keeps the old path. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The rank loop read every score from global memory complete times; nsys had the kernel at ~71 us x 12 launches per token. One staged copy (16 KB for the 4096-block cap) and NaN folded to -inf once. Co-Authored-By: Claude Fable 5.1 <[email protected]>
9e7d03c to
98a297e
Compare
rollback.rs (511) -> rollback_rewind.rs child: rewind_buffers + apply_rollback (pure token-buffer rewind + ActiveSeq glue), re-exported. ple/layer.rs (501) -> seq_state.rs child: PleSeqState with pub(super) fields, re-exported. No behaviour change. Co-Authored-By: Claude Fable 5.1 <[email protected]>
98a297e to
0acad1c
Compare
Measured with the same params as main's records (2026-09-03-077552182d): vision/video fidelity, decode-floor (22.1 tok/s), warm/cold TTFT, SSM state poisoning, concurrency sweep, agentic webserver and bfcl-subset-echolp all PASS. bfcl-subset FAILS at 86.23 overall / 83.10 normalized (bars 83.42 / 83.32). This is not this branch: main@077552182d served with the recipe's flags and driven by main's own harness scores the identical 86.23 / 83.10 on this GB10 today, and a 207-sample replay of the subsets that moved (parallel, parallel_multiple, simple_javascript) gives byte-identical tool calls from the two binaries. The committed 0775521 record repeats the 61f6976 measurement (2026-09-02) to the digit, including sm clocks; between that tree and 0775521 the qwen3.8-27b kernel target grew from 182 to 198 modules (0775521 touches prefill_paged_compute.cuh, argmax_bf16.cu, w8a16_gemv_batch4.cu, mamba2_ssm_decode.cu and the paged-sink prefills). The record is committed as measured so the gap is visible. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…aths) 0775521 switched the greedy tie-break from "first strict maximum wins" to "value descending, then higher vocabulary index" in argmax_bf16.cu and moved the host verify argmax and the greedy logit processor to the same last-wins rule. With BF16 logits at temperature 0 exact ties are common, so the rule change moves tokens: on the bfcl-subset gate draw for unsloth/Qwen3.8-27B- NVFP4 it flipped 9 of 207 replayed answers, cost 3 correct ones, and took the checkpoint from 86.53/83.38 to 86.23/83.10 (bars 83.42/83.32) — main itself fails its own committed record under the new rule. Reverting only the kernel on top of main restored all nine samples; reverting the other accumulation-order change in the same commit restored none. First-index-wins is also what llama.cpp's greedy sampler and vLLM's torch.argmax do, so it is the rule the recorded baselines and the other engines share. This restores: * kernels/gb10/common/argmax_bf16.cu — the 61f6976 kernel, verbatim * scheduler/verify_pipeline_helper/argmax.rs — argmax_first_wins * scheduler/verify_pipeline_helper.rs, logit_processors/mod.rs — call the first-wins helper (spark_runtime::sampler::argmax_first_wins_f32) * atlas-kernels/tests/argmax_tiebreak_contract.rs — now locks the first-wins rule instead of the last-wins comparator Co-Authored-By: Claude Fable 5.1 <[email protected]>
Same params as main's records. With first-index-wins tie-breaking restored (db0bc09), bfcl-subset is back at 86.53 overall / 83.38 normalized on the full 995-sample draw — the 2026-09-02 numbers to the digit (bars 83.42 / 83.32). bfcl-subset-echolp 87.95 / 87.99, decode-floor and the TTFT, SSM, fidelity and agentic gates unchanged. Two gates needed a second run at this head and the records are from those: decode-floor's first attempt died before serving ("No memory left for KV cache") because the previous gate's server had not yet released ~3 GB — a settle-time artefact, not a measurement; concurrency-sweep's first attempt was INCONCLUSIVE because one of the eight natural prompts at conc 8 paraphrase-looped and the SimHash watchdog cut it at 243/320 tokens (below the 80% vacuity floor). On the re-run the same prompt was cut at 309 and every floor was met (C1 19.0 · C4 50.8 · C8 58.8 · C16 85.6 tok/s). The loop is greedy-path behaviour of this checkpoint under first-wins; the last-wins run on 2026-09-07 did not hit it. Worth knowing when reading the sweep's vacuity rule. Co-Authored-By: Claude Fable 5.1 <[email protected]>
38b7565 to
3d92224
Compare
Review + hardware test report (GB10,
|
| Change | Result |
|---|---|
Chunked prefill past 8,192 (hc_pre scratch alignment + PLE cap) |
30,651-token prompt through 8,193-wide chunks: clean stop, no CUDA_ERROR_MISALIGNED_ADDRESS, coherent output |
QSA capacity from --max-seq-len |
QSA: indexer capacity 49152 tokens (max_seq_len=49152) ×12 indexers |
| PLE floor clamp | ATLAS_PLE_MAX_TOKENS=4096 → warn + "clamped UP", 16K prefill fine |
| MTP/QSA inert-bound latch | mtp declined: qsa_active seq_len=16664 num_drafts=1 lim=2051; serial decode continues past the bound |
| Device-side QSA top-k | ATLAS_QSA_TOPK_VERIFY=1 host-vs-device compare on every decode step (~500+ steps × 12 indexers at 16K ctx): zero mismatches |
| Watchdog rollback, plain decode | Two successful rollbacks (rolled back to boundary, re-steering dropped=91, ×2), continued decoding, then CapReached hard stop — no desync at ~16.7K ctx with 12 active indexers |
| MTP engagement | mean_na=0.885 tok_step=1.885, 34.9 tok/s on a short-prompt run |
| Decode throughput | 21.6 tok/s at 30.7K ctx (in the PR's reported band) |
cargo fmt / clippy --workspace --tests / unit tests |
all clean (spark-server 2,328; spark-model 781; kernels/core/runtime ~300) |
Defect found and fixed — rollback desync still reachable under --speculative
rollback_to_boundary gates the snapshot-aware search on has_ssm_layers() && ring.is_enabled(). Under --speculative the decode ring is skipped at model init ("SSM decode-rollback ring: SKIPPED (speculative decode active)"), so a qwen4_exp sequence takes the plain any-boundary search, finds a boundary, and rewinds seq.tokens + KV — but the 12 QSA indexers keep their post-loop ingested counts. The next decode dies on QSA: decode at pos 17116 but 17208 tokens ingested → request 500s.
Reproduced twice on the PR head (16.7K-token prompt, watchdog fired at content_tokens=453, dropped=91 → desync on the very next decode). The NoAuxSnapshot guard added in this PR only runs inside if let Some(slot), so it can't fire when the ring is off.
Fix (14cbecf3): decline with RollbackFallback::NoAuxSnapshot when model.requires_aux_state() && ssm_slot.is_none() — before any buffer mutation. Verified live: same workload now logs ending response early (rollback declined) reason=NoAuxSnapshot and finishes cleanly instead of 500ing.
Defect completed — engine_error coverage gaps
The plumbing covered the single-seq verify steps, mtp_step and the loop-level fault latch, but the same abort→finished→"stop" laundering still applied to ~28 sites: all nine error exits in verify_dflash_batch_step.rs, the batched K=4 verify and K=4 verdict commits, batched MTP bootstrap decode/sample, the self-spec and ngram-spec steps in spec_step.rs, and the per-token EP broadcast in verify_k2_step.rs (the cmd broadcast two lines above it already latched engine_error). Fixed mechanically in 77e0f96c — compile/clippy/fmt clean; not independently runtime-triggered (each is the same a.engine_error = Some(...) pattern the PR uses elsewhere).
Review notes (not patched — worth a look)
- Kernel merge keeps lower lane, not lower index. In
argmax_bf16.cu/argmax_fp32/argmax_bf16_batch*, equal values resolve tos_val[tid]— i.e. the lowest lane holding the max. When equal maxima sit in different lanes with the lower index in the higher lane (e.g. max at index 1029 [lane 5] and 2050 [lane 2] with stride 1024), the kernel returns 2050 while hostargmax_first_wins_f32returns 1029. Byte-identical to the61f69768record kernel, so not a regression — but the new docs claim "byte-identical to n sequential calls / same as torch.argmax", which isn't strictly true. Either add|| (s_val[tid+s] == s_val[tid] && s_idx[tid+s] < s_idx[tid])to the merges or soften the claim. - Residual host last-wins paths (pre-existing, not introduced here).
sample_impl.rs'stemperature <= 0.0branch still usesargmax_last_wins_f32, andsample_step.rs's suppress-ids greedy branch usesmax_by(last-wins). This matches the record tree — the revert is faithful — but the plaintemperature: 0request path (non-spec, or MTP bootstrap sampling) can still diverge from the now-first-wins verify/kernel on exact ties. Worth documenting in the PR so a future reader doesn't think the whole engine is first-wins. - Boundary-dense loops evict eligible snapshots. With an 8-slot ring, a loop whose repeated unit ends in a boundary token (e.g.
checkpoint pass;\n) records a snapshot per line and evicts every out-of-min_keepsnapshot before the watchdog fires — observedNoSsmSnapshotdeclines where a rollback could otherwise have succeeded. Consider recording snapshots only every Kth boundary, or skipping records that would land inside the protected tail. - Latch is permanent.
crosses_inert_boundlatchesdisable_mtpfor the rest of the sequence — correct and conservative, but a sequence crossing the bound mid-generation loses spec entirely rather than falling back to a per-seq verify lane. Fine as designed; flagging as a known trade-off. - Aux snapshot cost.
save_decode_aux_snapshotdoes a fullgpu.synchronize+ D2H ofingested × hd × 2bytes per aux layer per boundary token (~25 MB/layer at 98K ctx × 12 indexers). Bounded by ring slots, but heavy at high context — visible in logs as occasional multi-ms hitches at boundary tokens. - Nits:
_seq_lensinmulti_seq/mod.rsis now used (rename toseq_lens);PleLayer'sgather_doneevent andslots_stagingare never destroyed (bounded, process-lifetime).
Verdict
The PR does what it claims on the paths it targets — every headline fix reproduced clean on the GB10. The two commits on review/pr23-fixes close the speculative-decode hole in the rollback story and finish the engine_error propagation the PR started. Suggest landing those plus deciding on notes 1–3 before merge.
|
Complete gate re-run on the fix head
So the review fixes (rollback |
… on the inherited argmax regression Full suite re-measured on the review-fix head (per-sequence DFlash raw-argmax gate + dflash_head clippy cleanup). gx10-e3a3, NVIDIA GB10 119.6 GB, driver 580.126.09, CUDA 13.0. decode-floor ran --serve-override gpu_memory_utilization=0.92 and bfcl-subset 0.75 — recorded in provenance — because the pinned budgets were sized for a 121.7 GB box. bfcl-subset draws 86.23/83.10 for the third time in a row (9bafa47, 683a0db, 323a7e1): the last-index-wins argmax regression inherited from 0775521, fixed by #23/db0bc097 — not a dflash2 defect. echolp on the 35B subject passes 87.85/87.90.
Follow-up:
|
| Mode | tok/s | notes |
|---|---|---|
| serial | 18.8 | — |
| ngram (fixed) | 25.3 (+34%) | ~93% draft acceptance |
Zero draft-weight memory — the MTP draft module can't even fit this box at 0.85 util, so ngram is the only spec path that serves Flash-Next at tighter memory budgets.
review/pr23-fixes @ eaecc79a: bf90d6dc (QSA commit fix) + 2d4c720a (chains/cache/SSD + off-by-one + gate) + eaecc79a (fmt/clippy). 7 ngram unit tests pass; build + clippy clean.
N-gram A/B results + two more fixes (post-fix heads,
|
| Request | Serial | N-gram | Delta |
|---|---|---|---|
| Greedy essay (temp 0, 400 tok) | 18.7 tok/s | 25.5 tok/s | +36% |
| Sampled story (temp 0.8 / top-p 0.9, 300 tok) | 18.8 tok/s | 18.8 tok/s | 0% (lane declined) |
Acceptance on the greedy arm is ~93% — the dynamic table learns generated-text patterns within the first few steps (prompt-lookup alone never sees them).
Two more bugs fixed after the first report
- Bootstrap hard-argmaxed (
argmax_on_device) — every bootstrap token collapsed to greedy for requests with temperature/penalties/grammar, the same bug class as the DFlash process-wide raw-argmax gate. Now routes throughprocess_seq_logits(full pipeline: penalties, grammar, sampling). Verify-emitted tokens also carry per-tokentop_logprobsnow, matching the K-paths. - Proposer lookup was O(len² · max_match) — scanned every start × every n per step (~250M compares at seq_len 8k, i.e. the "free" CPU proposer would cost more than the decode itself at long context). Now a 2-gram→positions index, incrementally maintained; candidates extend backward newest-first. Also caught by a new regression test: a verify reject pops + refills the tail, so length alone can't detect a rewrite — the index fingerprints the indexed prefix and rebuilds on mismatch.
- Sampled requests now decline the lane — under sampling the verify pick is drawn from the sampled distribution, so deterministic drafts can only match by coincidence; measured −4% before the gate, exact serial parity after.
All 9 ngram unit tests pass; clippy clean; zero new CLI flags/env vars.
|
bfcl-subset FAIL on the nvidia subject — the promised re-run landed, and it fails. Records committed on
Bars: committed min 83.82/83.72 (noise 0.4 → effective 83.42/83.32). Prior unsloth records on the same recipe and draw scored norm 82.2–83.4 (09-03 → 09-11, marginal band). These are the first-ever nvidia bfcl-subset records on this box. Category split vs the 08-14 dgx1 baseline (84.12 norm): hallucination 84.85 → 55.11 (live_irrelevance 47.73, irrelevance 62.50) while simple_java 45.16→67.74 and simple_javascript 29.03→74.19 improved — the suspected-2026-08 template defect partially healed; the new drop is the model emitting tool calls when it should abstain. Classification: not a PR regression — identical on both branches; n-gram vs MTP differ only in noise. Candidate mechanisms, in order: (a) nvidia checkpoint abstention behavior (mixed-precision Decisive bisect (queued for the next GPU window): one bfcl-subset leg on |
2026-09-15 update — nvidia Flash-Next line (
|
…ew note 1) `argmax_bf16.cu`'s header claims the batched kernel is "byte-identical by construction" to n sequential calls because the tree reduction "prefers the lower tid". It does not follow: the strided scan keeps the first strict max WITHIN a lane's stride class, and the merge was `>` only, so equal maxima in different lanes resolve to the lower LANE. With stride 1024 and the max at index 1029 (lane 5) and 2050 (lane 2), the kernel returns 2050 while the host `argmax_first_wins_f32` — and every committed BFCL record — returns 1029. That is a serial-vs-verify divergence on exact ties, in the same class as the tie-break rule the 2026-09-03 incident was about: BF16 logits tie often at temperature 0, and the tie rule alone moved Qwen3.8-27B's BFCL normalized score 83.38 -> 83.10 before it was reverted. All four merges now take an equal value from the higher lane when its index is lower: * `argmax_bf16`, `argmax_bf16_batch` — the plain `>` clause. * `argmax_bf16_batch_lp` — the online-softmax merge keeps its `else` accumulation (the sum is scale-invariant to which side supplies the index) and only fixes the index. * `argmax_fp32` — same clause. The header claim is corrected to say what the merge now earns rather than what the reduction was assumed to imply. `argmax_tiebreak_contract.rs` gains a guard for the clause at every merge site with a negative control, so a revert to `>` cannot pass silently — the existing test only pinned the scans' strict comparison, which is exactly why this gap survived it. ★ NOT verified on hardware. The .cu change is compiled by CI's `nvcc -> PTX (all gb10 targets)` job, but its EFFECT on accuracy is not measurable without a GB10: a tie-rule change moved this gate's score by 0.28 once already. A BFCL leg is queued to measure it before this is trusted; the committed floors (83.12 / 82.05) carry 0.4 of margin for exactly this. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Records what was closed and what was left, with the mechanism named in each case: * note 1 (kernel argmax lane-vs-index) — FIXED in f49be47, with the accuracy measurement explicitly NOT done: the same class of change moved this gate 83.38 -> 83.10 once already, so job 125 measures it before it is trusted. * note 2 (residual last-wins paths) — documented at both sites. * note 3 (boundary-dense snapshot eviction) — open, and named as a policy trade in the rollback watchdog rather than a bug, with the two candidate cures and why neither is verifiable without hardware. * note 4 (top_logprobs) — the review's question answered precisely: serial reports POST-penalty (it extracts after `process_position_logits` folded penalties in place) and every verify lane including n-gram reports PRE-penalty (it re-reads the raw GPU buffer). So the n-gram lane does match the other verify lanes and all of them differ from serial. The contained fix is written out, with the two trade-offs that make it a decision rather than a patch. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ew note 1) `argmax_bf16.cu`'s header claims the batched kernel is "byte-identical by construction" to n sequential calls because the tree reduction "prefers the lower tid". It does not follow: the strided scan keeps the first strict max WITHIN a lane's stride class, and the merge was `>` only, so equal maxima in different lanes resolve to the lower LANE. With stride 1024 and the max at index 1029 (lane 5) and 2050 (lane 2), the kernel returns 2050 while the host `argmax_first_wins_f32` — and every committed BFCL record — returns 1029. That is a serial-vs-verify divergence on exact ties, in the same class as the tie-break rule the 2026-09-03 incident was about: BF16 logits tie often at temperature 0, and the tie rule alone moved Qwen3.8-27B's BFCL normalized score 83.38 -> 83.10 before it was reverted. All four merges now take an equal value from the higher lane when its index is lower: * `argmax_bf16`, `argmax_bf16_batch` — the plain `>` clause. * `argmax_bf16_batch_lp` — the online-softmax merge keeps its `else` accumulation (the sum is scale-invariant to which side supplies the index) and only fixes the index. * `argmax_fp32` — same clause. The header claim is corrected to say what the merge now earns rather than what the reduction was assumed to imply. `argmax_tiebreak_contract.rs` gains a guard for the clause at every merge site with a negative control, so a revert to `>` cannot pass silently — the existing test only pinned the scans' strict comparison, which is exactly why this gap survived it. ★ NOT verified on hardware. The .cu change is compiled by CI's `nvcc -> PTX (all gb10 targets)` job, but its EFFECT on accuracy is not measurable without a GB10: a tie-rule change moved this gate's score by 0.28 once already. A BFCL leg is queued to measure it before this is trusted; the committed floors (83.12 / 82.05) carry 0.4 of margin for exactly this. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…w note 2) The #23 review asked for this to be written down so a future reader does not assume the whole engine is first-wins. It is not: * `sample_step.rs`'s suppress-ids greedy branch and its penalty-aware MTP sibling both use `max_by`, which returns the LAST of several equal maxima; * the verify kernels resolve ties to the lowest LANE (note 1, now fixed to the lowest index) and the host `argmax_first_wins_f32` to the lowest index. Both sites are left as-is — they match the record tree, and changing them would move every committed accuracy number — with a comment naming the rule and the divergence. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…note 6) Review note 6: the underscore said "unused", but the pre-mutation inert-bound guard reads it, so the name was lying. Renamed at its four sites. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Records what was closed and what was left, with the mechanism named in each case: * note 1 (kernel argmax lane-vs-index) — FIXED in f49be47, with the accuracy measurement explicitly NOT done: the same class of change moved this gate 83.38 -> 83.10 once already, so job 125 measures it before it is trusted. * note 2 (residual last-wins paths) — documented at both sites. * note 3 (boundary-dense snapshot eviction) — open, and named as a policy trade in the rollback watchdog rather than a bug, with the two candidate cures and why neither is verifiable without hardware. * note 4 (top_logprobs) — the review's question answered precisely: serial reports POST-penalty (it extracts after `process_position_logits` folded penalties in place) and every verify lane including n-gram reports PRE-penalty (it re-reads the raw GPU buffer). So the n-gram lane does match the other verify lanes and all of them differ from serial. The contained fix is written out, with the two trade-offs that make it a decision rather than a patch. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…bfcl-subset fails on the inherited argmax regression Records produced by `spark benchmark run <gate> --pull-request-gate` on gx10-e3a3 (NVIDIA GB10, 119.6 GB, driver 580.126.09, CUDA 13.0). Two environment notes on this box: * The pinned qwen3.8 serve recipes are sized to dgx2's 121.7 GB. On this 119.6 GB box the committed footprint exceeds the pinned budget (59.8 GB Atlas-own + 43.0 GB reserve vs 101.7 GB at 0.85), so decode-floor and bfcl-subset ran with --serve-override gpu_memory_utilization=0.92/0.75 — recorded inside each record. * ttft-cold/ttft-warm had no prior baseline on this box; they record as info and become the reiner baselines. bfcl-subset: FAIL at normalized 83.10 vs baseline 83.32 (overall 86.23). This is the last-index-wins argmax regression inherited from 0775521 — identical numbers to what #23 documents and db0bc09 fixes — not a dflash2 defect. Re-run after the argmax revert lands. agentic-webserver and bfcl-subset-echolp not run on this box (their subjects are the 3.6 checkpoints; download completed but runs were declined pending a 3.8-scoped bench call).
… on the inherited argmax regression Full suite re-measured on the review-fix head (per-sequence DFlash raw-argmax gate + dflash_head clippy cleanup). gx10-e3a3, NVIDIA GB10 119.6 GB, driver 580.126.09, CUDA 13.0. decode-floor ran --serve-override gpu_memory_utilization=0.92 and bfcl-subset 0.75 — recorded in provenance — because the pinned budgets were sized for a 121.7 GB box. bfcl-subset draws 86.23/83.10 for the third time in a row (9bafa47, 683a0db, 323a7e1): the last-index-wins argmax regression inherited from 0775521, fixed by #23/db0bc097 — not a dflash2 defect. echolp on the 35B subject passes 87.85/87.90.
…fx1151 port, HDIM=128 Option-B fix (#33) * feat(dflash2): add Qwen3.8-27B DFlash2 speculative decoding support - Add DFlash2 dynamic grouped causal convolution kernel and layer wrapping for attention and MLP sublayers. - Add bilinear candidate selector scoring top-k draft candidates with predecessor/successor codebook embeddings and projected hidden states. - Support incoai/Qwen3.8-27B-DFlash2 drafter architecture and weight loader. - Fix SSM pool MTP ladder allocation for γ=8 verify slots via full-width reservation. - Configure MODEL.toml pairing for Qwen3.8-27B with DFlash2. * perf(dflash2): fused on-device bilinear candidate selector kernel Eliminates the 4MB D2H sync and 1.74M float CPU top-k bubble scan in Dflash2CandidateSelector. Moves candidate selection into a fused GPU kernel dflash2_candidate_selector that executes warp-level top-4 reduction, context dot-product scoring, and greedy draft advancement in <0.05ms directly in GPU shared memory. * feat(bench): add MLPerf edge agentic performance leg (2.5h) runner and template * spark-server: accept single-quoted --default-chat-template-kwargs Windows .cmd/.bat launchers can't escape inner double quotes, so the natural Windows spelling --default-chat-template-kwargs '{"enable_thinking":true}' arrives at argv with the single quotes literal (CommandLineToArgvW has no POSIX single-quote semantics) and the flag failed fail-fast JSON parsing. Strip one wrapping '...' layer before serde_json::from_str. No valid kwargs JSON begins/ends with ', so valid inputs are unaffected and typo fail-fast is preserved. Recipe fixture updated to carry the quoted spelling so the recipe -> serve_args path exercises the strip end-to-end. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * bench: gate records for 9bafa47 on reiner — 5 pass, 2 baseline-info, bfcl-subset fails on the inherited argmax regression Records produced by `spark benchmark run <gate> --pull-request-gate` on gx10-e3a3 (NVIDIA GB10, 119.6 GB, driver 580.126.09, CUDA 13.0). Two environment notes on this box: * The pinned qwen3.8 serve recipes are sized to dgx2's 121.7 GB. On this 119.6 GB box the committed footprint exceeds the pinned budget (59.8 GB Atlas-own + 43.0 GB reserve vs 101.7 GB at 0.85), so decode-floor and bfcl-subset ran with --serve-override gpu_memory_utilization=0.92/0.75 — recorded inside each record. * ttft-cold/ttft-warm had no prior baseline on this box; they record as info and become the reiner baselines. bfcl-subset: FAIL at normalized 83.10 vs baseline 83.32 (overall 86.23). This is the last-index-wins argmax regression inherited from 0775521 — identical numbers to what #23 documents and db0bc09 fixes — not a dflash2 defect. Re-run after the argmax revert lands. agentic-webserver and bfcl-subset-echolp not run on this box (their subjects are the 3.6 checkpoints; download completed but runs were declined pending a 3.8-scoped bench call). * spark-model: clippy cleanup in dflash_head (div_ceil, doc list indent, needless borrow) Pre-existing lints in the dflash2 bring-up, flagged by clippy 1.93 deny-all. * scheduler: gate DFlash raw-argmax verify per sequence, not process-wide The --dflash flag made raw-argmax verify apply to EVERY sequence. For sequences whose effective verify pick is not the raw argmax — presence/frequency/repetition penalties, LZ/DRY, grammar, or tool-call EOS suppression — the emitted stream silently followed the unpenalized argmax instead of the request's distribution. This target's non-thinking preset carries presence_penalty=1.5, so it was the common case, not an edge. Now dflash_seq_uses_raw_argmax requires the process flag AND a neutral-greedy sequence (PenaltyGate::Neutral, no grammar, no require_tool_call). Other sequences fall back to the existing pipeline verify, matching what MTP does for the same request. Measured on GB10: identical prompts diverged vs serial only while penalties were active; byte-identical once zeroed. Matches SGLang's reference dflash_worker_v2 semantics: verify logits get per-request adjustments (apply_dflash_verify_logits_adjustments) before acceptance; argmax accept-prefix is the greedy arm only. * bench: gate records for 323a7e1 on reiner — 9 pass, bfcl-subset fails on the inherited argmax regression Full suite re-measured on the review-fix head (per-sequence DFlash raw-argmax gate + dflash_head clippy cleanup). gx10-e3a3, NVIDIA GB10 119.6 GB, driver 580.126.09, CUDA 13.0. decode-floor ran --serve-override gpu_memory_utilization=0.92 and bfcl-subset 0.75 — recorded in provenance — because the pinned budgets were sized for a 121.7 GB box. bfcl-subset draws 86.23/83.10 for the third time in a row (9bafa47, 683a0db, 323a7e1): the last-index-wins argmax regression inherited from 0775521, fixed by #23/db0bc097 — not a dflash2 defect. echolp on the 35B subject passes 87.85/87.90. * greedy: restore first-index-wins argmax tie-breaking (kernel + host paths) 0775521 switched the greedy tie-break from "first strict maximum wins" to "value descending, then higher vocabulary index" in argmax_bf16.cu and moved the host verify argmax and the greedy logit processor to the same last-wins rule. With BF16 logits at temperature 0 exact ties are common, so the rule change moves tokens: on the bfcl-subset gate draw for unsloth/Qwen3.8-27B- NVFP4 it flipped 9 of 207 replayed answers, cost 3 correct ones, and took the checkpoint from 86.53/83.38 to 86.23/83.10 (bars 83.42/83.32) — main itself fails its own committed record under the new rule. Reverting only the kernel on top of main restored all nine samples; reverting the other accumulation-order change in the same commit restored none. First-index-wins is also what llama.cpp's greedy sampler and vLLM's torch.argmax do, so it is the rule the recorded baselines and the other engines share. This restores: * kernels/gb10/common/argmax_bf16.cu — the 61f6976 kernel, verbatim * scheduler/verify_pipeline_helper/argmax.rs — argmax_first_wins * scheduler/verify_pipeline_helper.rs, logit_processors/mod.rs — call the first-wins helper (spark_runtime::sampler::argmax_first_wins_f32) * atlas-kernels/tests/argmax_tiebreak_contract.rs — now locks the first-wins rule instead of the last-wins comparator Co-Authored-By: Claude Fable 5.1 <[email protected]> * bench: gate records for 0bf70e9 on reiner — 9 pass; bfcl-subset FAIL 76.60 norm on nvidia subject * spark-server: resolve --dflash-gamma from MODEL.toml when the flag is absent The clap default (16) shadowed the target's `[dflash] gamma`, so every recipe-driven `--dflash` serve ran γ=16 regardless of MODEL.toml — the serve_args doc comment already admitted the fallback was unreachable. Precedence now mirrors --num-drafts: flag → MODEL.toml → engine default 16, logged once at boot with its source. qwen3.8-27b's `gamma = 8` is the measured Option-B optimum on this box (γ=8 ~22 tok/s vs γ=16 17.8, job 026) and sidesteps the γ=16 second-sequence status-700 fault (job 040 bisect). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * kernels: copy DFlash2 + sink paged-attention kernels to strix-hip Verbatim ports from kernels/gb10/common: dense_gemv_bf16_batchm, dflash_batch_anchor_add, dflash_batch_markov, dflash2_conv, dflash2_candidate_selector, and the three ATLAS_ATTN_SINKS paged wrappers (sink / indirect_sink / batched_sink). The wrappers' LOAD_KV_TILE already matches the strix atlas_cp16 idiom. * atlas-kernels: extend argmax tie-break contract test to strix-hip strix-hip/common/argmax_bf16.cu already implements first-index-wins (it is byte-identical to the post-revert gb10 kernel); the contract test now reads both per-hardware copies so the rule cannot silently regress on either target. * kernels: port batched/indirect/rope-override/sink support to strix-hip prefill header Mirrors the four gb10 features the DFlash2 sink wrappers need, in both the BR=32 kernel and the clamped _64 entry: - non-const kv_len/q_offset; PREFILL_BATCHED gains cu_seqlens/kv_lens (fixing a pre-existing arity mismatch: ops::prefill_attention_paged_batched already passes them) plus the PREFILL_BATCHED_INDIRECT_ARGS batch_indirect_args parameter; - VARLEN per-stream geometry (q_base_b, q_len_eff) and the indirect kv_len/q_offset override; q_batch_off now derives from q_base_b; - q_rope_pos (batch_indirect_args[b*3+2], Q_ROPE_POS_OVERRIDE, default q_offset) feeding the softmax mask row and the sliding-window kv_block_lo loop bound; - ATLAS_ATTN_SINKS epilogue: sink logit joins the denominator in smem_ml, acc_o rescaled via smem_resc on the PV C-fragment map. Default-path codegen is unchanged: with no new macros defined the only deltas are parameter const-ness and the q_len->q_len_eff rename (q_rope_pos == q_offset there). * strix: wire DFlash2 into MODEL.toml + serve-amd.sh kernels/strix-hip/qwen3.8-27b/MODEL.toml gains the [dflash] section (incoai/Qwen3.8-27B-DFlash2, gamma 8, window 4096, mask 248070, layers [5,19,33,47,61]) now that the strix-hip tree carries the kernels; the SCALE strix MODEL.toml keeps DFlash absent with a pointer to strix-hip. serve-amd.sh adds DFLASH=1 (--dflash --draft-model, optional DFLASH_GAMMA), mutually exclusive with the MTP --speculative args. * kernels: register the strix-hip sink-prefill module renames Dispatch asks for prefill_paged_sink / prefill_paged_indirect_sink (the same [modules] renames gb10 declares); without them the new wrappers registered under their raw inferspark_ stems and the DFlash drafter load failed the startup kernel audit. * strix: size the default GPU_UTIL for the DFlash2 drafter The KV budget is computed before the ~5 GB drafter allocates, so the 0.88 default OOM'd the DFlash serve on gfx1151 (cuMemAlloc status 2, 4.2 GB free at a 635 MB request). Default to 0.80 when DFLASH=1; explicit GPU_UTIL still wins. * kernels: HDIM=128 builds of the DFlash sink paged-attention kernels DFlash2 drafters run head_dim=128 (incoai config), but the sink wrappers include prefill_paged_compute.cuh at the default HDIM=256: the tile loaders' HDIM/8-chunk rows and the HDIM/16 QK contraction then read the neighbouring head's data into every score. Adds the _h128 variants (identical source, #define HDIM 128 before the header include) on gb10 and strix-hip, with the prefill_paged_*_h128 module renames matching the existing convention. The batched variant keeps its raw stem like its sibling. * atlas-kernels: allow the 3.8-trained DFlash2 drafter in the qwen3.8 target test The merge of main's target_resolution test asserted [dflash] absent on qwen3.8-27b, but PR21 legitimately added incoai/Qwen3.8-27B-DFlash2 — a drafter trained on 3.8 hidden states. The test now permits exactly that draft_model and still rejects the 3.6-trained one. * dflash: select paged sink attention kernels by drafter head_dim The drafter KV cache is head_dim=128, but Option B dispatched the HDIM=256 sink builds: tile loaders iterate HDIM/8 chunks per row and the QK loop contracts HDIM/16 steps, so each row's dims 128..255 were the neighbouring head's data contaminating every score — the likely source of the Option-B acceptance drop. paged_sink_modules_for_head_dim maps head_dim onto the _h128 builds (128) or the original names (256) and bails otherwise; prefill_attn_dflash_fp8 stays HDIM-256-only (flagged in-code). The acceptance effect is measured in the Strix A/B matrix (strix:~/dp4a-ab/out/dflash-ab-*, this branch). * dflash: route M<=8 drafter BF16 projections through the batched GEMV on gfx1151 Every drafter projection at decode runs at M=gamma rows (gamma <= 8), but dense_gemm_bf16_pipelined is a 128-row M-tile WMMA GEMM — ~94% padded MMA work on gfx1151's ~2-3.5 TFLOPS BF16 WMMA, which is why Option-B propose measured ~358 ms/step on Strix (dflash-h128-20260915T1546Z). The bandwidth-bound dense_gemv_bf16_batchm kernel (MAX_M 8) already covers every gamma the drafter uses. New drafter_dense_gemm() on BlockDiffusionDraftHead picks the batched GEMV when m in 1..=8 and the arm is enabled (default ON under cfg!(atlas_scale), OFF on NVIDIA; ATLAS_DFLASH_SMALL_M_GEMV=1|0 overrides). conv::prepare and selector::select_candidates now take a gemm closure instead of a KernelHandle so callers choose the arm; the legacy non-paged path passes a pipelined-GEMM closure unchanged. precompute_ctx_kv routes both ctx GEMMs through it (prefill-time n is large and falls through to the GEMM automatically). Both arms accumulate in FP32 but are not bit-identical. * strix: default the DFlash2 serve to the paged Option-B drafter path * ci: keep dflash forward_block_layer under the 500-LoC cap * docs(strix): DFlash2 speculative decoding on gfx1151 — port, measurements, known gaps * strix: expose the SSM checkpoint interval as SSM_CKPT_INTERVAL * docs(strix): record the DFlash2 ST-995 golden-draw result * scripts(strix): DFlash2 A/B, leg and concurrency runners * docs(strix): record the GB10 DFlash2 batched-concurrency gap Job 132 concurrency-sweep (nvidia/Qwen3.8-27B-NVFP4, dflash=true + Option-B, gamma=8, bs16, util 0.70): all cells ran clean but aggregate throughput is flat ~24-25.6 tok/s at C1-C16 vs MTP 20.9->85.2 scaling. Documented as known gap / future work in the porting log and committed both gate records (concurrency-sweep + agentic-webserver). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Andrei Vogulkin <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
qwen4_exp: land #23 (review branch) + nvidia/Qwen3.8-Flash-Next-NVFP4 pack, PLE scratch bound, aux-snapshot buffer reuse
Summary
Seven fixes for serving Qwen3.8-Flash-Next (
qwen4_exp) past a few thousand tokens on a single GB10, each found by running the RadixArk NVFP4 checkpoint through a long-form generation benchmark (two-round tower-defense build, 26K-token rounds, 10–18K-token review prompts) onmain@4df6e609. That run needed eleven serve attempts and five distinct workarounds to complete once; with this branch the same benchmark ran end to end on default settings with no environment pins and no server errors.e623e010ATLAS_PLE_MAX_TOKENShonoured below the 8193-wide chunk; n-gram row cache a fixed 65536 slots (a chunk pins 8193 × 16 rows)max_batch_tokens × ngram_heads(power-of-two, floored at 65536), env stays an override; a too-low PLE cap is clamped up with a warning561be215ATLAS_QSA_MAX_TOKENSdefaulted to 32768 regardless of--max-seq-len; decode died at position 32768 with a 500ModelConfig.max_seq_len(serve-time, likemax_batch_tokens); indexer capacity derives from it; env can only raise it16af4d33finishedand the client receivedfinish_reason="stop"— a 1,679-token truncation looked like success; the GDN QKVZ projection swallowed the cuBLASLt error before falling back to the scalar GEMMengine_erroron the sequence →finish_reason="error"(newFinishReason::Error), blocking clients get the error (500); cuBLASLt failure logged with M/N/K and operand low bits35028544/healthwent 503, but the scheduler loop never returned tomain.rs's exit path; the process held ~100 GB and 500'd for hoursf4e81291QSA: decode at pos 2864 but 2932 tokens ingested→ 500save/restore_decode_aux_snapshotonModel(reusescollect_aux_states/apply_aux_states, keyed like the SSM ring), taken with the SSM boundary snapshot;RollbackFallback::NoAuxSnapshotdeclines when missing — see status note below86bdf303seq_len < verify_context_limitat dispatch only; a sequence at 2049 verifies across the QSA inert bound (2051) and the next verify refuses ("QSA selection active for row 1 on the batched ms path")disable_mtponceseq_len + num_drafts + 1 >= limit(mtp_gate::qsa_latch::crosses_inert_bound), plus a pre-mutation guard at the batched multi-seq entry97aa9fa4CUDA_ERROR_MISALIGNED_ADDRESS(1,117-token and default 8,193-token chunks; even widths survived)hc_pre_gemmpacked its scratch as raw byte products;inj_preislay × 8bytes, so an odd slab putup_wt8 bytes off a 16-byte boundary anddense_gemm_bf16_pipelinedfaulted. One shared 256-byte-aligned layout (spark_runtime::buffers::hc_pre_scratch_layout) now both sizes and places the sub-buffersd32605b2merges currentmain(6c5f17da); the one conflict was the nemotron serial early-return and the QSA guard both at the top ofdecode_multi_seq_inner(nemotron first, then the guard).Verification
cargo fmt --check,cargo clippy --workspace --tests(workspace deniesclippy::all),cargo test -p spark-model --lib,cargo test -p spark-server --lib --bins(2,310 tests), plus the touched crates' unit tests. New unit tests: n-gram slot derivation, the aligned scratch layout over odd/even slabs,engine_error → "error",NoAuxSnapshot, the MTP latch table.mtp declined: qsa_active seq_len=2050; the benchmark round trip (9.6K + 13.9K generated tokens, a 10K-token review prompt through an 8,193-wide chunk) ran with zero server errors.CUDA_LAUNCH_BLOCKING=1(grid[80,9]=[10240/128, 1117/128]);compute-sanitizerwas ~100× too slow to reach the failing chunk.Status notes for reviewers
Item 5 is mechanically correct but not yet complete— resolved by items 8 and 9 below (the one-token lag was the token-buffer rewind, not the snapshot).crates/and carries no new records. Happy to re-measure on the GB10 once the base is settled.prompt + max_tokensexceeds the indexer capacity (the mid-stream guards now name--max-seq-len).Second batch (2026-09-04)
6c5b61c3+7db64ccarewind_buffersnow takes the caller's unfed tail (0 at the content-loop / inter-tool-prose site, which runs before the step pushes its token; 1 at the fuzzy detector, which runs after) and pops every fed token from the boundary onwards, so the re-fed boundary token lands exactly where the SSM/aux snapshot expects itdroppeddecoded the boundary token twice at the before-push site (QSA: decode at pos N+1 but N tokens ingested; pure-attention models got a duplicate KV row). A fixeddropped + 1discarded a real token at the after-push site (pos N but N+1 ingested)7db64ccahandle_content_tokenreturnstrueon a rollback; the step drops the token it had just sampled (budget and content count refunded) instead of pushing it953820a0[behavior].use_sampling_preset_penalties_for_core(default true, no behaviour change for any other model); Flash-Next's MODEL.toml sets it false. Tool-calling requests keep[sampling.tools]; explicit request values always winpresence_penalty = 1.5reached every plain chat/completions request. Over a 20K-token single-file build it suppresses every token already emitted: two benchmark runs shipped dead/inert files; with presence 0 the identical engine and sampler wrote a working 51 KB game61f1993bskip_lm_head_quantization()returns true forqwen4_exp(BF16 head by default;--lm-head-dtype nvfp4still forces the packed head)c120f479--attn-proj-dtype bf16keeps the full-attention Q/K/V/O at checkpoint BF16 (dense GEMV/GEMM arms; the BF16 Q/K/V sources are resident anyway, O keeps a copy viaset_o_dense_bf16); validated enum, default unchangedself_attnprojection at BF16 and so does this checkpoint; Atlas requantized them to NVFP4 at loadVerification:
cargo fmt --check,cargo clippy --workspace --tests, and the crate suites (atlas-kernels, atlas-core 171, spark-model 779, spark-server 2,327) at7db64cca. New unit tests:preset_penalties_follow_the_core_opt_in_but_always_apply_to_tools,rewind_after_push_site_keeps_the_unfed_token_out_of_the_count,rewind_leaves_the_boundary_token_for_the_next_decode. On the GB10 with--content-loop-watchdogon: a forced-loop probe produced two fuzzy-detector rollbacks, and a 19K-token build produced three content-loop rollbacks with re-steer — zero indexer desyncs (before item 8 the first rollback failed).Two observations for reviewers, not changed here:
[[0,5],[4,5],[4,1],…, period ~6 tokens), the re-steer dropped the array, the model wrote it again, and the per-sequence cap ended a coherent 21 KB file at 8.4K tokens. Code workloads need it off or a higher--content-loop-min-repeats.ATLAS_D2H_SPIN_SYNC=1andATLAS_PLE_FAULT_THREADS=128are neutral on this model (15.4 tok/s either way). The decode path is graph-vetoed model-wide (QSA host top-k, PLE host hash), with 12 D2H syncs + 36 PLE stream barriers per token; a device-side top-k and an event in place of the PLE barrier are the real levers.Third batch (2026-09-04, from the llama.cpp gap study)
Measured on the same GB10 against llama.cpp serving the same model at 24–25 tok/s (Atlas 15–17). Graph capture was first ruled out as the cause:
GGML_CUDA_DISABLE_GRAPHS=1costs llama.cpp only ~3% (24.8/25.1 → 24.4/24.1 tok/s).69cb6625release_prev_pinsinstead of a full stream sync; stage the slot upload through pinned memory.GpuBackendgainsevent_create/record/synchronize_on_stream/destroywith a sync fallbackad7203f5ATLAS_MOE_DECODE_ARM=groupedroutes every layer's single-token MoE through the tensor-core grouped-GEMM arm (forward_prefill(M=1)); default unchangedmul_mat_vec_qshape), after anncubytes-per-token floor0b9ada13qsa_select_topk: device-side block selection with torch.topk's tie-break (lower index wins), ascending block order, written straight intosel_dev— removes the per-attention-layer D2H copy + host sort + H2D (12 stream syncs per token). BehindATLAS_QSA_DEVICE_TOPK=1;ATLAS_QSA_TOPK_VERIFY=1runs both arms and fails on the first mismatchFull benchmark on this head (ATLAS5, BF16 head +
--attn-proj-dtype bf16, device top-k, 4M-slot PLE cache): 23.2K tokens at 14.7 tok/s and 23.7K at 13.9, a 62 KB game that was playable out of the box with no defects found, versus one logic bug on the previous head. Decode speed is unchanged; the ~18 ms/token gap to llama.cpp is in the decode kernels (MoE GEMV, GDN recurrence, hyper-connection sites), not in host synchronisation, PLE placement or graph capture.Fourth batch (2026-09-06): what the profile said, and the two changes it led to
nsysover 642 decoded tokens (BF16 head, NVFP4 attention, device top-k, 3.9K-token prompt, ~69 ms/token):dense_gemv_bf1673 launches = 24 ms (42%) — 72 of them are the 36 GDN layers' in/out projections, which this loader keeps in BF16 (4.15 GB/token, bandwidth-bound); hyper-connection stage 3 (hc_pre_finish) 97 × 121 µs = 11.7 ms; MoE ≈ 8.3 ms at ~77% of achievable bandwidth (already close to its floor); ~1,000 launches/token. Profile and analytic floors:~/claude/reports/atlas-flashnext-decode-profile-2026-09-06.mdon the bench machine.ATLAS_QWEN4EXP_BF16_GDN=0(existing loader path, no code)e7b6af2fhc_pre_finish_x4: one warp per stream, lanes over 32 output dims — 4× the threads of the thread-per-dkernel. Each (d, s) accumulator still sums r = 0,1,… in one FP32 register (--fmad=false) and the four products fold in s order in one thread: bit-exact (greedy output hash identical to the previous binary).ATLAS_HC_FIN_X4=0keeps the old kernel3fff25afhc_pre_finish: rank loop unrolled ×8 with hoisted loads, same order22321152qsa_select_topk: scores staged in shared memory0acad1c8rollback.rs→rollback_rewind.rschild (rewind_buffers+apply_rollback),ple/layer.rs→seq_state.rschild (PleSeqState,pub(super)fields). No behaviour changeFull benchmark on this head (ATLAS6, watchdog off): 21.6 / 20.3 tok/s on 20.6K-token rounds versus 14.7 / 13.9 on the previous head; llama.cpp serves the same model on this GB10 at 24–25. Quality gate for the NVFP4 GDN requantisation, one sample: the ATLAS6 game shipped with two defects (a helper called by the wrong name, an unbound level variable in the turret loop), each repaired by a literal one-change fix round, and then played through cleanly (four waves, correct gold/score/lives). The previous head's game had one defect. Not conclusive either way; the benchmark pages carry both.
Measured and not adopted:
ATLAS_GDN_FUSED_NORM=1(recurrence + gated norm fused) — no speed change and the greedy output differs, so it is not the bit-exact swap it looks like.--lm-head-dtype fp8/nvfp4add ~1 / ~1.5 tok/s on top of the above at the documented argmax-flip risk.Fifth batch (2026-09-07): greedy tie-break restored to first-index-wins
db0bc097argmax_bf16.cuback to the 61f6976 kernel (first strict maximum wins);verify_pipeline_helper/argmax.rs,verify_pipeline_helper.rsandlogit_processors/mod.rsback to the first-wins helper;argmax_tiebreak_contract.rsnow locks first-winsWhy in this PR: the benchmark gate cannot pass for any engine-touching PR while main's 27B bar (83.32) was measured under first-wins and main decodes under last-wins. First-index-wins is also what llama.cpp's greedy sampler and vLLM's
torch.argmaxdo. If the maintainers would rather keep last-wins and re-baseline the bar instead, this commit is the one to drop.Totals — main as found vs this PR (same model, hardware, prompts)
Decode speed (tower-defense rounds, R1 / R2 tok/s):
main@4df6e609as foundNet against main: +25% on both rounds. Against the BF16-precision configuration the profile-driven changes were measured from: +44%. Per-token cost on the 3.9K-token single-prompt A/B: 69 ms → ~49 ms.
Where it came from (single-prompt A/B, bit-exact unless noted):
ATLAS_QWEN4EXP_BF16_GDN=0)hc_pre_finish_x4(e7b6af2f)0b9ada13)Tried and not adopted: grouped MoE decode arm (3× slower), fused GDN norm (not bit-exact), 4M PLE slots + event-scoped pins (neutral, kept as harmless), D2H spin sync and PLE fault threads (neutral).
Reliability and correctness, main vs this PR:
finish_reason="stop"error/ HTTP 500use_sampling_preset_penalties_for_core), equal footingCost: resident memory ~100 → ~108 GB with NVFP4 GDN, which cuts the KV budget from 21 to 14 GB at 0.95 utilisation (48K instead of 64K practical context on a 128 GB GB10).
Other models: all ten PR benchmark gates PASS at this head (records committed). bfcl-subset on Qwen3.8-27B is back at 86.53 / 83.38 after the tie-break revert; the miss it showed under main's last-wins rule reproduces on main's own binary and harness (see "PR benchmark gate" below).
Still open (the last 13% to llama.cpp): BF16 lm_head ≈ 6 ms/token, the remaining hyper-connection launches ≈ 5 ms, conv1d launched separately from the GDN recurrence ≈ 1 ms (existing fused kernels are not bit-exact), ~1,000 launches/token of gaps.
PR benchmark gate (gb10) — all ten PASS at head
db0bc097(records commit3d922247)0acad1c8(last-wins, 2026-09-07)db0bc097(first-wins restored, 2026-09-08)Two gates needed a second run at
db0bc097: decode-floor's first attempt died before serving ("No memory left for KV cache") because the previous gate's server had not yet released ~3 GB — a settle-time artefact; concurrency-sweep's first attempt was INCONCLUSIVE because one of the eight natural prompts at conc 8 paraphrase-looped and the SimHash watchdog cut it at 243/320 tokens, below the sweep's 80% vacuity floor. On the re-run the same prompt was cut at 309 and every floor was met. That loop is greedy-path behaviour of this checkpoint under first-wins (the last-wins run did not hit it) — worth knowing when reading the vacuity rule.The rest of this section is the investigation that led to the revert, kept for the record.
The bfcl-subset miss is main's, not this branch's. Three checks:
main@077552182d(the sha of the committed passing record), served with the recipe's exact flags and driven by main's own harness on the same 995-sample draw, scores the identical 86.23 / 83.10 on this GB10 today.2026-09-03-077552182drecord repeats the2026-09-02-61f69768measurement to the digit, sm clocks included — it is a re-stamp, not a measurement of 0775521. Between 61f6976 and 0775521 theqwen3.8-27bkernel target grew from 182 to 198 PTX modules;07755218(nemotron-lightning) changes shared GB10 kernels the 27B compiles —prefill_paged_compute.cuh,argmax_bf16.cu,w8a16_gemv_batch4.cu,mamba2_ssm_decode.cu, the paged-sink prefills. The per-subset movement (parallel −2, parallel_multiple −1, simple_javascript −1, simple_python +1 of 995; hallucination and live subsets unchanged to two decimals) is what a few argmax flips look like.The record is committed as measured so the gap stays visible.
Root cause, bisected (2026-09-07 evening). The 27B's greedy outputs moved because
07755218changed the greedy tie-break contract, not because of anything numeric.kernels/gb10/common/argmax_bf16.cuwent from "first strict max wins" (lowest vocabulary index on a tie) toargmax_other_better: value descending, then highest index wins; the host paths (verify_pipeline_helper/argmax.rs→argmax_last_wins_f32,logit_processors/mod.rs) were switched to the same rule. With BF16 logits at temperature 0, exact ties between top candidates are common, so the rule change flips tokens.077552182dvs61f69768(the tree that scored 83.38), 207-sample overlap of the three moved subsets61f69768argmax_bf16.cureverted to its 61f6976 versionw8a16_gemv_batch4.cureverted (the other accumulation-order change)On those nine samples the old rule answers 5 correctly and the new rule 2 (e.g.
simple_javascript_18: gravity9.81→9.8;parallel_65/parallel_15: the second and third parallel calls are dropped;parallel_9:5:00 PM→5 pm) — a 3-sample loss that is exactly the 86.53 → 86.23 overall movement on n=995. The committed 83.38 record and the 83.32 bar were measured under the old rule; main decodes under the new one and scores 83.10 on this box. So the bar forunsloth/Qwen3.8-27B-NVFP4is stale relative to main's own greedy contract, and any PR measured today inherits the miss. Two ways out, both upstream: re-measure and lower thebfcl-subsetbars for this checkpoint under the last-wins rule (main itself: 86.23 / 83.10), or revisit the tie rule. Nothing in this PR touches it.Long-horizon agentic check on this head (2026-09-09, four hours, 98K context)
Seven-phase, test-driven build of an idle RPG in Rust + Yew/wasm on the ATLAS6 serve pins with
--max-seq-len 98304, one Atlas session, native tool calling (qwen3_coderparser), driven by a harness with an orientation packet, a read budget, a scope fence with logged overrides and an independent verify after every phase. Report with every prompt, transcript, trace, harness verification and crate snapshot: https://andrei.monkeycode.io/bench/rpg-atlas/ (this supersedes the 2026-09-08 six-phase run, whose harness lessons went into this one).todo!()<tool_call>once; harness bug → forced summaryEngine findings:
stop.--tool-max-tokens/--max-inter-tool-prosestayed at 32768 and never fired (largest generation 12,155 tokens, the largest of both runs, at 19.9 tok/s).read_filecalls a loop (score 0.725, run_length 3) and hard-masked the<tool_call>token for one turn, producing a prose turn and an empty turn. For agentic serving setATLAS_LOOP_NO_SUPPRESS=1. Not seen in the previous run.Continuation on the same head (2026-09-09/10, 10 h + 8 h, harness v4)
The crate above was continued with harness v4 (compile gate → fresh-context repair rounds, 16K-char write cap + append, git-backed revert, region-only reads) for ten hours, then eight more. Report with every prompt, transcript, trace, verification and per-round crate: https://andrei.monkeycode.io/bench/rpg-atlas-10h/ — the game, hand-wired by the reviewer after the run (labelled): https://andrei.monkeycode.io/bench/rpg-atlas-10h/game/
ATLAS_LOOP_NO_SUPPRESS=1; loop detector did not interfere)Engine takeaway: decode is context-independent on this stack; prefill is the agent's cost model — rounds at 8–30K tokens ran 20–90 s per step and built the game, phases at 45–56K ran 3–5 min per step and wrote nothing. Keep agent turns under ~25K tokens, or serve with a larger prefill chunk than 8192 if memory allows.
Tested serve configurations (Atlas + Qwen3.8-Flash-Next, DGX Spark GB10)
Every benchmark round used the same line, with the head, env pins and extra flags per iteration below. Prod (
llama-flashnext) is stopped first — 128 GB unified memory is one pool.--max-seq-len4df6e609 (main)ATLAS_QSA_MAX_TOKENS=65536 ATLAS_PLE_CACHE_SLOTS=524288 ATLAS_PLE_MAX_TOKENS=20500--max-prefill-tokens 20480 --content-loop-watchdog false97aa9fa4— (PLE cap derived from --max-prefill-tokens: 8212)--content-loop-watchdog falsecb6b1a59—--content-loop-watchdog false7db64cca—--attn-proj-dtype bf16 (BF16 lm_head is the new default)0b9ada13ATLAS_QSA_DEVICE_TOPK=1 ATLAS_PLE_CACHE_SLOTS=4194304--attn-proj-dtype bf16 --content-loop-watchdog falsee7b6af2f (fix rounds at 22321152)ATLAS_QWEN4EXP_BF16_GDN=0 ATLAS_QSA_DEVICE_TOPK=1 ATLAS_PLE_CACHE_SLOTS=4194304--lm-head-dtype bf16 --attn-proj-dtype nvfp4 --content-loop-watchdog falseCommon to all: temperature 0.7 · top_p 0.8 · max_tokens 26,624 ·
chat_template_kwargs.enable_thinking=false. From ATLAS3 on,presence_penalty 0 · top_k 40 · min_p 0.05are pinned in the request so the MODEL.toml non-thinking preset (presence 1.5) does not apply — what llama.cpp had been getting all along (seeuse_sampling_preset_penalties_for_core).Single-prompt A/B variations (3,882-token prompt, 1,200-token greedy generations, watchdog off,
--max-seq-len 49152,--max-prefill-tokens 8192; no game built):ATLAS_QSA_DEVICE_TOPK=1 ATLAS_PLE_CACHE_SLOTS=4194304--attn-proj-dtype bf16same--lm-head-dtype bf16 --attn-proj-dtype nvfp4same--lm-head-dtype nvfp4 --attn-proj-dtype bf16same--lm-head-dtype nvfp4 --attn-proj-dtype nvfp4+ ATLAS_QWEN4EXP_BF16_GDN=0--lm-head-dtype bf16 --attn-proj-dtype nvfp4samesamesame--lm-head-dtype fp8 --attn-proj-dtype nvfp4same--lm-head-dtype nvfp4 --attn-proj-dtype nvfp4+ ATLAS_GDN_FUSED_NORM=1same as ATLAS6+ ATLAS_MOE_DECODE_ARM=grouped--attn-proj-dtype bf16ATLAS_QSA_DEVICE_TOPK=1 vs unset--attn-proj-dtype bf16ATLAS_PLE_CACHE_SLOTS=4194304--attn-proj-dtype bf16ATLAS_D2H_SPIN_SYNC=1 · ATLAS_PLE_FAULT_THREADS=128--attn-proj-dtype bf16—llama-server graphs on/offReference, the prod engine on the same box:
Decision log — ATLAS6 (2026-09-06)
Full log for every round, ATLAS → ATLAS6, with commits, files and measured impact: https://andrei.monkeycode.io/bench/decisions/
Decision: measure instead of estimate. Two source-level investigations and three executed items (device-side QSA selection, PLE event/pinned staging, MoE arm selector) had moved decode by at most a few percent, and a graph on/off measurement on llama.cpp (24.8/25.1 → 24.4/24.1 tok/s with
GGML_CUDA_DISABLE_GRAPHS=1) had ruled out capture. So: onensyswindow over 642 decoded tokens (BF16 head, NVFP4 attention, device top-k, 3,882-token prompt, ~69 ms/token).What the profile said
dense_gemv_bf16: 73 launches/token, 24 ms (42%). One is the BF16 lm_head; 72 are the 36 GDN layers' in/out projections, which the loader keeps in BF16 — 4.15 GB/token, bandwidth-bound at that precision.hc_pre_finish: 97 × 121 µs = 11.7 ms; withhc_pre_down/hc_pre_stage/hc_post≈ 17.5 ms (27%) for ~1.25 GB of weights whose floor is ~5.4 ms.moe_expert_gate_up_shared+silu_down_shared+ top-k/blend): ≈ 8.3 ms for 1.46 GB ≈ 77% of achievable bandwidth — already near its floor, so the vectorised-GEMV proposal was dropped.Changes made, in the order they were measured (each speed at the 3,882-token prompt, sparse selection active; each engine change proven bit-exact by a greedy 160-token output hash against the previous binary before its speed was recorded)
ATLAS_QWEN4EXP_BF16_GDN=0— requantise the GDN projections to NVFP4 through the loader path that already existed (qwen4_exp.rs:237; its note that GDN bandwidth "is not what bounds decode" dates from a 2.2 tok/s configuration)3fff25afhc_pre_finish: rank loop unrolled ×8 with hoisted loads, same accumulation orderkernels/gb10/qwen3.8-flash-next/nvfp4/hyper_connection.cue7b6af2fhc_pre_finish_x4: one warp per hyper-connection stream, lanes over 32 output dims (4× the threads); each (d, s) accumulator still sums r = 0,1,… in one FP32 register under--fmad=false, the four products fold in s order in one thread — this splits the four independent accumulators across warps, not one accumulator across lanes, which is the reassociation the kernel's note had rejected.ATLAS_HC_FIN_X4=0revertshyper_connection.cu,crates/spark-model/src/layers/ops/hyper_connection_lowrank.rs,hyper_connection_lowrank_gemm.rs22321152qsa_select_topk: block scores staged in shared memoryqsa_indexer.cuMeasured and rejected:
ATLAS_GDN_FUSED_NORM=1(recurrence + gated norm fused) — 20.1 / 20.4, no gain, and the greedy output differs, so it is not the bit-exact swap it looks like.ATLAS_D2H_SPIN_SYNC=1,ATLAS_PLE_FAULT_THREADS=128— neutral. FP8 / NVFP4 lm_head — +1 / +1.5 tok/s on top of step 3 at the documented argmax-flip risk; not adopted. The precision halves separately at this context: head BF16 + attention NVFP4 15.0, head NVFP4 + attention BF16 14.7, both NVFP4 15.6, both BF16 13.8.Full benchmark on
e7b6af2f(ATLAS6, watchdog off): 20.6K-token rounds at 21.6 / 20.3 tok/s (previous head 14.7 / 13.9). Game: shipped with two defects — a helper called by the wrong name at reset, an unbound level variable in the turret loop — each fixed by a literal one-change round; a console-error round in between echoed the file unchanged. Then four waves cleared with correct gold, score and lives. One sample, so the NVFP4 GDN requantisation's quality gate is neither passed nor failed (the previous head's game had one defect).Left on the table, from the same profile: BF16 lm_head ≈ 6 ms/token (precision decision),
hc_pre_downand the remaining hyper-connection launches ≈ 5 ms, conv1d launched separately from the GDN recurrence ≈ 1 ms (the existing fused kernels are not bit-exact), ~1,000 launches/token of gaps. llama.cpp on the same GB10: 24–25 tok/s.🤖 Generated with Claude Code
Decision log — tie-break revert (2026-09-07)
db0bc097restore first-index-wins greedy tie-breakkernels/gb10/common/argmax_bf16.cu,scheduler/verify_pipeline_helper{.rs,/argmax.rs},scheduler/logit_processors/mod.rs,atlas-kernels/tests/argmax_tiebreak_contract.rsw8a16_gemv_batch4.cureverted → 0/9; PR+revert → 9/9; old rule 5/9 correct vs 2/9