vllm.models.inkling2.nvidia.moe
¶
Inkling2 mixture-of-experts layer (routed experts only, NVFP4 or MXFP8).
Experts are sharded contiguously over the TP group (EP size = TP size); each
rank returns the full all-reduced bf16 output. Checkpoint names under
model.llm.layers.N.mlp map 1:1 to parameters.
Classes:
-
ExpertsLoRA–Adds the routed experts' LoRA deltas (
lora.Inkling2MoEWithLoRA), -
Inkling2Experts– -
Inkling2MoE–
ExpertsLoRA
¶
Bases: Protocol
Adds the routed experts' LoRA deltas (lora.Inkling2MoEWithLoRA),
for an experts implementation over expert-sorted rows: row r is token
perm[r] // topk, and this rank's experts own rows
[offsets[0], offsets[-1]). The NVFP4 / MXFP8 experts here (tile-padded
rows, quantized activations) do not support it; the BF16 experts a model
may plug in instead (SkyRL's Inkling2BF16Experts) do.
Source code in vllm/models/inkling2/nvidia/moe.py
Inkling2Experts
¶
Bases: Module
Methods:
-
forward–routingandquantized(xin the expert layout) are from -
scales–Outer scale amax and denominator of a projection's NVFP4 weights.
Source code in vllm/models/inkling2/nvidia/moe.py
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 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 | |
forward(x, routing, quantized, plan, reduce=True, push=None)
¶
routing and quantized (x in the expert layout) are from
ops.moe.route (on Hopper, routing is from
ops.moe_sm90.select_experts and quantized is None). The routing
weight is applied inside the SwiGLU, before the down projection.
Without reduce, returns the local expert rows and src2dst for
the consumer to combine and reduce, or pushes their combine to the
token shard owners.
Source code in vllm/models/inkling2/nvidia/moe.py
scales(name)
¶
Outer scale amax and denominator of a projection's NVFP4 weights.
Source code in vllm/models/inkling2/nvidia/moe.py
Inkling2MoE
¶
Bases: Module
Methods:
-
forward–bf16 [T, H] -> bf16 [T, H], reduced over the expert-parallel group;
Source code in vllm/models/inkling2/nvidia/moe.py
forward(x, reduce=True, push=None, lora=None)
¶
bf16 [T, H] -> bf16 [T, H], reduced over the expert-parallel group;
without reduce, the unreduced (down, src2dst) of
Inkling2Experts, or (with push) pushes this rank's partial sums
to the token shard owners.
Padding tokens (is_padding of the forward context) are routed to
no expert and come out as 0. lora (Inkling2MoEWithLoRA) adds
per-expert LoRA deltas inside the expert GEMMs, before any reduce or
push; the NVFP4 / MXFP8 experts here do not support it.