Repository navigation
Train 2026-11-25: Inkling 2 stack (#414-#418, #408), DFlash2 tree lattice (#369), Inkling AMD (#412, #413) - #421
Conversation
…ts offset #328's 32-candidate selector (48cfe3c) sized the shared selector scratch for K=32, but tree_lattice still located the merged top-K lists as scratch_bytes - lists_bytes(K=16). The 16-candidate kernel writes them past its own K=16 slice lists (df2_sel_scratch), so the host read the wrong bytes: the tree's candidates were garbage (duplicate siblings, the #368 500) and no draft was ever accepted. dflash2_selector_lists_offset(gamma, max_top_k) now mirrors the kernel layout per build, and scratch_bytes is derived from it. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…uild.rs (sampling.rs back under the 500-line cap) Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
q, k, v, the relative-bias and gate projections, the sinks and the dynamic convs' taps ran as six to eight GEMV launches a visit, each small (24 to 3,072 outputs over K = 2,304). inkling2_proj_gemv runs them as one: each segment of a per-visit device table (written once the shared buffers attach, one a row count up to 8) is one projection's input rows, weight and output, and every output row is the chain dense_gemv_bf16_batchm computes for it (the common body now takes its block index). A visit with a quantized projection (Spark weights) keeps one launch each. Observed on one GB10, plain Strict decode (no drafter), saver size, greedy text and the six-prompt concurrency hashes identical to engine d1b138e: C1 code/prose 35.84/35.87 -> 36.37/36.37 tok/s (server rate, 3 runs), aggregate C2 51-53 -> 52-55, C4 79-80 -> 80-82, C8 115-118 -> 118-120 (2 rounds of 2 runs). Co-Authored-By: Claude Opus 5.5 <[email protected]>
`--tool-guard stream` screens the same calls as `on`, at the same point (each call's end, and the aggregate size bound as bytes arrive), but sends a call's header and arguments as they are written instead of holding them until the call passes. A call it blocks, or one the response cuts off, ends the response `content_filter` (not `tool_calls`) with STREAMED_REFUSAL, which says part of the call streamed and that it must not be run. Poolside v1 calls stay held: its detector buffers them anyway. `off` and `on` are unchanged, and `off` stays the default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`pc_plan_branch` returned early for a model with no SSM layers, so `ATLAS_GLM_PC_BRANCH` never planted a checkpoint for Inkling 2, whose prefix hits resume from its short-conv state on the same snapshots. Gate on `snapshot_prefix_state()` instead, the gate the prefix lookup already uses (identical for SSM models). For a client that rebuilds its last few messages every turn (a voice rig: system, history, then three trailing user blocks re-rendered each turn), every user turn diverged ~500-700 tokens before the previous prompt's end and restored from the cold prefill's chunk boundary, replaying a growing 4.1-5.1K tokens. With the switch on (min 512), the first such turn plants a checkpoint at the divergence and later turns restore there. Observed, single run, one GB10, Strict, saver flags (prefix caching, 64 slots, chunk 4096), 16.4-17.4K-token prompts, 8 turns: user-turn TTFT 1.33-1.73 s -> 0.61-0.82 s (the planting turn 1.33 -> 1.49 s); follow-ups unchanged at 0.29-0.32 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`tool_choice` required (or a named function) constrains the output to the Hermes grammar, so the model writes `<tool_call>` text with no Inkling block header. The rewrite passed that through without the think end, so a streamed request with thinking on read the call as reasoning and the in-think leak guard cut the response (finish `length`, guard `in_think_tool_leak`); effort none and the blocking path were unaffected. Text between blocks now closes the reasoning first, as a text block does. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Inkling 2 Mini takes images; the target served text only. This adds its tower (`model.visual.*`, transformers `Inkling2VisionModel`) as a third `VisionTower`: - config: `vision_config` (`inkling2_vision`) parses to a `VisionConfig` with the new `is_inkling2` marker; the image token is the processor's `<|unused_200054|>` (200054), which `config.json` does not carry. - preprocessing (`vision_preprocess/inkling2.rs`): no resize. The image is padded to 40x40 pixel tiles (padding -1 on the 0-255 scale, alpha on the reference checkerboard), one token per tile, patches emitted tile by tile. An image of more tiles than the encoder holds is scaled down first (the reference has no such bound). Video is refused. - tower (`inkling2_vision.rs`): Linear patch embed, CLS token, a learned 32x32 position table resampled bilinearly per image, pre-LayerNorm, 23 blocks with axial 2D RoPE on Q/K and layer scale, then a bias-free projector over each 2x2 block. It runs on the shared `vision_encoder` kernels (the nemotron file, symlinked): q/k rows are permuted per head at load from the reference's interleaved rotation pairs to the kernels' halves, and layer scale is folded into out_proj / c_proj. - prompt: the template writes one image token per image; `expand_vision_pads` repeats it per tile (no start/end markers). - embedding norm: the reference norms token embeddings inside the embedding and scatters image features in afterwards. The first visit normed its whole input, which also normed image rows (coarse content survived, text in an image did not). The table is now normed once at load, in place, with the same kernel and epsilon, and no visit norms; the drafter's anchor row skips its own copy of that norm (`embed_norm` NULL). Checked on one GB10 (Strict, development build): tower output against the transformers implementation on a 760x300 text image (152 tokens): mean row norm 5.437 vs 5.432 (float32), sampled values within 0.003; an invoice image transcribed exactly, a 3x3 labelled colour grid read 9/9. Greedy text of three text prompts byte-identical to d1b138e after the norm moved. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…l stops at the depth
Two sequences always verified the drafter's whole block (`batch_depth`
took the table only from three), so `ATLAS_DFLASH_BATCH_DEPTH=...,2:3`
still ran 16-row verifies. An operator's table now bounds two sequences as
well; without one nothing changes (the default table's 7 is what two
sequences had, and a 15-draft drafter keeps its block).
Inkling 2's DSpark tail ran all seven recurrent draft steps whatever the
step would verify. It now runs the step's depth
(`InklingScratch::set_tail_steps`); a shorter tail runs eagerly and the
captured tail graph stays the whole block's.
Observed on one GB10 (Strict, short code, 256 tokens a request, two
rounds, development build), aggregate tok/s:
two sequences plain 53.7-54.2; 2 drafts 54.7-55.8; 3 drafts 52.8-54.4
(before: any table at two ran 7 drafts, 38-45)
per step at two, 2 drafts: verify 6 rows 56.2 ms, propose 18.6 -> 13.9 ms
four sequences, 1 draft: 66.8-69.7 against 79.4 plain (propose 25.6 ms)
Four sequences still lose: each sequence proposes alone and reads the
vocabulary head once (about 3.8 ms each).
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…tops paying decodes plain With two live sequences each DSpark propose runs alone and reads the target's vocabulary head once for its block. A step that verifies two drafts per sequence needs three head rows of each, so the scheduler now brackets a step's per-sequence proposes (`mtp_group_begin` / `mtp_group_finish`): each propose's tail hands its normed rows, its recurrent context and its anchor to the group, which runs the head once over all held rows, then each member's draft steps, and reads the drafts back in one copy. A propose that captures its graphs keeps its own tail. The draft steps moved to `inkling_tail.rs` unchanged, shared by both paths. The adaptive rule (`ATLAS_DFLASH_ADAPTIVE`) judged every step against a whole block's threshold, and the batched DSpark verify never acted on its verdict. A step narrower than a block is now judged with its batch: the members' pooled mean accepted against the threshold scaled to the rows the step verifies. A batch below it proposes nothing and decodes plain, batched, until the re-probe; the members stop together because a batch that drafts for one sequence and not the other runs two forwards a step. Whole-block steps are judged as before. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness: two 700-token code requests 72.7-74.1 tok/s aggregate with two drafts each against 52.7-54.8 plain (Strict), 82.8-86.3 against 73.6-75.1 (Spark); two 500-token prose requests 54.5-56.2 (Strict, level with plain) and 67.0-72.2 against 75.6-76.1 (Spark, where the pair hold recovers most of a 62-65 loss but not all of it). A group's propose for two sequences took 10.2 ms against 18.6 ms. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…p where the drafter is unsure `ATLAS_DFLASH_CONF_WIDTH` sizes a verify from the drafter's own confidence in its drafts (`dflash_conf_width`), but only the DFlash2 selector reported any. Inkling 2's recurrent tail now does: a new kernel, `inkling2_dspark_pick`, takes a draft row's argmax (lowest index among equal maxima, as `argmax_bf16`) and the log-probability of that pick under the softcapped logits the reference samples from (`markov_logits`), and the tail writes the confidences after the block's tokens, where the head's readback and `draft_conf` already look. Off (the default) the tail launches `argmax_bf16` as before. A step's group (two live sequences) does not report confidences; its steps are two drafts wide. The reference turns adaptive verification off for this drafter (`Inkling2DSparkSpeculator` asserts `not enable_adaptive_verification`). Observed on one GB10, dev build, other services resident (0.5 of GPU memory), RigMark decode suite, reasoning low, preliminary and single-harness: over 3,046 full-width verifies the target accepted 98% of drafts with confidence above -0.01, 84% in [-0.03, -0.01), 45% in [-0.5, -0.35) and 6% below -1.5. With the rule on (tau 0.3) and drafts never suspended, a Strict drafted step took 52-56 ms against 76-80 ms and code decode read 65.0 tok/s against 57.4-60.2. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…be starts short The suspension rule held every verify step to a whole block's threshold. With a verify width rule on (`ATLAS_DFLASH_CONF_WIDTH`, `ATLAS_DFLASH_ADAPTIVE_WIDTH`) most steps offer two or three drafts, so a threshold of two accepted suspended nearly everything (Inkling 2, Spark weights: structured output 62.6 tok/s against 95). Each step now owes a share of the threshold: a quarter for its propose plus three-quarters scaled by the drafts it verified. A whole block owes the threshold, as before. The wait before a re-probe was the fixed interval (256 tokens), which overshoots: code that drafts badly through a comment drafts well again a few tokens later. It now starts at an eighth of the interval and doubles with each probe in a row that fails, to four times it, and resets when a window pays. Prose ends up probed less often than before; code is back in a few dozen tokens. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), RigMark decode suite, reasoning low, two runs each, the throughput gate bypassed (`ATLAS_MTP_GATE_FORCE=1`) and confidence widths on, preliminary and single-harness. Strict, threshold 2.0: code 64.7 tok/s (64.7-64.7), prose 36.3 (36.2-36.4), structured 91.8 (90.5-93.1); with the first wait at a quarter of the interval and the gate on, code 58.0. Spark, threshold 2.5: code 75.2 (73.7-76.8), prose 54.8 (54.7-55.0), structured 100.6 (99.4-101.8); at 3.3: 72.6 / 55.4 / 99.1. SparkInkling 0.4.1's release figures for the same cells, measured with nothing else resident: Strict 54.2 / 35.0 / 79.9, Spark 68.4 / 54.9 / 95.3. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… is the text without A verify run of one sequence took the tensor-core prefill attention body, and a run of several sequences the decode body with unsplit keys. Both sum a row's keys in another order than a decode row does (32 key splits), so a verified token's logits could differ from plain decode's by one BF16 step. That is enough to turn a tie: on a prose prompt plain decode scored " for" and " with" equal and picked " for"; the verify put " with" 0.125 ahead, and the two texts parted there. `attn_body` now sends every row of a verify run (up to MAX_VERIFY_ROWS rows a sequence, while the partials scratch holds them split) through the decode body at the decode's key splits. Prefill chunks keep the tensor-core body, and several sequences' prefill rows the unsplit decode body. A prefill chunk of 16 rows or fewer also takes the decode body now. Routing the experts, the router logits and the vocabulary head through their one-row kernels changed nothing in the same test; attention alone made the texts match. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness. Greedy text, reasoning low, 8 prompts (4 code, 4 prose) x 320 tokens, sha256 of reasoning and answer: with drafts off, drafts always on, and confidence widths with the suspension rule, one request at a time and two at once, all 8 texts were identical in every pairing, in Strict and with the Spark overlay (before: the prose prompt parted after 297 characters of reasoning). The verify forward measured 58.7-63.0 ms against about 66 ms, and the RigMark decode suite read Strict 65.2 / 36.1 / 91.9 tok/s and Spark 77.7 / 55.2 / 100.3 (code / prose / structured), level with or above the runs before it. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The pair rule scaled the block threshold by the rows a step verifies, anchor row included (three of eight for two drafts: 0.75 accepted a sequence at a threshold of 2.0). The batch pays for one row a sequence whether it drafts or not, so only the draft rows are extra: two of eight, 0.5. That is where drafting for two Inkling 2 requests was measured to break even with the checkpoint's weights, and 0.625 at the Spark overlay's threshold of 2.5 against a measured 0.64. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness: two 700-token code requests 74.7 and 73.8 tok/s aggregate (at the old scale 73.1 and 63.4, the slower run held five times) against 54.7-55.1 plain; two 500-token prose requests 53.4-53.7 against 54.8-54.9 plain. Text identical to plain decode in both. Co-Authored-By: Claude Fable 5.2 <[email protected]>
A local decode batch is padded to the captured-graph ladder (2, 4, 8 rows), so three Inkling 2 sequences ran as four rows and five to seven as eight. Each of its rows reads its own experts (about 1.7 GB, 6 ms on one GB10) whether or not a sequence is behind it, and its layers take any row count. Up to eight sequences it now dispatches the exact width, one captured graph a width, as the distributed GLM lane already does (`decode_dispatch_width`); past eight, and for every other model, the ladder is unchanged. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), checkpoint weights, plain batched decode, 250-token code requests, aggregate tok/s, two rounds each, preliminary and single-harness: requests padded exact 3 57.1, 57.7 65.8, 67.5 4 82.7, 80.2 81.4, 81.9 5 77.5, 79.0 90.8, 93.0 6 89.4, 89.1 102.7, 103.0 7 101.0, 101.3 113.2, 112.5 8 120.2, 119.8 120.1, 120.2 Padded, five requests delivered fewer tokens a second than four. Every request's text was identical before and after. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…, #404, #406, #410) into the images follow-up Two conflicts, both from the split of 401: layers/inkling2/mod.rs declares owner_runs and proj, and inkling2_proj_gemv joins the PDL list in its new file pdl_inkling2.rs. The tree equals this branch's five commits replayed onto main. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…to the drafting follow-up The tree equals this branch's twelve commits replayed onto main. Co-Authored-By: Claude Fable 5.2 <[email protected]>
With the Spark overlay a visit's q, k, v, relative-bias and gate projections are NVFP4 and its sinks and dynamic-conv taps BF16, so the fused `inkling2_proj_gemv` (BF16 only) did not apply and a decode row ran six to eight GEMV launches a visit. `inkling2_proj_gemv_mixed` runs them as one: each segment of a 48-byte table names its weight, and an NVFP4 segment's block scales and global scale; every output is the chain its own kernel computes (`w4a16_gemv`'s body for NVFP4, `dense_gemv_bf16`'s for BF16), so the text is unchanged. It is used for one decode row where the target ships the kernel and no NVFP4 weight has per-row scales; more rows keep one launch a projection. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness: greedy text for 8 prompts x 320 tokens identical with the kernel and without; a Spark decode step 18.81 -> 18.16 ms with 1,707 -> 1,453 launches a token (nsys); RigMark decode suite, two runs each, code 77.7 / prose 56.9 / structured 100.8 tok/s against 77.7 / 55.2 / 100.3 before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inkling's DSpark drafter proposed one sequence at a time: with eight live sequences a step ran eight drafter forwards, eight vocabulary-head passes and eight Markov tails (52 ms for one draft each, 77 ms for seven, against 66 ms for the whole plain decode step). It now takes the staged batched propose generic DFlash uses: the drafter layers and the head run once over every sequence's block (`batch_propose.rs`), with Inkling's two additions (`inkling_batch.rs`): - before the layers, each sequence's block input (its anchor's embedding, then `mask_embed`) in one launch, and its recurrent-head context row from the newest of its accumulator rows; - after the head, the recurrent Markov tail for every sequence at once: the gate context, gate and pick kernels take a sequence dimension, and the fold over the vocabulary head (105 MB) is read once a step for up to eight sequences (`dense_gemv_bf16_batchm`, row-exact with the one-row GEMV). The pick adds the bias as `bf16_residual_add` does, so the tail's drafts are the serial tail's for the same base logits. Context projection stays per sequence (`batched_ctx.rs`): Inkling mixes its taps per draft layer. `propose_batch_max` no longer pins Inkling to one sequence; the shared head pass (`inkling_group.rs`) remains for servers without the staged path. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness. Greedy text for 8 prompts x 320 tokens with drafts on, two and four requests at once, was identical to drafts off one at a time, with the checkpoint's weights and with the Spark overlay; no batched-propose fallbacks or engine errors. A propose step for one draft each took 13.3 ms at four sequences (was 13.8 with the shared head pass), 16.6 ms at six (was 38.3) and 20.4 ms at eight (was 52.1); for two drafts at two sequences 10.9 ms (was 10.2). Eight 250-token code requests with one draft each read 96.8-96.9 tok/s aggregate, up from 79.9, and six 92.3-94.8, up from 77.5-78.7: still under plain decode (120 and 103), because a verify of nine rows or more leaves the decode kernels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps batch_propose.rs under the 500-line cap (it reached 504). No change in behaviour. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ting is exact at any concurrency A verify of more than eight rows (several sequences, or a deep block) left the decode kernels: projections and the router went to the BF16 tile GEMM, a Spark NVFP4 projection from 16 rows to the checkpoint's BF16 weight, the message gates to their fused MMA kernel, the routed experts to the tensor-core prefill GEMMs with quantized inputs (the checkpoint's prefill numerics), and the BF16 head to the tile GEMM. Text with drafts then differed from text without, and run to run. A verify run (journaled rows) now takes decode's kernels at every row count: projections, the router and the head in passes of the batch GEMV tiers (8 rows BF16, 15 or 16 NVFP4), the two unfused message gates, and the experts through the decode path (`moe_batched`). Each row is the one serial decode computes. Prefill rows and plain batched decode are unchanged. Observed on one GB10, dev build, other services resident (0.5 of GPU memory), preliminary and single-harness. Greedy text for 8 prompts x 320 tokens with drafts on at four and at eight requests, one draft each and seven each (64-row verifies), was identical to drafts off one at a time, with the checkpoint's weights and with the Spark overlay. Eight 250-token code requests, tok/s aggregate, Strict: one draft each 105.7-106.3 (97 before; plain 116-121), seven each 77.5-77.7 (97-102 before: the decode experts cost more than the tensor-core GEMMs at 64 rows); eight prose requests 94-95 and 52. Spark: one draft each 102.0 (plain 125-132), seven each 75.4. Drafting past two requests still trails plain decode, and SparkInkling does not draft past two. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under `--tool-guard stream` every request got its tool calls as they were written. A client that does not read `content_filter` would run a call the guard blocked at its end, or an unclosed one. A request now gets streamed tool calls only with the body field `stream_tool_arguments: true` (an Atlas extension on /v1/chat/completions); without it the call is held, and the response is the same as under `--tool-guard on`. This covers the generic stream path and the Poolside v1 string-argument path. Under `on` and `off` the field is accepted and ignored. A working-directory hint, ATLAS_BUFFER_TOOL_ARGS and tool retry still hold a call as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under `--tool-guard stream` every request got its tool calls as they were written. A client that does not read `content_filter` would run a call the guard blocked at its end, or an unclosed one. A request now gets streamed tool calls only with the body field `stream_tool_arguments: true` (an Atlas extension on /v1/chat/completions); without it the call is held, and the response is the same as under `--tool-guard on`. This covers the generic stream path and the Poolside v1 string-argument path. Under `on` and `off` the field is accepted and ignored. A working-directory hint, ATLAS_BUFFER_TOOL_ARGS and tool retry still hold a call as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… verify rows 4-16) On strix-hip the rows 2..16 Linear::Nvfp4 projections ran w4a16_gemv_batch8/16, issue-bound at ~15-20% of the C8 step and ~21% of the DSpark verify step. This routes rows 4..16 (N >= 1024) to a new pretiled split-K WMMA kernel derived from Ciru AI's hip_moe_decode.hip source-NVFP4 decode GEMM (Apache-2.0, attribution in the file header): - weights.rs: at load (AMD only) each Nvfp4 projection's packed E2M1 + E4M3 scales are repacked by w4a16_wmma_pretile into the WMMA tile replay ([N/128][K/64][128][32] packed, [..][128][4] scale words) as extra device buffers beside the original q, so the rows=1 w4a16_gemv_sw path is untouched and bit-identical. ~560 MB extra device memory (same bytes, permuted). - w4a16_wmma: one block per 128 outputs x K slice, 8 warps, K64 software- pipelined bf16 WMMA, register-side NVFP4 unpack with the same E2M1 decode and scale math as the GEMV path, zero smem for B, next-tile prefetch. gridDim.y splits K (host picks 1-8 slices by shape) into f32 partials; w4a16_wmma_reduce sums them to BF16 (order-exact adds, deterministic). - Routing is measured: rows 2-3 and the N=384 rel-bias projection stay on w4a16_gemv_batch8/16 where WMMA's fixed per-launch cost does not pay off; the remaining shapes gain ~1.75x at M=8. Microbench (us/call, M=8, cold weights): 3072x2304 batch8 57.4 -> 32.9 (121 GB/s); 1024x2304 batch8 19.5 -> 12.5 (106 GB/s); 2304x3072 batch8 51.6 -> 32.5 (122 GB/s); relbias 384 stays on batch8. M is flat on the WMMA side; batch8 still wins at M <= 3. Gate vs main 7a717b6 (bin 2a4d92163021), start-script serve (prefix cache, batch 8): greedy C1 spark+strict IDENTICAL (mean|dlp| 0.00000); decode_h2h C2 51.5=51.5, C4 69.4->70.7, C8 89.6->93.6; task_probe 30/30+10/10 all arms; pd_check 6x96/96 aligned within f373 noise; NLL unchanged; 0 ERROR/panic/illegal on every arm; C8 rocprofv3 shows w4a16_wmma 22.1 us/call at 6.4% of GPU (was batch8 47 us, 15.5%).
Ports the Ciru B2-style flash prefill body (Apache-2.0, attributed) to gfx1151 wave32 WMMA for the inkling-2-mini strix-hip target: K/V staged in LDS, Q in registers, register online softmax over the (row=2e+lane_hi, col=lane_lo) fragment layout, fp16 P staged per warp for the PV MMA. Semantics kept bit-for-bit with inkling2_prefill_attn: bf16-rounded rel-bias in inkling2_rel_bias_table's accumulation order, per-token sinks, 1024-token SWA on the sliding layers vs full attention on the 4 full layers, 4096-token prefill chunks reading the paged KV of earlier chunks. rows >= 64 takes this kernel on cfg!(atlas_scale); the PTX body and all non-AMD routing are untouched. Fixes folded in from the first gate: - the score A-fragment is loaded by memcpy of the raw 32 bf16 bytes; the original (__bf16)((unsigned short*)&lo)[i] was a numeric ushort->bf16 conversion (0x3F40 -> 16256.0) that made every score ~1e4 garbage. - P staging publishes through a fenced wave sync (the ink_wave_sync pattern): hipcc's __syncwarp is a bare wave barrier with no LDS ordering. Standalone hipcc check vs a CPU reference on gfx1151: q_len 1..4096, windows 0/16/64/1024/full, chunked prefill q_offset 500..3000 over paged KV -> max|d| <= 0.004. Framework gate (vs PR-1 parent binary, official checkpoint + Spark overlay): prefill_h2h 7,773 tok 5.71s -> 5.10s (1,362 -> 1,525 tok/s), 30,993 tok 27.94s -> 22.41s (1,109 -> 1,383 tok/s); task_probe math 30/30 and tools 10/10 on all four arms; pd_check 96/96 aligned x6, mean|dlp| 0.0046-0.0188 (inside the f373 noise); NLL code 0.63684 (ref 0.63689), text 0.89670 (ref 0.89618) - inside tolerance given the flash accumulation order and fp16 P; greedy C1 spark 8/8 identical, strict 6/8 (concurrent-batch scheduling jitter class, same as the PR-1 gate); 0 ERROR/panic on every arm. gb10 byte-identity: nvcc -ptx (sm_121a) of kernels/gb10/inkling-2-mini/ nvfp4/inkling2_flash_prefill.cu at this commit vs main 7a717b6 produces identical PTX - the AMD body is fully inside #if __SCALE__ / __HIP_PLATFORM_AMD__ and the PTX body under #else is untouched.
q, k, v, the relative-bias and gate projections, the sinks and the dynamic convs' taps ran as six to eight GEMV launches a visit, each small (24 to 3,072 outputs over K = 2,304). inkling2_proj_gemv runs them as one: each segment of a per-visit device table (written once the shared buffers attach, one a row count up to 8) is one projection's input rows, weight and output, and every output row is the chain dense_gemv_bf16_batchm computes for it (the common body now takes its block index). A visit with a quantized projection (Spark weights) keeps one launch each. Observed on one GB10, plain Strict decode (no drafter), saver size, greedy text and the six-prompt concurrency hashes identical to engine d1b138e: C1 code/prose 35.84/35.87 -> 36.37/36.37 tok/s (server rate, 3 runs), aggregate C2 51-53 -> 52-55, C4 79-80 -> 80-82, C8 115-118 -> 118-120 (2 rounds of 2 runs). Co-Authored-By: Claude Opus 5.5 <[email protected]>
`--tool-guard stream` screens the same calls as `on`, at the same point (each call's end, and the aggregate size bound as bytes arrive), but sends a call's header and arguments as they are written instead of holding them until the call passes. A call it blocks, or one the response cuts off, ends the response `content_filter` (not `tool_calls`) with STREAMED_REFUSAL, which says part of the call streamed and that it must not be run. Poolside v1 calls stay held: its detector buffers them anyway. `off` and `on` are unchanged, and `off` stays the default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under `--tool-guard stream` every request got its tool calls as they were written. A client that does not read `content_filter` would run a call the guard blocked at its end, or an unclosed one. A request now gets streamed tool calls only with the body field `stream_tool_arguments: true` (an Atlas extension on /v1/chat/completions); without it the call is held, and the response is the same as under `--tool-guard on`. This covers the generic stream path and the Poolside v1 string-argument path. Under `on` and `off` the field is accepted and ignored. A working-directory hint, ATLAS_BUFFER_TOOL_ARGS and tool retry still hold a call as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`pc_plan_branch` returned early for a model with no SSM layers, so `ATLAS_GLM_PC_BRANCH` never planted a checkpoint for Inkling 2, whose prefix hits resume from its short-conv state on the same snapshots. Gate on `snapshot_prefix_state()` instead, the gate the prefix lookup already uses (identical for SSM models). For a client that rebuilds its last few messages every turn (a voice rig: system, history, then three trailing user blocks re-rendered each turn), every user turn diverged ~500-700 tokens before the previous prompt's end and restored from the cold prefill's chunk boundary, replaying a growing 4.1-5.1K tokens. With the switch on (min 512), the first such turn plants a checkpoint at the divergence and later turns restore there. Observed, single run, one GB10, Strict, saver flags (prefix caching, 64 slots, chunk 4096), 16.4-17.4K-token prompts, 8 turns: user-turn TTFT 1.33-1.73 s -> 0.61-0.82 s (the planting turn 1.33 -> 1.49 s); follow-ups unchanged at 0.29-0.32 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`tool_choice` required (or a named function) constrains the output to the Hermes grammar, so the model writes `<tool_call>` text with no Inkling block header. The rewrite passed that through without the think end, so a streamed request with thinking on read the call as reasoning and the in-think leak guard cut the response (finish `length`, guard `in_think_tool_leak`); effort none and the blocking path were unaffected. Text between blocks now closes the reasoning first, as a text block does. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…rix-hip #408's inkling2_proj_gemv_mixed includes ../../common/w4a16_gemv.cu. The strix-hip build widens warp-mask literals to 64-bit only inside a kernel directory it mirrors; a parent-relative include resolves to the file as written, so hipcc hit HIP's 64-bit mask static_assert at every __shfl_*_sync in w4a16_gemv.cu (DevLab run 45567206595). The 19 sites now take W4A16_WARP_MASK: 0xFFFFFFFFULL on HIP (what the mirror would write), 0xFFFFFFFF elsewhere. dense_gemv_bf16_batchm.cu, which the same kernel includes, already branches this way. GB10 PTX is byte-identical before and after (sm_121f): w4a16_gemv.cu 519,554 B, inkling2_proj_gemv.cu 629,390 B. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GB10 gate of the train at
|
| check | result |
|---|---|
| lp_dump, exact profile (prose / 6K / 20K, 26,912 tokens) | max|Δ| 0.0000 |
| greedy C1 / C8 | 8/8 / 8/8 identical |
prefix-cache hit vs cold, per prompt (#416's pc_policy check) |
same pass/fail per prompt, same cached-token counts |
tree verify (ATLAS_DFLASH_TREE=16, 8 seqs) |
accepted per step 0.000 → 1.9–2.8 (#369); decode prose / code / json 11.6 → 28.0 / 46.6 / 46.4 tok/s; greedy C1 / C8 identical to main's tree run |
Inkling 2 Mini.
| arm | result |
|---|---|
| Strict serial, train vs main | greedy C1 8/8, C8 8/8 identical; C1 vs C8 8/8 (#414 and #418 leave text unchanged) |
| Spark serial, train vs main | greedy C1 8/8 identical |
| Strict serial | tools 14/14 · arith 40/40 · needle 11/12; image probe 3/3 (#418); cross-contamination 8/8; cache hit == cold 6/6; decode 36.4, aggregate C1/C2/C4/C8 35.5/53.2/77.8/110.2; ~41K prefill 3,434–3,472 tok/s |
| Drafted == plain (#408), strict | recipe DSpark C1 / C8 8/8; #408's release env (1:7,2:2, CONF_WIDTH=1, GATE_FORCE=1) C1 / C2 / C8 8/8 |
| Drafted == plain (#408), Spark | release env C1 / C2 8/8; recipe env + ATLAS_GLM_PC_BRANCH=1 C1 8/8 |
--tool-guard stream (#415) |
opt-in call streamed in 26 chunks, tool_calls; without the field 1 chunk; metadata-address call streamed 31 chunks, then content_filter |
| Strict + recipe DSpark | tools 14/14 · arith 40/40 · needle 11/12; cache 6/6; agentic ×10 10/10, 6.28 s/turn |
| Strict + #408 release env | decode prose / code / json 37.8 / 53.7 / 41.2 (recipe env: 36.2 / 35.6 / 34.0); C2 54.7; cross-contamination 8/8 |
| Spark + #408 release env | decode 57.2 / 71.5 / 61.2 (recipe env: 56.5 / 55.9 / 53.5); C1 / C8 55.5 / 119.3 |
| Spark + recipe DSpark + branch checkpoints | tools 14/14 · arith 40/40 · needle 12/12; cache 6/6; cross-contamination 8/8; agentic ×10 10/10, 5.39 s/turn; ST-995 80.40 / 81.16 (#404: 79.90 / 80.21) |
| ERROR / panic lines | 0 in every arm |
Poisoning gate: a fixture issue that predates this train. The gate failed its reference round. Turn 1 is a 1,092-token prompt with max_tokens=1024, and the model thought for 1,019 tokens and hit length. #404's gate passed because main's drafted text thought for 477 tokens there, and main's drafted text was not plain decode's text. Job 187c ran the same turn three ways:
| run | turn 1 |
|---|---|
| train, Spark serial | thinking 1,019, length |
main 7a717b659, Spark serial |
thinking 1,019, length |
| train, Spark + DSpark | thinking 1,019, length |
Plain decode has never fit that turn's budget with thinking on. Now that #408 makes drafted text equal plain text, the drafted arm shows it too. I have not changed the gate. It needs a maintainer decision: a larger turn-1 budget, or the gate run at lower reasoning effort.
#408's re-probe change (ungated, every model with ATLAS_DFLASH_ADAPTIVE=1). It is visible on low-acceptance text under the recipe env. Train vs #404's gate, strict: json 35.2 → 34.0, C1 36.3 → 34.0. Spark: json 56.2 → 53.5. Re-probes now come after 32/64 tokens (42/8 of them) instead of after 256. Job 188b is a same-binary A/B: default against ATLAS_DFLASH_ADAPTIVE_REPROBE=2048, whose first wait is 256.
Recipes. The gain from #408's release env is large and exact, so the Inkling recipes should move to it after this merges. I'll do that in sparkrun-recipes.
Static. fmt is clean. clippy -D warnings is clean. The full suite (--no-fail-fast, five crates) passes 6,774 with 1 failure: closure_attestation, the one-model build case that #419/#420 (train #422) fix. Env names: 1,139, the same as main.
AMD: one fix in, one fault open.
338e7c509:w4a16_gemv.cuuses a HIP-width warp mask. Inkling 2: drafting for two requests, confidence-sized verifies (third follow-up to #401) #408'sinkling2_proj_gemv_mixedincludes that file by a parent-relative path, which the strix-hip mirror does not widen, so the build failed (DevLab 45567206595). GB10 PTX is byte-identical before and after.- With the fix (DevLab 45568957561), the strix-hip build passes.
--checkpasses in strict and spark. Strict serves at C1 28.9 / C8 76.5 tok/s, and 7.8K prefill runs at 1,078 tok/s. Spark faults:HSA_STATUS_ERROR_MEMORY_FAULTinw4a16_wmma(inkling2 on AMD: batched NVFP4 projections on pretiled WMMA (decode / verify rows 4-16) #412), on the first 16-token prefill chunk. inkling2 on AMD: batched NVFP4 projections on pretiled WMMA (decode / verify rows 4-16) #412's WMMA arm takes rows 4..=16, so a 16-row Spark prefill chunk reaches it. Bisect runs are on DevLab: inkling2 on AMD: flash prefill attention on wave32 WMMA #413 alone (45587106711), and the train without Inkling 2: drafting for two requests, confidence-sized verifies (third follow-up to #401) #408 (45587118450).
sparky nightq 187 / 187c · train 836fd1ada inkling 3093a9f1 q27 6bbb7ad6; main 7a717b65 inkling ac36cee6 q27 20aa1c71 · 2026-11-25
🤖 Generated with Claude Code
… verify rows 4-16) On strix-hip the rows 2..16 Linear::Nvfp4 projections ran w4a16_gemv_batch8/16, issue-bound at ~15-20% of the C8 step and ~21% of the DSpark verify step. This routes rows 4..16 (N >= 1024) to a new pretiled split-K WMMA kernel derived from Ciru AI's hip_moe_decode.hip source-NVFP4 decode GEMM (Apache-2.0, attribution in the file header): - weights.rs: at load (AMD only) each Nvfp4 projection's packed E2M1 + E4M3 scales are repacked by w4a16_wmma_pretile into the WMMA tile replay ([N/128][K/64][128][32] packed, [..][128][4] scale words) as extra device buffers beside the original q, so the rows=1 w4a16_gemv_sw path is untouched and bit-identical. ~560 MB extra device memory (same bytes, permuted). - w4a16_wmma: one block per 128 outputs x K slice, 8 warps, K64 software- pipelined bf16 WMMA, register-side NVFP4 unpack with the same E2M1 decode and scale math as the GEMV path, zero smem for B, next-tile prefetch. gridDim.y splits K (host picks 1-8 slices by shape) into f32 partials; w4a16_wmma_reduce sums them to BF16 (order-exact adds, deterministic). - Routing is measured: rows 2-3 and the N=384 rel-bias projection stay on w4a16_gemv_batch8/16 where WMMA's fixed per-launch cost does not pay off; the remaining shapes gain ~1.75x at M=8. Microbench (us/call, M=8, cold weights): 3072x2304 batch8 57.4 -> 32.9 (121 GB/s); 1024x2304 batch8 19.5 -> 12.5 (106 GB/s); 2304x3072 batch8 51.6 -> 32.5 (122 GB/s); relbias 384 stays on batch8. M is flat on the WMMA side; batch8 still wins at M <= 3. Gate vs main 7a717b6 (bin 2a4d92163021), start-script serve (prefix cache, batch 8): greedy C1 spark+strict IDENTICAL (mean|dlp| 0.00000); decode_h2h C2 51.5=51.5, C4 69.4->70.7, C8 89.6->93.6; task_probe 30/30+10/10 all arms; pd_check 6x96/96 aligned within f373 noise; NLL unchanged; 0 ERROR/panic/illegal on every arm; C8 rocprofv3 shows w4a16_wmma 22.1 us/call at 6.4% of GPU (was batch8 47 us, 15.5%).
Ports the Ciru B2-style flash prefill body (Apache-2.0, attributed) to gfx1151 wave32 WMMA for the inkling-2-mini strix-hip target: K/V staged in LDS, Q in registers, register online softmax over the (row=2e+lane_hi, col=lane_lo) fragment layout, fp16 P staged per warp for the PV MMA. Semantics kept bit-for-bit with inkling2_prefill_attn: bf16-rounded rel-bias in inkling2_rel_bias_table's accumulation order, per-token sinks, 1024-token SWA on the sliding layers vs full attention on the 4 full layers, 4096-token prefill chunks reading the paged KV of earlier chunks. rows >= 64 takes this kernel on cfg!(atlas_scale); the PTX body and all non-AMD routing are untouched. Fixes folded in from the first gate: - the score A-fragment is loaded by memcpy of the raw 32 bf16 bytes; the original (__bf16)((unsigned short*)&lo)[i] was a numeric ushort->bf16 conversion (0x3F40 -> 16256.0) that made every score ~1e4 garbage. - P staging publishes through a fenced wave sync (the ink_wave_sync pattern): hipcc's __syncwarp is a bare wave barrier with no LDS ordering. Standalone hipcc check vs a CPU reference on gfx1151: q_len 1..4096, windows 0/16/64/1024/full, chunked prefill q_offset 500..3000 over paged KV -> max|d| <= 0.004. Framework gate (vs PR-1 parent binary, official checkpoint + Spark overlay): prefill_h2h 7,773 tok 5.71s -> 5.10s (1,362 -> 1,525 tok/s), 30,993 tok 27.94s -> 22.41s (1,109 -> 1,383 tok/s); task_probe math 30/30 and tools 10/10 on all four arms; pd_check 96/96 aligned x6, mean|dlp| 0.0046-0.0188 (inside the f373 noise); NLL code 0.63684 (ref 0.63689), text 0.89670 (ref 0.89618) - inside tolerance given the flash accumulation order and fp16 P; greedy C1 spark 8/8 identical, strict 6/8 (concurrent-batch scheduling jitter class, same as the PR-1 gate); 0 ERROR/panic on every arm. gb10 byte-identity: nvcc -ptx (sm_121a) of kernels/gb10/inkling-2-mini/ nvfp4/inkling2_flash_prefill.cu at this commit vs main 7a717b6 produces identical PTX - the AMD body is fully inside #if __SCALE__ / __HIP_PLATFORM_AMD__ and the PTX body under #else is untouched.
…logue bound #412 and #413 were re-pushed with one change: w4a16_wmma's prologue loads a K group's first weight tile only when the slice has one (a short last slice read one tile past the pretiled buffer; HSA memory fault on a 16-row Spark prefill chunk, DevLab 45568957561 / 45587106711). The earlier heads are already merged above; this brings in the fixed ones. # Conflicts: # kernels/strix-hip/inkling-2-mini/nvfp4/inkling2_w4a16_wmma.cu
AMD and final head: greenGB10, final head
The AMD Spark fault was #412's own and is fixed.
DevLab Strix Halo, train
AMD still owes the agentic ×10 leg and an exactness check of drafted vs plain text. #412's WMMA serves rows 4–16, including verify rows, so #408's drafted == plain is not established on AMD. Framework is blocked (disk full plus a stuck process), so those wait for it. The rest of the train is ready. Open on GB10 before merge: #408's re-probe default. A same-binary A/B shows 3–8% lost on low-acceptance text. I've proposed a default-preserving change on #408 and am waiting on @data-angel. sparky nightq 188 · DevLab 45567206595 / 45568957561 / 45587106711 / 45587118450 / 45602682348 · 2026-11-25 🤖 Generated with Claude Code |
AMD exactness, agentic, and the Inkling recipes on this trainAMD: drafted == plain does not hold on strix-hip, and did not before #412.
AMD's multi-row kernels aren't row-exact with the single-row decode path, so plain decode is not batch-invariant there and drafted text follows the multi-row arithmetic. #408's drafted == plain holds on GB10, where the batch GEMV tiers are row-exact, and was never true on AMD. #412 doesn't change that. Not a blocker for this train, but worth knowing before anyone relies on exactness on AMD. Recipes (sparkrun on a local image of this train, sparky 195). These are sparkrun-recipes changes, on the local branch
For comparison, the current recipe env on this train gives code 55.9 (Spark) and 35.6 (Strict). Each agentic miss was one run where no The image's text differs from native builds: #424, which predates this train. The recipe runs' greedy text differed from the native gate's. Bisected (sparky 196–199c):
sparky 195 / 196 / 197 / 198 / 199b / 199c · DevLab 45618315211 / 45626570688 · 2026-11-25 🤖 Generated with Claude Code |
…ute.rs, code moves only) #408, #412 and #414 each grew glue.rs; merged it is 505 lines and the file-size-cap job fails. The router top-k and the KV page write move as is to a second impl block in glue/route.rs (446 + 74 lines). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t cold start (#398) GB10 (sparky 189): closure_attestation passes on one-model inkling-2-mini and qwen3.8-27b builds; full suite 6,829/0; Qwen3.8-27B lp_dump max|d| 0 and greedy C1/C8 8/8 vs #421; Inkling greedy 8/8; cold start 13.79 -> 12.25 s (-1.54 s). AMD (DevLab 45651124584): strix-hip builds with #420's build.rs, Strict/Spark --check, Spark C1 42.7 / C8 84.1. Follow-ups: c4108fd (rustdoc private link), c73fa30 (fast_weights_parity temp-dir race).
Integration train for the open Inkling 2 PRs and the DFlash2 tree-lattice fix. Each PR is merged
--no-ff, in stack order, so authorship survives and each PR closes as merged.common/dense_gemv_bf16_batchm.cu--tool-guard stream, opt-instream_tool_argumentspc_policy.rsinkling_turn.rsVisionToweradaptive_spec/dflash_width/batch_propose836fd1adainkling2_proj_gemv.cu: #414 makes it a required kernel and it existed under gb10 onlycfg!(atlas_scale)); #413's gb10.cucompiles to byte-identical PTX (99,236 B, sm_121f)How #408 was merged: #418's tree is #405's last head (
1a3675294), which is #408's base, so the merge conflicts were the old #405 commits meeting their rebased split. I resolved them to #408's side. The merged tree at that step is exactly #408's head tree.Gate (in progress)
836fd1ada): Qwen3.8-27B DFlash2 main vs train (lp_dump, greedy C1/C8, prefix-cache hits; tree verify withmean_na). Inkling strict/Spark serial vs main, drafted == plain text (recipe env and Inkling 2: drafting for two requests, confidence-sized verifies (third follow-up to #401) #408's release env, C1/C2/C8), image probe,--tool-guard streamprobe, cross-contamination, poisoning, agentic ×10, BFCL subset.6708dd41didentical to 187's outputs.Results will be posted here; this stays a draft until every leg posts.
🤖 Generated with Claude Code