Repository navigation
spark-model: DFlash2 lm_head batchm-GEMV + verify m≤16 ladder + serve launchers - #60
Merged
Merged
Conversation
…GEMV
The eager forward_block tail sent the gamma-row vocab projection through
the M64-tile w4a16_gemm: at M=gamma=8 the tile pads 8 real rows to 64, so
~7/8 of its MMA work is dead — on gfx1151 rocprof shows ~164 ms/step for
this single launch, ~75% of the ~220 ms propose. The batched tail already
picks w4a16_gemv_batch{4,8,16}; the eager path now mirrors it, keeping
w4a16_gemm as the fallback for gamma>16 or a missing tier. The BF16-head
arms go through drafter_dense_gemm so they pick up the small-M
dense_gemv_bf16_batchm policy instead of the 128-row pipelined tile.
Batched DFlash verify (C>=2, or gamma>8) pushes n=9..16 rows through the attention o_proj and dense FFN, but both ladders capped at the narrow batchm family's M=8 and fell through to the tile-GEMM prefill path — the ~156 GB/s cliff the batchm family exists to avoid. Give DenseFfnLayer and Qwen3AttentionLayer a w4a16_gemv_batch16 fallback handle — the same "narrow tier first, else batch16" rule mtp_head::lm_head_batch_kernel and lm_head_batched already implement — and widen the multi_seq FFN arm to 4..=16. The fused QKV tile GEMM stays at n>8: the k/v N=1024 shapes are the worst-utilised GEMV shapes in the model and the fused weight is what the arm was built for.
rocprof pinned the dominant propose cost on the drafter lm_head (M64-tile w4a16_gemm, ~75% of propose). With 947619a/7bd99f314 the same-harness numbers move g8 9.80->15.65, g4 11.39->22.71 (parity with the MTP K4 control at 22.01); verify K=9 292.4->255.4 ms.
serve_dflash2.sh + win_serve_dflash2.ps1 land the fingerprinted serve profile (Option-B env, ssm slots, slai policy) as runnable launchers; the ps1 is ASCII-only for Windows PowerShell 5.1. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dflash_head: route the eager drafter γ-row lm_head projection throughw4a16_gemv_batchminstead of the M64-tilew4a16_gemm/dense_gemm_bf16_pipelinedpath — the single kernel that rocprof attributed ~75% of propose time to on gfx1151 (~164ms/step, grid ≈ 2×248320 vocab)layers: extend the w4a16 batched-GEMV verify ladder to m=9..16 (w4a16_gemv_batch16fallback, mirroring the established narrow→batch16 pattern inmtp_head/lm_head_batched/ssm_batched) so γ=8 verify at n=9 rows stops falling back to tile-GEMM/prefill pathsscripts/strix/dflash2/serve_dflash2.sh(Linux) andscripts/strix-windows/win_serve_dflash2.ps1(ASCII-only for Windows PowerShell 5.1)These commits are already merged into
integration/nvidia-lane-2026-09-20(c8b88c6) and both Strix port branches; this PR lands the same pieces onmain.Measured (AzeezStrix gfx1151, binary sha
e3343a66, same-harness A/B)Windows (winbox, γ=4): 28.5 tok/s server-attested, mean_na 2.68. GB10 container smoke on
sha-c8b88c6: γ=8, 344/400 accepted.Concurrency sweep on GB10 (c8b88c6, γ=8, ATLAS_DFLASH_OPTION_B=1, ISL 512)
27.3 / 37.2 / 47.9 / 47.5 agg tok/s at C1/C4/C8/C16 — beats the #52 reference table (25.2/33.6/40.2/42.1) at every cell; scaling saturates after C8.
Test plan
cargo fmt --all -- --check,cargo check -p spark-model -p spark-server(clean on this branch)sha-c8b88c6) container smoke incl. DFlash requestGenerated with Devin