Commit 4416dc2
authored
Qwen3.5 moe optimizations (#113)
* tilelang gated RMSNorm for Qwen3.5 GDN output
(cherry picked from commit 6dcdb3f)
* fused zba spilt
(cherry picked from commit 58d9e4a)
* support decode gdn mate
(cherry picked from commit 8b463e9)
* qwen3.5 tilelang prefill causal conv1d
(cherry picked from commit 55c085e)
* feed mate no-copy strided q/k/v views and fused gdn gating
(cherry picked from commit e5f6b40)
* del causal_conv1d d2h and gemmarmsnorm 3D to 2D
(cherry picked from commit e947cdb)
Series patch renumbered 0086 -> 0081; v0.24.0-dev already uses 0086.
* use mate output to reduce dtod and del cu_seqlens to int64
(cherry picked from commit 32b7287)
* del fused moe deepseek v4 name and fused glue deepgemm moe prefill
(cherry picked from commit 088e0fb)
Keep a default-on VLLM_MUSA_MOE_DEEPGEMM_PREFILL kill switch so the
generalized prefill path can be turned off without a code change.
* shared expert folded into the routed FP8 grouped GEMM as slot 256
(cherry picked from commit 7312722)
Widen the existing fold gate to accept FP8 [128,128] block weights in
addition to unquantized, keep it off under expert parallelism / EPLB,
and add the VLLM_MUSA_MOE_SHARED_EXPERT_FUSION switch.
* row-tiled fused silu+mul+FP8-quant kernel replace silu_and_mul_per_token_group_fp8_quant
(cherry picked from commit 44268a4)
* optional separate contiguous mamba state pool for in-place GDN decode
(cherry picked from commit 7e8c9b3)
Only the dedicated BlockPool half: the contiguous per-state striding it
also carried is already unconditional in the gpu_model_runner patch.
Regenerated the kv_cache_utils patch, whose upstream copy was truncated.
* default the separate mamba pool on
Sharing one KV tensor between a mamba layer and an attention layer is only
safe while both index it as block_id * page_size. The segregated per-state
mamba layout breaks that congruence, so without the dedicated pool the two
overlap and decode output degrades past ~9 concurrent requests.
Verified on Qwen3.5-35B-A3B-FP8, tp1, 16 capture sizes: shared pool is clean
at 4 and 8 concurrent and garbage at 16; the dedicated pool is 16/16 clean.
* per token group quant fp8 and del some redundant op
(cherry picked from commit 8eae317)
Series patch renumbered 0090 -> 0085. Also aligns the GDN decode env
default with the kv-cache one so the dedicated pool takes the in-place
path instead of falling back to gather/scatter.
* rebase two build patches onto the current series
0060 carried pre-#108 context for the PrivateUse1 registration block that
0044 now emits two lines longer, so the final hunk no longer matched.
0085 re-applied the is_musa() branch that 0012 already adds to the
per-token-group quant dispatch; it now only introduces the vec fast path.
Both were caught by running vllm_musa/patches/build_apply.py, which is what
setup.py invokes; a plain three-way apply absorbs the duplicate and hides it.
* fuse QK-RMSNorm and MRoPE for interleaved MRoPE gated attention
Ports the MUSA kernel from the qwen35_moe branch. The IR provider registered
for gated_qkv_rms_norm_rope only enters the priority list under Inductor and
excludes routed MoE, so Qwen3.5 ran the eager rotary path; this dispatches the
fused kernel ahead of the IR call and leaves it as the fallback.
Measured on Qwen3.5-35B-A3B-FP8 tp1, 2500/1500 x16 @ concurrency 64:
output throughput 509.45 -> 557.54 tok/s, mean TPOT 30.65 -> 27.99 ms.
* perf: dispatch residual Gemma RMSNorm through the fused JIT kernel1 parent 68b5ef7 commit 4416dc2
26 files changed
Lines changed: 9320 additions & 74 deletions
File tree
- vllm_musa
- jit_kernel
- csrc
- norm
- quant
- tilelang
- model_executor/layers
- fused_moe
- mamba/gdn
- quantization
- patches/series
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
0 commit comments