Repository navigation
Kimi-K3.1-Pro TP8/DCP8 kernels for MI355X - #10
Conversation
…(qkv_a norms + fp8_ds_mla insert, indexer key/query MXFP4 prep) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…elta rule + gated norm spec decode (checkpoint) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ep for the Kimi-K3.1 DSpark draft Bias GEMV over markov_w2 (streamed once for all <= 48 rows), bf16 add, draft logits cache write, vLLM's murmur3 Gumbel draw, argmax and the next step's token in one FlyDSL launch per step; ticketed last-workgroup reduce. Tests, graph-replay benchmark with roofline table, README, CI compile target. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…se MLA decode over the fp8_ds_mla cache with fused LSE Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…inal runs Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rt of the stock K1 (bit-exact) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…R-exact biased top-16 (WIP) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ll-reduce, tiled up projection) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…n, per-group ticket for 16 rows; measured-ceiling table Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…k reset, mul-by-reciprocal scales), index key/weights side in qkv_a kernel, queries-only indexer prep Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…bulary 163840 The split top-p chain of vLLM's apply_top_k_top_p in one launch (bit equal to the Triton chain on Gaussian, tied, -inf-masked and flat rows at 1-64 rows), adapted from sampling/top_p_mask_f32_v200064 to the Kimi-K3.1 vocabulary. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… pivot top-16 (WIP) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tamps Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… the router launch; generalized GEMM tiles (WIP) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…l), reference, test inputs Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…k in progress Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ht rows per workgroup MXFP4 MQA logits of ragged prefill rows over staged index key pages; one key page load feeds eight rows, persistent per-wave page loop, two-FMA ReLU/weight epilogue. 1.19-1.35x faster than AITER's scorer; runs at 92-99% of the measured VALU+MFMA cycle model. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…DA inputs; torch reference Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…h (WIP) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, barrier-free token loop, SD conv layout kernel (checkpoint) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ntra-chunk matrices, workspace records) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…able, README performance table Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…gator sync, XCC-weighted column split Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…push layout) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…kernels (first version) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The chunk-list, merge and fused kernels drop the unused timing variant (the timing flag, the LDS stamp slots, the debug pointer argument and the clock helper); score_chunk drops its stamp hook. The served kernels are unchanged apart from the removed argument. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The kernel drops its environment-selected phase stamps and the debug pointer argument; the communicator drops the debug buffer and the benchmark the phase printout. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ot AMD_KERNELS_MARKOV_TS compile_markov_chain(mt, k, timestamps) builds the stamped variant under its own name; the served entry always takes the plain one. timeline.py launches the stamped build through host._launch instead of setting the environment. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ipc.py holds the pool allocation, handle exchange, peer open and compiled-launch helpers the communicator imported from collectives/all_to_all_bf16_n50016_ranks4: the package imports only itself, torch, FlyDSL and amd_kernels.common. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… field From Python 3.13 a dataclass __eq__ compares fields with == (no identity shortcut), which is ambiguous for tensors; the test checks that the entry passed the caller's objects. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…the entry all_to_all_bf16_n20480_ranks8 no longer imports gemm/bf16_n20480_k7168: the GEMM + exchange call (gemm_exchange, its push crossovers and local rows, the GEMM's split-K prepare) moves into the entry's LogitsExchange, which logits_exchange_comm returns. The entry routes (N, K, world) to both packages. The public calls vLLM makes (warmup, gemm_exchange, recv, the reasons) keep their signatures and outputs (bit-identical on 8 ranks, 240 cases). RowAllToAll allocates its all-gather zero counts in the constructor, so the entry no longer reaches into the package's private state. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Unused imports (statistics, sys, sort_capacity, SERVED_ROWS) and locals (s1, ws, cap, the got_pre alias) in new test and benchmark files. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…f width, and a bank's norm weights - layer_tail_launch_unsupported_reason checked hidden, o_proj K and the expert count only; a model with the same three but another intermediate or latent size got None and a kernel at I 384 strides. The package now says which shapes and dtypes it fixes (host.weights_unsupported_reason), and the entry asks it. - router_sigmoid_bias_topk_unsupported_reason did not check moe_buf's width, which the launch zeroes for 3584 columns (host.MOE_BUF_COLS). - allreduce_attnres_rmsnorm with a bank reads norm_weight and qk_weight; None passed both the reason and _launch and became a load from address 0. - tests/attention/mla_decode_common/test_routing.py compared a dataclass of tensors with ==, which raises on Python 3.13+ (field-by-field comparison); it compares the fields by identity now. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
DCP8_TIMING (dcp8_topk_gather_merge_top2048) and AMD_KERNELS_MARKOV_TS (markov_gumbel_fused_v163840_r512) chose a kernel build from the environment. They are module constants now (TIMING, TS), False by default; the benchmark reads kernel.TIMING and timeline.py sets kernel.TS before the first compile. The context-projection benchmark's BENCH_DEBUG smoke prints are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
… one buffer per stream The flags were one buffer per device, zeroed once, relying on every consumer to reset its flag. A poll that gives up at POLL_LIMIT carries on, so its producer's flag stays set; the flag layout moves with the chunk count, so a later launch takes that flag for its own hand-over and reads records it has not written (an earlier launch's). Two launches in flight on two streams also shared the flags. The prefix a launch uses is now zeroed on its stream before it, and each stream has its own buffer. test_one_launch_ignores_stale_flags sets every flag before a call: before this change its ragged case returns NaN rows, with it both cases match the reference. test_one_launch_hand_over reads the buffer without the per-call zeroing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
|
@Fangzhou-Ai I ran this branch (f8b3a9d) on 8 x MI355X in the vLLM ROCm nightly image, which main now tests in (#13): 112 of the 114 targets pass (1,742 tests, 3 failed). Three small PRs to your branch, each tested in that image:
The rest is in #15 (entry checks delegated to the packages, the handshake epoch with mixed |
Entries: check every weight the layer tail fixes, the router moe_buf width, a bank norm weights
No debug switches read from the environment
kda_prefill_h12_d128: zero the one-launch hand-over flags per launch, one buffer per stream
…31/kimi-k31 Conflicts resolved: - tests/attention/mla_decode_common/test_routing.py (#3 vs 2698dc0): keep the isinstance / identity checks and add #3's field-set equality. - #4: keep ours for the DCP8_TIMING / Markov TS files; b0e6038 and 6c4d468 remove the gather-merge timing build and 73f12f5 makes the Markov stamps the 'timestamps' compile argument. #4's benchmark_gather_merge.py rebinds K to 2048, so K.TIMING raises. #4's BENCH_DEBUG removal in benchmark_context_proj.py is kept. amd_kernels/collectives/dcp8_topk_gather_merge_top2048/kernel.py amd_kernels/sampling/markov_gumbel_fused_v163840_r512/kernel.py benchmarks/collectives/dcp8_topk_gather_merge_top2048/benchmark_gather_merge.py benchmarks/sampling/markov_gumbel_fused_v163840_r512/timeline.py Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Route Kimi-K3.1-Pro (TP8, DCP8, DSpark MTP) on gfx950 to the amd_kernels kernels of Inferact/amd-kernels#10, called only through the shape-agnostic op entries of Inferact/amd-kernels#11 (amd_kernels.<category>.<op> plus its _unsupported_reason / _shapes), never a shape package. Ten routes (gemm, moe, kda, attention, indexer, norm, collectives, draft, sampling, overlap) cover the DSA attention prologue, fused indexer score + top-k, DCP top-k gather + merge, query gather, DCP sparse MLA decode and LSE combine; the KDA spec decode; the MoE router, routed experts, latent down + MXFP4 quant and the latent all-reduce + RMSNorm + up_proj; the all-reduce + AttnRes + RMSNorm; the KDA and indexer prefill; the vocab embedding, lm_head GEMM + logits exchange, top-p mask and fused Markov draft chain; the drafter context_proj gather, dense MLP and fp8 dense MLA (preview MLA draft). kernel_config.amd_kernels (AmdKernelsConfig: enabled, disabled_routes) gates them, on by default where amd_kernels imports; VLLM_KIMI_AKR and the per-kernel VLLM_KIMI_AKR_<NAME> switches serve A/B runs. Each hook returns None where its entry declines (rows, shapes, layout, dtype) and the stock path runs, with the entry's reason logged once. In this commit the KDA prefill kernel is still opt-in (VLLM_KIMI_AKR_KDA_PREFILL=1); a later commit fixes its state indexing and turns it on. On this branch's sparse MLA DCP path, which now packs the CSR lists of prefill steps too, the amd_kernels decode kernel takes decode-only steps; every other step keeps the FlyDSL 96-head / Triton kernel. The DSA test batches have no duplicate key slots and give the fused kernel one tile each. The multi-stream DSA wrapper declares its non-optional modules for mypy (typing only). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Fangzhou Ai <[email protected]>
|
@benenzhu Thanks for the review and for the three PRs. Fangzhou-Ai#2, #3 and #4 are merged into this branch. The merge ( vLLM side: vllm-project/vllm#69172 (base
Changes in this PR since your last look:
The kernel-tests jobs are still queued because no runner carries the 🤖 Generated with Claude Code |
Conflicts: - amd_kernels/README.md: both sides add packages to the index; both lists kept. - tests/multi_gpu8.py: main's version (Inferact#10), a wrapper over tests/multi_gpu.py with the same run_on_8_gpus API. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
…; FlyDSL draft attention [skip-sweep] - Switch the image from vllm/vllm-openai-rocm:kimi-k31-712d9eb@sha256:7c167350 (vLLM 712d9eb37, the k31-amd-tracking head) to vllm/vllm-openai-rocm:kimi-k31-020490a@sha256:f2cef9ee (vLLM 020490af6): the vllm/vllm-openai-rocm nightly-rocm100-647a76866b4559a74e27d1c6b55fbffe85c07ce4 toolchain (torch 2.13.0+rocm10.0.0, AITER 0.1.29.post1 plus PR 8177's FP4 MQA page strides, FlyDSL 0.5.0) with vLLM replaced by the kk31-amd-kernels branch built from source for gfx950, and amd-kernels installed editable. - The image ships the rocm-systems 6a31027 libhsa-runtime64, which fixes the ~2 MiB device-memory cost per HIP graph of the nightly's ROCr; the GPU KV pool at concurrency 16 is 11.7M tokens. - Points (concurrency 1, 4, 16, 24, 32 and 48), topology, speculative lengths, KV offloading and the other server arguments are unchanged. - Concurrency 16, 24, 32 and 48: the draft attention backend moves from TRITON_ATTN to KIMI_K3_FLYDSL_SWA_GQA (FP8 draft KV cache kept). - Concurrency 4 (latency_specialized): VLLM_KIMI_AKR_K1=1 and VLLM_KIMI_AKR_K2=1 turn on amd-kernels' specialized KDA decode and layer-tail kernels, which are off by default. Concurrency 16-48 do not run latency_specialized, so those two switches have no effect there. The remaining amd_kernels routes default to on. - Concurrency 1 (DCP1): VLLM_KIMI_AKR=0 turns the amd_kernels routes off, because the DSA and draft-MLA routes require DCP = TP (the draft MLA path is validated on DCP8) and do not engage at DCP1. The point keeps the stock specialized decode path. - Relevant upstream changes in the image: vllm-project/vllm#69172 (the Kimi-K3.1 amd_kernels bridge on top of 712d9eb37, with the FP8 fixes that let the FlyDSL sliding-window draft kernel run on an FP8 cache), Inferact/amd-kernels#10 (the kernels it routes to) and ROCm/aiter#8177 (applied as a patch). - Draft data types: no change. The Kimi-K3.1-Pro-DSpark draft (revision e4e6e626) is shipped and served in BF16 with no quantization config, sharing the target's BF16 embedding and LM head; the amd_kernels draft routes keep BF16 weights. Its KV cache stays FP8 (e4m3, scale 1.0) at concurrency 16-48 and BF16 at 1 and 4. The FlyDSL kernel reads a BF16 query where the Triton backend fed an FP8 query on gfx950. - 镜像从 vllm/vllm-openai-rocm:kimi-k31-712d9eb@sha256:7c167350(vLLM 712d9eb37,k31-amd-tracking 分支头)切换到 vllm/vllm-openai-rocm:kimi-k31-020490a@sha256:f2cef9ee(vLLM 020490af6):以 nightly-rocm100-647a76866b4559a74e27d1c6b55fbffe85c07ce4 为工具链(torch 2.13.0+rocm10.0.0、AITER 0.1.29.post1 加 PR 8177 的 FP4 MQA 页步长补丁、FlyDSL 0.5.0),vLLM 换成为 gfx950 源码构建的 kk31-amd-kernels 分支,amd-kernels 以 editable 方式安装。 - 镜像自带 rocm-systems 6a31027 的 libhsa-runtime64,修复了 nightly ROCr 每个 HIP graph 约 2 MiB 的显存开销;并发 16 时 GPU KV 池为 1170 万 token。 - 测试点(并发 1、4、16、24、32、48)、拓扑、推测长度、KV 卸载及其他服务参数不变。 - 并发 16、24、32、48:draft 注意力后端由 TRITON_ATTN 改为 KIMI_K3_FLYDSL_SWA_GQA(draft KV cache 仍为 FP8)。 - 并发 4(latency_specialized):VLLM_KIMI_AKR_K1=1 与 VLLM_KIMI_AKR_K2=1 打开 amd-kernels 默认关闭的专用 KDA decode 与层尾 kernel。并发 16-48 不走 latency_specialized,这两个开关在那里不起作用。其余 amd_kernels 路由默认开启。 - 并发 1(DCP1):VLLM_KIMI_AKR=0 关闭 amd_kernels 路由,因为 DSA 与 draft-MLA 路由要求 DCP = TP(draft MLA 路径在 DCP8 上验证),在 DCP1 不会生效;该点保留原有的专用 decode 路径。 - 镜像中相关的上游改动:vllm-project/vllm#69172(基于 712d9eb37 的 Kimi-K3.1 amd_kernels 桥接,含让 FlyDSL 滑窗 draft kernel 支持 FP8 cache 的修复)、Inferact/amd-kernels#10(被路由到的 kernel)以及 ROCm/aiter#8177(以补丁形式应用)。 - Draft 数据类型:不变。Kimi-K3.1-Pro-DSpark draft(revision e4e6e626)以 BF16 发布和运行,无量化配置,与目标模型共享 BF16 embedding 和 LM head;amd_kernels 的 draft 路由保持 BF16 权重。其 KV cache 在并发 16-48 仍为 FP8(e4m3,scale 1.0),在并发 1 和 4 为 BF16。FlyDSL kernel 读取 BF16 query,而 Triton 后端在 gfx950 上输入的是 FP8 query。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
This PR adds 28 FlyDSL kernel packages for serving Kimi-K3.1-Pro at TP8 / DCP8 on 8 x MI355X. They cover:
It also adds 13 shape-agnostic op entries (
*_common), per #11. Callers import only the entries, never a shape package. An entry reads the shape from the tensors and routes to the shape package. For a call that no package covers, it returns a reason, and the caller falls back to its stock path.Every package is FlyDSL only: no Triton, Gluon or HIP sources. A package imports only itself,
amd_kernels.commonandamd_kernels.warm_up, besides torch, FlyDSL and AITER. No package imports another package.Against upstream
main(merge base 571608c), the PR adds 488 files underamd_kernels/,tests/andbenchmarks/, +56.8K lines. It modifies two upstream files:amd_kernels/README.md: one index line per package and per entry, plus a "Collectives (eight ranks)" section;tools/ci/targets.tsv: rows for the 8-GPU tests, the compile tests and six precompiled single-GPU tests.New shared code lands in
amd_kernels/common/:rank8_signal.pyandrank8_comm.py(eight-rank flags and IPC pools) andmono/(the persistent-launch plumbing of K1 / K2).vLLM side: vllm-project/vllm#69172 routes Kimi-K3.1 to these entries. Without this package installed, every route there falls back to stock and the model loads unchanged.
Head:
b22dee3.Changes since the last review
Maintainer PRs merged. Thanks to @benenzhu for three PRs to this branch, each tested in the vLLM ROCm nightly image. All three are merged:
moe_bufwidth, and the attnres reason checks a bank's norm weights.The merge (
b22dee3) resolves two overlaps with the commits below:mla_decode_common/test_routing.pykeeps its field-by-field comparison and adds CI machine #3's field-set check.BENCH_DEBUGremoval is kept.Repo-rule items from the earlier draft, all closed:
collectives/all_to_all_bf16_n20480_ranks8no longer importsgemm/bf16_n20480_k7168.logits_exchange_common.logits_exchange_commreturns aLogitsExchangethat routes (N, K, world) to both packages.RowAllToAllkeeps only the exchange. The entry no longer touches its private state.warmup(),gemm_exchange(...),recv(...)and the two reason functions.dcp8_topk_gather_merge_top2048has its own IPC pool helpers. It no longer imports them fromall_to_all_bf16_n50016_ranks4.prefill_staged, and the entry'simplis'staged'. The'v1'name is gone.attention/kda_mono_decode_k1_h12_d128. It is single-GPU, so the_ranks8suffix was wrong. vLLM imports only the entry, so it needs no change.DCP8_TIMINGin the gather-merge;timingbuild of the paged indexer;AMD_KERNELS_MARKOV_TS, which is now atimestampscompile argument used only by the benchmark.tests/multi_gpu8.pywraps upstreamtests/multi_gpu.run_on_gpus(world=8). The six private copies, the threemp.spawnlaunchers and the K2torchrunjob are gone.KDA prefill correctness is fixed.
a18d2d2: unit-stride copies).Released DSpark draft (InferenceX #5119 serves
Inferact/Kimi-K3.1-Pro-DSpark):attention/norm_rope_insert_d64_rot64and its entryattention/norm_rope_insert_common;Memory hooks for the vLLM KV-pool reclaim:
swap_stream_workspaces,paged_score_topk_preallocate(rows=, release_others=)andlogits_exchange_comm(buffers=). The results are under "KV-pool memory" below.Entries (issue #11)
Each entry follows the
gemm/mxfp8_commonpattern (#9):_SHAPE_HOSTStable maps a key read from tensor dims to a shape-package module string. The key includes the world size only for kernels that communicate.importlibon the first call of its key. Importing an entry imports no shape package.Fallback contract, the same for every op:
<op>_unsupported_reasontakes exactly the op's arguments. It returnsNonewhen the op serves the call. Otherwise it returns a one-line reason, for example:<op>itself only looks up the key. Off the table it raisesValueErrorwith the same text.<op>_shapes()returns the covered keys, for load-time decisions.*_comm,*_workspace,*_runner) take the key dims as keywords and read the world size from the group.*_unsupported_reason, checked before any collective starts.router_sigmoid_bias_topkandbf16_latent_down_mxfp4_quantalso have a*_weight_reason, for per-layer load-time decisions.amd_kernels....)sampling.top_p_mask_common.top_p_masktop_p_mask_f32_v163840,top_p_mask_f32_v200064(upstream) (vocab)top_p_mask_unsupported_reasonsampling.markov_gumbel_common.markov_gumbel_fusedmarkov_gumbel_fused_v163840_r512(vocab, rank)markov_gumbel_fused_unsupported_reasonembedding.vocab_gather_common.vocab_gather_comm, thengather(ids)vocab_gather_h7168_v163840_ranks8;vocab_gather_h6144(upstream, 2 / 4 ranks) (hidden, world)vocab_gather_comm_unsupported_reason,vocab_gather_unsupported_reasonattention.kda_common.kda_decode_fb_gate_speckda_decode_fb_gate_spec_h12_d128(heads, d)kda_decode_fb_gate_spec_unsupported_reasonattention.kda_common.kda_prefill(+kda_prefill_chunk_table)kda_prefill_h12_d128(heads, d)kda_prefill_unsupported_reasonattention.kda_common.kda_mono_workspace,kda_mono_decodekda_mono_decode_k1_h12_d128(hidden, heads, d)kda_mono_workspace_unsupported_reason,kda_mono_decode_unsupported_reasonattention.mla_decode_common.qkv_a_norm_kv_insert,indexer_prepdsa_prologue_qkv_a_norm_kv_insert_h7168(q_lora, kv_lora) / (heads, d)qkv_a_norm_kv_insert_unsupported_reason,indexer_prep_unsupported_reasonattention.mla_decode_common.q_gather_comm,q_bproj_wuk_gatherdcp8_q_bproj_wuk_gather_h96_kv512(q_lora, q_b rows, heads, world)q_gather_comm_unsupported_reason,q_bproj_wuk_gather_unsupported_reasonattention.mla_decode_common.fp8_sparse_mla_decodefp8_sparse_mla_decode_dcp8_h96_kv512_top2048(heads, d_qk, record bytes)fp8_sparse_mla_decode_unsupported_reasonattention.mla_decode_common.lse_combine_comm,lse_combine_vupdcp8_lse_combine_vup_mla_h12_kv512(heads, v_head, kv_lora, world)lse_combine_comm_unsupported_reason,lse_combine_vup_unsupported_reasonattention.norm_rope_insert_common.qkv_norm_rope_insert,kv_norm_rope_insert_multilayernorm_rope_insert_d64_rot64(head_dim, rotary_dim)qkv_norm_rope_insert_unsupported_reason,kv_norm_rope_insert_multilayer_unsupported_reason,rope_unsupported_reasonattention.mla_decode_common.fp8_dense_mla_decodefp8_dense_mla_decode_h96_kv512(heads, d_qk)fp8_dense_mla_decode_unsupported_reasonindexer.mxfp4_indexer_common.mxfp4_paged_score_topkmxfp4_paged_score_topk_d128_h32_top2048(heads, d, top-k, page rows)mxfp4_paged_score_topk_unsupported_reasonindexer.mxfp4_indexer_common.mxfp4_prefill_scoremxfp4_prefill_score_d128_h32(heads, d)mxfp4_prefill_score_unsupported_reasonindexer.mxfp4_indexer_common.mxfp4_prefill_topkmxfp4_prefill_topk_d128_h32_top2048(top-k)mxfp4_prefill_topk_unsupported_reasoncollectives.topk_gather_merge_common.topk_gather_merge_comm, thencomm(...)dcp8_topk_gather_merge_top2048(top-k, world)topk_gather_merge_comm_unsupported_reason,topk_gather_merge_unsupported_reasonmoe.latent_moe_common.router_sigmoid_bias_topk(+router_aux)router_sigmoid_bias_top16_e896_h7168(E, H, top-k)router_sigmoid_bias_topk_unsupported_reason,router_sigmoid_bias_topk_weight_reasonmoe.latent_moe_common.moe_weights,moe_sort*,quantize_moe_activations,mxfp4_moe_expertsmxfp4_h3584_i3072_e896_top16(w13 shape)moe_weights_unsupported_reason,mxfp4_moe_experts_unsupported_reason(+ sort / quant reasons)moe.latent_moe_common.latent_tail_comm,allreduce_latent_rmsnorm_up_proj,allreduce_slots_rmsnorm_up_projallreduce_latent_rmsnorm_up_proj_h3584_n896_ranks8(N, K, world)latent_tail_comm_unsupported_reason,allreduce_{latent,slots}_rmsnorm_up_proj_unsupported_reasonmoe.latent_moe_common.layer_tail_runner,layer_tail_launchlayer_tail_k2_h7168_ranks8(hidden, o_proj K, E, world)layer_tail_runner_unsupported_reason,layer_tail_launch_unsupported_reasonnorm.attnres_rmsnorm_common.attnres_comm, thencomm.allreduce_attnres_rmsnorm(...)allreduce_attnres_rmsnorm_h7168_ranks8(hidden, world)attnres_comm_unsupported_reason,allreduce_attnres_rmsnorm_unsupported_reasongemm.bf16_common.bf16_latent_down_mxfp4_quantbf16_latent_down_mxfp4_quant_k7168_n3584(N, K)bf16_latent_down_mxfp4_quant_unsupported_reason,bf16_latent_down_mxfp4_quant_weight_reasongemm.bf16_common.linear_gather_comm,bf16_linear_gatherbf16_linear_gather_n896_k35840_ranks8(N shard, K, world)linear_gather_comm_unsupported_reason,bf16_linear_gather_unsupported_reasoncollectives.logits_exchange_common.logits_exchange_comm(returnsLogitsExchange), thencomm.gemm_exchange(...)bf16_n20480_k7168+ exchangeall_to_all_bf16_n20480_ranks8(N shard, K, world)logits_exchange_comm_unsupported_reason,logits_gemm_exchange_unsupported_reasondecoder.bf16_dense_mlp_common.dense_mlp_workspace,bf16_dense_mlpbf16_dense_mlp_h7168_i1792(hidden, inter)dense_mlp_workspace_unsupported_reason,bf16_dense_mlp_unsupported_reasonPackages without an entry of their own:
gemm/bf16_skinny_commonis already its op's entry. It reads (N, K) from the weight, andsupports(n, k)is its coverage query.handshake_ranks8,common/rank8_*andcommon/mono/are infrastructure.Upstream packages with a different contract are not folded in. Examples:
bf16_n50016_k6144/bf16_n100032_k6144, which pull-publish rather than owner-push;Tests per entry:
test_routing.py(CPU): the table, the keys, every reason branch, signature equality, and no shape import.test_entry.py: the entry's output is bit-equal to the direct package call.test_warm_up.py: no late compile, and graph replay equals eager.test_*_ranks8.py: the 8-rank entries, with rows intools/ci/targets.tsv.benchmarks/<area>/<entry>/benchmark_routing.py: the host time the entry adds.Kernels
How to read the table:
Each package README has the full table and its baseline.
dsa_prologue_qkv_a_norm_kv_insert_h7168rms_norm+concat_and_cache_mla; indexer key LayerNorm + MXFP4 insert, query quant, weights, top-k reset (~9 launches -> 2)dcp8_q_bproj_wuk_gather_h96_kv512torch.bmm(W_UK) +torch.cat+ AITER all-gatherfp8_sparse_mla_decode_dcp8_h96_kv512_top2048sparse_mla_fwd; on the current vLLM base the FlyDSL 96-head kerneldcp8_lse_combine_vup_mla_h12_kv512dcp_vup_rs_combine(LSE mask, LSE all-gather, W_UV bmm, scale, reduce-scatter) + output gatefp8_dense_mla_decode_h96_kv512mla_decode_fwd(preview DSpark draft layers)norm_rope_insert_d64_rot64triton_reshape_and_cache_flash(5 launches per layer); context K/V store (9 launches)kda_decode_fb_gate_spec_h12_d128kimi_k3_kda_fb_proj+causal_conv1d_update+fused_recurrent_kda+FusedRMSNormGatedkda_mono_decode_k1_h12_d128kda_prefill_h12_d128mxfp4_paged_score_topk_d128_h32_top2048top_k_per_row_decodemxfp4_prefill_score_d128_h32mxfp4_prefill_topk_d128_h32_top2048top_k_per_row_prefilldcp8_topk_gather_merge_top2048merge_dcp_scoreshandshake_ranks8all_to_all_bf16_n20480_ranks8tensor_model_parallel_all_gather(orall_to_all_single+ permute) after the lm_head GEMMvocab_gather_h7168_v163840_ranks8VocabParallelEmbedding(mask,F.embedding,masked_fill_, AITER all-reduce)bf16_latent_down_mxfp4_quant_k7168_n3584per_1x32_mx_quant_hipbf16_n20480_k7168tgemm.mm(lm_head shard)bf16_linear_gather_n896_k35840_ranks8context_proj(replicated GEMM + norm)bf16_skinny_commonrocm_unquantized_gemm_impl, 15 dense decode shapesbf16_dense_mlp_h7168_i1792KimiMLP(2 GEMMs +silu_and_mul)router_sigmoid_bias_top16_e896_h7168mxfp4_h3584_i3072_e896_top16fused_moe(sort, quant, two stages)allreduce_latent_rmsnorm_up_proj_h3584_n896_ranks8layer_tail_k2_h7168_ranks8allreduce_attnres_rmsnorm_h7168_ranks8top_p_mask_f32_v163840apply_top_k_top_p(7 launches)markov_gumbel_fused_v163840_r512DSparkSpeculator._sample_sequentialloopNaming.
dcp8in four names (dcp8_q_bproj_wuk_gather_h96_kv512,fp8_sparse_mla_decode_dcp8_h96_kv512_top2048,dcp8_lse_combine_vup_mla_h12_kv512,dcp8_topk_gather_merge_top2048) is a shape token, not a deployment name. It fixes the data layout the kernel reads and writes: a KV cache split over 8 decode-context-parallel ranks, the 96 = 8 x 12 gathered heads, and the 8-plane score and LSE exchanges. The kernels are only correct for that split. For the three that communicate it plays the role ofranks8; the sparse MLA decode is single-GPU but reads the 8-way split cache.End-to-end results (released DSpark draft)
Setup:
Inferact/Kimi-K3.1-Pro-DSparkdraft, TP8 / DCP8, 8 x MI355X.TRITON_ATTN.The c24 failure is the client's
ClientOSError: Can not write request body, the same class of error the CI runs show.KV-pool memory (follow-up)
Server start-ups with the #5119 command, the CI image's ROCr preloaded, and the vLLM KV-pool reclaim from #69172. The reclaim:
max_num_seqs x (1 + k)rows.This PR's part is the reuse hooks the reclaim calls:
swap_stream_workspaces,paged_score_topk_preallocate(rows=, release_others=)andlogits_exchange_comm(buffers=).Accuracy
gsm8k, chat endpoint, non-thinking, T=0, real acceptance (rejection sampling, not synthetic), #5119 server config, KDA prefill on.
fa1b2db1c, this PR atf9e9254)The wrong answers are coherent model errors, on questions that also fail in earlier runs. There is no garbage output.
Tests
How to run (from each package README):
Results on MI355X:
*_common/test_routing.py(CPU)targets.tsv(one file per 8-rank run)logits_exchange_common/test_entry_ranks8,all_to_all_bf16_n20480_ranks8/test_exchange,bf16_n20480_k7168/test_push, K2test_layer_tailkda_prefill_h12_d128(all files)kda_commonbf16_n20480_k7168test_prefill.py -k "stale or hand_over or mega", the three touchedtest_routing.py,test_layer_tail_ranks8.py, Markov@benenzhu also ran f8b3a9d in the vLLM ROCm nightly image: 112 of 114 targets pass. The remaining
test_indexer_prep::test_stock_opsfailure needs vLLM'squantize_queries_and_weights, which arrives with #69172.The full
tools/ci/run_tests.shsweep was not re-run on the final head. The suites above were run file by file.CI
kernel-tests-mi355x/kernel-tests-mi350xstay queued. Fork approval is not the cause: this PR'stagjob ran and passed. What a maintainer needs to do:mi355x-slurm/mi350x-slurm. In this repo's run history, every one of these jobs was cancelled, failed at start, or is still queued, including pushes tomainand the nightly schedule. The runners have to be registered forInferact/amd-kernels. If they are in an org runner group, that group must include this repo and allow public repositories.pull_requestruns from forks do not get repository variables (vars.AKR_CI_ROOT,AKR_IMAGE, ...).kernel-testsstatus gets a 403.Inferact/amd-kernelsand runworkflow_dispatchon it;pull_request_target/workflow_runpath;kernel-testsstatus by hand after a local run.Known issues
kda_prefillcall in a process writes recurrent and conv-state slot 0 of the caller's caches. It is harmless in vLLM, where slot 0 is the null block, but the warm-up should use its own scratch.ncta;bf16_skinny_common. The owner-row mode of the logits exchange needs--enable-batch-sharded-sampling, which the #5119 command does not use.Co-Authored-Bytrailer, and one is authored byClaude <[email protected]>. A squash merge, as for indexer: half-run work split in the four-GPU decode scorer #6 / [Kernel][DSv4.1] Add batched MXFP8 GEMM with fused MXFP8 output on MI355X #7 / gemm: every MXFP8 GEMM shape's rows in its own folder, no common table #9, gives one clean commit.Companion vLLM PR
vllm-project/vllm#69172, base
k31-amd-tracking. It needs this PR at f8b3a9d or later, and was tested with this head.🤖 Generated with Claude Code