Conversation
At tiny M the dense projections on the decode path (attention fused_wqa_wkv/wo_a/wo_b, indexer weights_proj/wk, compressor scores, and lm_head) run MXFP8 CuTeDSL or BF16 cuBLAS kernels sized for bulk traffic. On B200 TP8 shapes the measured winners for the 20 (shape, M) cells are a Triton SIMT GEMM for the MXFP8 projections, CuTe skinny for the BF16 ones, and ll_bf16 dotprod for the FP32 compressor scores. Install a shape-keyed dispatch table (SM100 only) alongside the K3/GLM low-latency precedent: quantized modules keep their methods, the three unquantized BF16 modules get low-latency quant-method replacements, and the fused/wo_a/compressor paths branch at their model-layer call sites with identical output quantization semantics (per-32 E8M0 activation scales are folded into the SIMT GEMM). Everything falls back to the original kernels off-table, off-device, non-BF16, with LoRA attached, or under VLLM_BATCH_INVARIANT. Co-authored-by: Kimi Code <noreply@moonshot.cn> Signed-off-by: Canlin <canlinguosdu@gmail.com>
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
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.
Purpose
At tiny M (1–4 rows) the dense projections on DeepSeek-V4.1's decode path are dispatch-mismatched: MXFP8 CuTeDSL and BF16 cuBLAS kernels sized for bulk traffic run weight-bound rounds. This PR adds a shape-keyed skinny dispatch table (SM100/B200 only, TP8 shapes) that swaps in the measured winners exactly where they win — a Triton SIMT GEMM for the three MXFP8 projections, CuTe skinny for the BF16 indexer/lm_head projections, and ll_bf16 dotprod for the FP32 compressor scores, 20 (shape, M) cells in total.
Semantics are preserved exactly: MXFP8 candidates keep the per-32-element E8M0 activation scale and FP8 rounding (
round_mxin the SIMT kernel reproduces the baseline MXFP8 quantization), and FP32 compressor outputs stay FP32. Everything falls back to the original kernels off-table, off-device, non-BF16 input, with LoRA attached, with a bias, or underVLLM_BATCH_INVARIANT. The dispatch runs at model init for the three unquantized BF16 modules (K3/GLM-5.2 quant-method replacement precedent) and at the model-layer call sites for the fused/wo_a/compressor paths, so module forward and any wrappers are untouched off the table.Test Plan
Deployment (DeepSeek-V4.1-Flash, 8xB200, TP8/EP, MegaMoE+SP, FlashInfer sparse MLA, FP8 KV, C1/C4/C16 client suites,
vllm bench serve, seed 42, ignore-EOS, tokenizer trusted):Unit/kernel tests:
Test Result
204 passed, 267 skipped(the skips are the existing SM90/SM103-gated K3/GLM cases; all DSV4.1 cases and every shared case for this arch pass). Coverage includes the 20-cell table vsselected.jsonconfigs, install gating (SM100/dtype/LoRA/shape/bias/M-miss fallbacks byte-equal to the original calls), SIMT-vs-reference rel-RMSE across 5 activation scales (1e-5..100), the wo_a chain vs the real DeepGEMMfp8_einsumbaseline, and compressor ll_bf16 vstorch.mm(out_dtype=fp32).ruff check,ruff format, mypy-3.10, check-torch-cuda-call all pass on the touched files.b7e0cdac5d, baseline = original kernels, PR = skinny dispatch; 0 failed requests in all runs):random 1024/256, C1:
random 1024/256, C4:
random 8192/1024, C16:
Prefix-cache suite (prefix_repetition 32768/2048/1024, C96) is unchanged within the run-to-run spread (out 4064.7 -> 4051.4 tok/s, -0.3%; TPOT 18.04 -> 18.48 ms); the dispatch only covers M<=4 cells, which C96 decode does not satisfy per step.
C1 was measured twice on fresh servers: round 1 out 120.3 tok/s (+2.3%) / TPOT 7.801 ms; round 2 out 119.9 tok/s (+2.0%) / TPOT 7.802 ms against the same baseline. The direction and size hold across server starts.
This PR was developed with AI assistance (Kimi Code CLI): the measured winning dispatch table comes from a prior experimental campaign by this team (documented in-tree in
benchmarks/kernels/experimental/dsv41_skinny/), and I integrated, verified and measured it; the human submitter reviewed every changed line.