vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors_moe.compressed_tensors_moe_wna16_rdna3 ¶
CompressedTensors MoE W4A16 using the fused RDNA3 (gfx1100) HIP kernel.
Uses moe_gptq_gemm_rdna3 — a single HIP kernel launch per GEMM that handles expert routing + W4A16 dequant + dot product with atomic output.
Weight format (per expert, same as dense RDNA3 W4A16): - Packed int32 [E, K/8, N] with exllama shuffle - Scales [E, groups, N] in activation dtype - Zero points [E, groups, N/8] packed int32 (synthesized)
Classes:
-
CompressedTensorsWNA16RDNA3MoEMethod–W4A16 MoE using the fused RDNA3 HIP kernel (moe_gptq_gemm_rdna3).
CompressedTensorsWNA16RDNA3MoEMethod ¶
Bases: CompressedTensorsWNA16MoEMethod
W4A16 MoE using the fused RDNA3 HIP kernel (moe_gptq_gemm_rdna3).
Weights are in RDNA3 format (shuffled int32 [E, K/8, N]), NOT Triton format (transposed uint8). apply() dispatches through the fused HIP kernel directly.
Source code in vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_wna16_rdna3.py
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 | |
_rdna3_fused_moe(hidden_states, topk_weights, topk_ids, layer, activation, apply_router_weight_on_input, global_num_experts, expert_map) ¶
Fused MoE forward using the RDNA3 W4A16 HIP kernel.
Optimizations vs naive dispatch
- BLOCK_SIZE_M=1 for decode (no padding waste, bf16 fast path)
- Pre-allocated buffers (no torch.zeros per call)
- Inline token sorting for small M (skip moe_align_block_size)
- moe_sum fused into output accumulation
Source code in vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_wna16_rdna3.py
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 | |
_synthesize_qzeros(groups, out_features, device) ¶
Create packed zero-point tensor for symmetric quant.
GPTQv1 +1 quirk: kernel adds 1 to stored zeros, so encode (bias - 1) = 7 for uint4b8 (bias=8).