vllm.models.inkling2.nvidia.ops.moe_sm90
¶
Inkling2 routed experts on Hopper: Humming expert GEMMs (bf16 activations, NVFP4 / MXFP8 weights) in place of the TRT-LLM-gen ones.
Rows stay in the flat (token * topk + slot) order: the gate/up GEMM
gathers each row's token, the down GEMM reads and writes row by row, and
ops.moe.combine sums them with the identity src2dst (-1: not local).
Classes:
-
HummingExperts–Humming tensors and kernel configs of the two expert projections.
Functions:
-
select_experts–The router and top-k of
ops.moe.route, without its layout. -
swiglu–activation.swiglu_quantize's SiTU of the interleaved (gate, up)
HummingExperts
¶
Humming tensors and kernel configs of the two expert projections.
Parameters:
-
(weights¶dict[str, tuple[Tensor, Tensor, Tensor | None]]) –Per projection (
w13,w2), the row-major checkpoint weights[E, N, K / pack], block scales[E, N, K / group]and, for NVFP4, the per-expert global scales[E](else None). -
(shapes¶tuple[tuple[int, int], tuple[int, int]]) –(N, K)of each projection. -
(nvfp4¶bool) –NVFP4 (else MXFP8) weights.
Methods:
-
__call__–bf16
[T * topk, H]down-projection rows of the local slots of
Source code in vllm/models/inkling2/nvidia/ops/moe_sm90.py
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 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
__call__(x, ids, weights, src2dst, num_global_experts, gate_cap, up_cap)
¶
bf16 [T * topk, H] down-projection rows of the local slots of
ids (select_experts); the other rows are left unset.
Source code in vllm/models/inkling2/nvidia/ops/moe_sm90.py
_select_kernel(Partials, Bias, ExpertBounds, IsPadding, Ids, Weights, Src2Dst, T, route_scale, E, E_POW2, GROUPS, TOPK, SORT)
¶
Local expert ids (-1: not local), routing weights and identity
src2dst of the flat rows of one token.
Source code in vllm/models/inkling2/nvidia/ops/moe_sm90.py
_swiglu_kernel(GateUp, Weights, Src2Dst, Out, N, BLOCK, GATE_CAP, UP_CAP)
¶
bf16 softcapped SwiGLU of a local row times its routing weight.
Source code in vllm/models/inkling2/nvidia/ops/moe_sm90.py
select_experts(x, gate_weight, bias, topk, route_scale, expert_bounds, is_padding=None)
¶
The router and top-k of ops.moe.route, without its layout.
Returns the local expert id of each token's slots [T, topk] (-1: not
one of the local experts expert_bounds, or a padding token), their
routing weights [T * topk] and the identity src2dst [T * topk]
of the local rows (-1 elsewhere).
Source code in vllm/models/inkling2/nvidia/ops/moe_sm90.py
swiglu(gate_up, weights, src2dst, gate_cap, up_cap)
¶
activation.swiglu_quantize's SiTU of the interleaved (gate, up)
columns times the routing weights, in bf16, for the local rows (the
others are left unset).