Repository navigation
perf(rdna2): opt-in MoE skinny v2 decode, M=16 decode kernels, small-op pass (port of leapdragon) - #57
Draft
BlivionIaG wants to merge 1 commit into
Draft
perf(rdna2): opt-in MoE skinny v2 decode, M=16 decode kernels, small-op pass (port of leapdragon)#57BlivionIaG wants to merge 1 commit into
BlivionIaG wants to merge 1 commit into
Conversation
…op pass Ported from leapdragon/vllm-rdna2-qwen@fd8d939ae and @a80aad336 (Aron Hsiao), adapted to rdna_extras. Everything is gfx10x-only and opt-in; defaults are unchanged. - moe_skinny_int4_decode_v2 (VLLM_RDNA_MOE_V2=1): no LDS activation staging, 16-byte weight loads, exact natural-order int4 dequant into v_dot2, EP-local slot compaction in w2, optional residual epilogue. The Python wrapper falls back to v1 when the v2 shape/alignment contract does not hold. Same sequential moe_wna16 layout as v1. - gemv_i8_rdna2 takes M up to 16 (16 native, 9..15 as 8 + rest); the fused glue ops (rdna_gemv_act, rdna_hc_up_gate_mix, rdna_se_*) take M == 16. The Python decode caps move to 16 only with VLLM_RDNA_DECODE_M16=1. gemv_f16_rdna2 routing is unchanged (it already guards 9..32, and rocBLAS wins at M=16-24 on our tuned rows). - VLLM_RDNA_MOE_ALIAS=1: the modular MoE kernel writes into the caller's fresh output on gfx10x, as upstream does for aiter (one device copy less per MoE layer). - VLLM_RDNA_HC_V2=1: split-K int8 rdna_gemv_act for N < 1152, K >= 4096 (HC down projection). Tests: tests/kernels/quantization/test_rdna_decode_m16.py (CPU predicates; GPU kernel checks ported from his tools/rdna2 tests). Co-authored-by: Aron Hsiao <leapdragon@gmail.com>
This was referenced Oct 12, 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.
Ports: leapdragon/vllm-rdna2-qwen fd8d939 (MoE skinny v2, decode kernels to M=16) and a80aad3 (decode small-op pass), author Aron Hsiao leapdragon@gmail.com. Adapted to rdna_extras. Everything is gfx10x-only and opt-in; defaults are unchanged.
Changes
VLLM_RDNA_MOE_V2=1moe_skinny_int4_decode_v2: no LDS activation staging, 16-byte weight loads, exact natural-order int4 dequant into v_dot2, EP-local slot compaction in w2, optional residual epilogue. Same sequential moe_wna16 layout as v1. The_custom_opswrapper falls back to v1 when the v2 contract does not hold (alignment, K/N % 32, K <= 4096, group % 32, topk <= 32).VLLM_RDNA_DECODE_M16=1rdna_dense_gemm(int8 shadow GEMV) takes batches up to 16, and the fused glue (rdna_gemv_act,rdna_hc_up_gate_mix,rdna_se_*) takes M == 16. The kernels always accept M=16 now (gemv_i8_rdna2: 16 native, 9..15 as 8 + rest); only the Python caps are gated.gemv_f16_rdna2routing is unchanged: it already guards 9..32, and our crossover bench has rocBLAS ahead at M=16-24.VLLM_RDNA_MOE_ALIAS=1VLLM_RDNA_HC_V2=1rdna_gemv_actfor N < 1152, K >= 4096 (HC down projection). Read in C++.MoE batches above 8 still need
VLLM_ROCM_MOE_SKINNY_MAX_M=16(existing knob).Files:
csrc/rocm/{skinny_gemms_int4.cu,rdna_fused_glue.cu,ops.h,torch_bindings.cpp},vllm/_custom_ops.py,vllm/envs.py,rdna_ops.py,rdna_dense_int8.py,fused_moe/modular_kernel.py, plus the newtests/kernels/quantization/test_rdna_decode_m16.py(CPU predicates; GPU kernel checks ported from histools/rdna2/{skinny_m16,glue_m16,moe_v2}_test.py).His numbers (his box, 4x V620 TP=4/EP, his bench, not ours)
Checks run here
ops.hdecl,torch_bindings.cppdef/impl,_custom_opswrapper. The op mutates its outputs and returns(), the same pattern as v1, so it needs no fake.vllmin the allowed env fails on missingregex.GPU validation to run
pytest tests/kernels/quantization/test_rdna_decode_m16.py tests/kernels/quantization/test_rocm_moe_skinny.pyon gfx1030.MOE_V2=1vs all four on (+VLLM_ROCM_MOE_SKINNY_MAX_M=16): 1k/512 and 16k/1k at c=1 and c=8. Report prefill tok/s, decode tok/s/req, TTFT s and ITL ms for each.DECODE_M16andHC_V2only matter with int8 shadows (perf(rdna2): int8 dense shadows on in the Flash-Next recipes (port of leapdragon T45) #56), so bench them on top ofVLLM_RDNA_DENSE_INT8=1.