Repository navigation
Inkling 2: Spark projections on the row-invariant tensor-core kernels (2/4, stacked on 1/4) - #431
Conversation
…(ATLAS_SKINNY_MMA) Inkling's verify rows keep the decode row's arithmetic so text with drafts is the text without. For the Spark NVFP4 projections and head that meant the scalar batch GEMV tiers, which repeat the one-row kernel's FMA chain and are issue-bound: at eight verify rows they read Inkling's [3072 x 2304] projections at about 90 GB/s, and they were about 14 ms of a 68 ms drafted step on one GB10. ATLAS_SKINNY_MMA's kernels compute a row the same way at every width, so decode and verify stay exact twins on the tensor cores: - skinny_mma.cu moves from the qwen3.6-27b overlay to gb10/common, so every GB10 target (Inkling 2 Mini's included) ships it; the lever stays off unless set. - Under the lever Inkling's one-row fused projection kernel (inkling2_proj_gemv_mixed, the scalar arithmetic) is not used, so a decode row takes the skinny kernels as a verify row does. - An exact verify's NVFP4 projections and the verify head go to the skinny kernels in one call (up to 128 rows) instead of 15- and 16-row passes that read the weight again. - skinny_mma_microtest covers Inkling's shapes and runs on its kernel set. Observed on one GB10, dev build, Spark weights, DFlash2 drafter, voice engines resident, preliminary, single runs: skinny_mma_microtest passes at Inkling's shapes (rows byte-identical at 1..128, error against FP64 no worse than w4a16_gemv). Greedy text for 8 prompts x 320 tokens with drafts at one, four and eight requests, and plain at eight, identical to drafts off one at a time. A drafted step at one request 68.5 -> 54.6 ms; RigMark short code C1/C2/C4/C8 aggregate 65.8 / 73.9 / 108.7 / 149.1 tok/s with the lever (release 0.5.0, voice suspended: 58.7 / 77.6 / 103.0 / 136.0). Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 19f3e27)
…move skinny_mma_microtest's shape table moves to skinny_mma_microtest_parts/ shapes.rs and GlueKernels::window_meta to glue/route.rs beside kv_write; code moved as is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AzeezIsh
left a comment
There was a problem hiding this comment.
@data-angel Gated this as the tree main gets: main with #430 merged, then this branch merged on top (bb62c76cd, the same tree GitHub's merge gives now that #430 is in as ffb94a585), against its parent. One GB10, sparky job 210, fresh worktrees at both commits.
With the lever off (the default), nothing changes
| check | parent vs this PR |
|---|---|
Qwen3.8-27B QAD exact profile (sets ATLAS_SKINNY_MMA=1, so it runs the moved skinny_mma.cu): lp_dump 26,912 tokens, greedy C1 / C8 |
max|Δ| 0.0000 · 8/8 · 8/8 |
| Inkling Strict plain: greedy C1 / C8 | 8/8 · 8/8 |
| Inkling Spark plain: greedy C1 / C8, NLL (57,716 tokens) | 8/8 · 8/8 · ties 32/32 |
| Inkling Spark + DFlash2 (0.5.1 spark draft env): greedy C1 vs plain | 8/8 |
With ATLAS_SKINNY_MMA=1 (Spark)
- Drafts equal no drafts: Spark + lever + DFlash2 vs Spark + lever plain, greedy C1 / C8 8/8 · 8/8. C1 vs C8 is also 8/8 within each arm.
- The text changes from lever-off, as expected (0/8 identical). Teacher-forced NLL is unchanged to five decimals (0.82294 both, 14 of 32 chunks lower, 6 ties).
- Tools 14/14 (both arms). Quality probe with the drafter: 40/40, needle 12/12. Image 3/3. cachehit warm == cold 6/6. 4 × ~25K concurrent prompts all served. 0 ERROR lines.
- Plain lever-on had needle 9/12. The three misses are empty answers (reasoning hit the probe's 600-token cap), with C1/C8 text identical to the drafter arm, which scored 12/12. That probe runs 4 concurrent ~K-token prompts, and on
mainconcurrent batched prefill varies run to run (#430 job 209), so I read it as that.
Speed: one binary, one variable (Spark + DFlash2, 0.5.1 spark env; sq_bench medians, decode n=3, concurrency n=2):
| prose | code | json | C1 | C2 | C4 | C8 | |
|---|---|---|---|---|---|---|---|
| lever off | 61.0 | 82.3 | 69.0 | 64.4 | 70.1 | 93.7 | 119.1 |
| lever on | 64.8 | 93.2 | 71.4 | 66.5 | 79.1 | 99.6 | 130.7 |
That is observed +3–13%, on one box and one harness.
Strix Halo (DevLab A/B run 46148035545, same merge commit vs main): lp_dump identical (max|Δ| 0 over 19,952 tokens), NLL ties 32/32, decode unchanged (Spark C1 42.7 / 42.6, Strict 28.9 / 28.8 tok/s), 0 hipError lines. Greedy at C4 was 3/8 Spark and 6/8 Strict. That's inside what a main-vs-main control on the same harness gives (2/8, 6/8; see #430), because C4 text on that harness isn't stable run to run.
CI: every workspace job passes on fresh runs against the new main. Merging.
sparky nightq 210 · parent 5807bb377 (tree of ffb94a585) ink bd2547fb q27 d9e1cd5a · gated 65f9062c3 (tree bb62c76cd) ink cc3ffad1 q27 ebc6ab12 · 2026-11-28
🤖 Generated with Claude Code
Change 2 of 4 porting the SparkInkling 0.5.1 engine to
main, stacked on #430 (two commits past it: the fork's commit, then a cap fix).What
Inkling's verify rows keep the decode row's arithmetic, so text with drafts is the text without. For the Spark
NVFP4 projections and head that meant the scalar batch GEMV tiers, which repeat the one-row kernel's FMA chain and
are issue-bound.
ATLAS_SKINNY_MMA's kernels compute a row the same way at every width, so under that existinglever decode and verify stay exact twins on the tensor cores:
skinny_mma.cumoves from the qwen3.6-27b overlay tokernels/gb10/common, so every GB10 target (Inkling 2Mini's included) ships it. The lever stays off unless set; nothing changes for a serve that does not set it.
inkling2_proj_gemv_mixed, the scalar arithmetic) isnot used, so a decode row takes the skinny kernels as a verify row does.
instead of 15- and 16-row passes that read the weight again.
skinny_mma_microtestcovers Inkling's shapes and runs on its kernel set.SparkInkling's Spark mode sets
ATLAS_SKINNY_MMA=1; its Strict mode (BF16 projections) does not.Beyond the cherry-pick:
skinny_mma_microtest.rsandlm_head_batched.rsare run throughrustfmt(the fork'scommit was not formatted), and a second commit keeps both files it grows under the 500-line cap, moving code as is:
the microtest's shape table to
skinny_mma_microtest_parts/shapes.rs, andGlueKernels::window_meta(#430) toglue/route.rsbesidekv_write.Observed (the fork's engine, all of 0.5.1, so not this change alone): Spark mode on SparkModelBench, medians,
code / prose / structured decode 88.2 / 57.0 / 129.9 tok/s and short code at one / two / four / eight requests
63.2 / 81.9 / 104.7 / 144.1 tok/s aggregate. Greedy text for 8 prompts of 320 tokens with drafts on equals drafts
off at one, two and four requests, 8/8, in both modes. The commit message carries the preliminary dev-build numbers
for this change alone (a drafted step at one request 68.5 -> 54.6 ms, single runs).
The series
The engine of SparkInkling 0.5.1
(
Enntity/atlasinkling2/rc-0.5.1-20261126ata4dbba378), ported ontomain(9f4fd773f) as one changeper PR, stacked linearly:
The DFlash2 drafter commits that 0.5.0 carried are already on
main. Two things are not in this series:the fork's
ATLAS_PREFILL_BUSY_TOKENSchunk cap (#4 here makes it unnecessary, and the fork removed it, so it isnot proposed and no PR adds an
ATLAS_*name) and the opt-in LoopCD (--loopcd), which is not proposed for now.After #4, the engine files these commits touch equal
a4dbba378's except formain's own changes underneaththem (
glue.rs'sroute/kv_writenow inglue/route.rs;weights.rs,serve_load.rs),rustfmt, code movedas is to keep files under the 500-line cap (#2, #3), and the AMD flash prefill kept beside the new gb10 kernel (#3).
Where the numbers come from. Every GPU number below was measured on the fork's engine on its older base
(before #413 and #426), not on these branches: SparkModelBench
293a44f(RigMark protocol 1.3.0, RigMark Qualityv0.0.2,
reasoning_effort: low) on one DGX Spark, SparkInkling 0.5.1's default profile, published with receipts inresults/2026-11-27-rc-0.5.1.
No GPU has run these rebased branches.
Test plan
-D warnings, spark-runtime / spark-model / spark-server,--tests),cargo test --releaseof those crates (spark-model 2,524, spark-runtime 608 and spark-server 3,258 passed; the same five spark-server tests fail onmainin this container (three need a.gitcheckout, two read the disk's free space)), the 500-line cap, SPDX and kernel-shadow checks; no newATLAS_*nameskinny_mma_microtestat Inkling's shapes (rows byte-identical at 1..128 rows); drafted = plain greedy text as aboveAuthorship
AI-authored: Claude (Opus 5.5) in Claude Code, directed and reviewed by a human; no hand-written code.
CLA
🤖 Generated with Claude Code