vllm.models.nemotron_shortcut.nvidia.moe
¶
Nemotron Shortcut's MoE: latent routed experts with a soft-clamped ReLU².
Modules:
-
config–The MoE config of Nemotron Shortcut's clamped ReLU² experts.
-
experts–Nemotron Shortcut routed experts and their quantization methods.
-
flashinfer–FlashInfer experts that implement Nemotron Shortcut's clamped ReLU².
-
kernels–Triton expert GEMMs for Nemotron Shortcut's clamped ReLU² experts.
-
layer–Nemotron Shortcut's latent MoE.
-
runner–A MoE runner whose routing and expert compute are separate graph nodes.
Classes:
-
NemotronShortcutMoE–Latent MoE with shared experts, run in caller-placed stages.
-
NemotronShortcutMoEConfig–FusedMoEConfigplus the soft clamp of the experts' ReLU². -
NemotronShortcutMoEOutput–The routed output transform: RMSNorm, then the latent up-projection.
-
NemotronShortcutMoERunner–MoERunnerwith the forward split into three caller-placed stages. -
NemotronShortcutRoutedExperts–Routed experts that select one of the clamp-aware implementations.
NemotronShortcutMoE
¶
Bases: Module
Latent MoE with shared experts, run in caller-placed stages.
begin_staged routes and dispatches, run_staged_experts runs the routed
experts once the caller's current_path_output exists, and
finish_staged adds the shared experts' output. forward runs the three
in a row. A caller that runs a mixer between the first two calls
receive_staged before the mixer's attention or GDP op.
Methods:
-
route_logit_space–Select
topk(logits + bias); weight by the unbiased sigmoid scores.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/layer.py
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 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 | |
route_logit_space(hidden_states, gating_output, topk, renormalize)
¶
Select topk(logits + bias); weight by the unbiased sigmoid scores.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/layer.py
NemotronShortcutMoEConfig
dataclass
¶
Bases: FusedMoEConfig
FusedMoEConfig plus the soft clamp of the experts' ReLU².
Source code in vllm/models/nemotron_shortcut/nvidia/moe/config.py
NemotronShortcutMoEOutput
¶
Bases: Module
The routed output transform: RMSNorm, then the latent up-projection.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/layer.py
NemotronShortcutMoERunner
¶
Bases: MoERunner
MoERunner with the forward split into three caller-placed stages.
Shared experts are not part of the runner: the caller runs them on its
own input and passes their (unreduced) output to finish_staged.
Methods:
-
begin_staged–Route and dispatch
hidden_states; returns the later stages' input. -
finish_staged–Reduce, transform and add the shared output.
-
receive_staged–Wait for the dispatch if a piecewise CUDA graph piece is captured.
-
run_staged_experts–Run the routed experts after
current_path_outputis computed.
Attributes:
-
overlaps_transport(bool) –Whether the dispatch and the combine run on the side stream.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/runner.py
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 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |
overlaps_transport
property
¶
Whether the dispatch and the combine run on the side stream.
Only the all-gather/reduce-scatter transport, the one these experts use with DP. DBO overlaps it with the other microbatch instead, and PCP adds collectives outside the kernel.
begin_staged(hidden_states, router_logits)
¶
Route and dispatch hidden_states; returns the later stages' input.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/runner.py
finish_staged(dependency, output_template, shared_output=None)
¶
Reduce, transform and add the shared output.
output_template gives the result's shape and dtype.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/runner.py
receive_staged(dispatch, projections)
¶
Wait for the dispatch if a piecewise CUDA graph piece is captured.
Callers place this after projections and before the op that ends the
piece (an attention or GDP op), so the dispatch still overlaps the
projections. Otherwise the experts stage waits, after the whole mixer.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/runner.py
run_staged_experts(dispatch, current_path_output)
¶
Run the routed experts after current_path_output is computed.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/runner.py
NemotronShortcutRoutedExperts
¶
Bases: RoutedExperts
Routed experts that select one of the clamp-aware implementations.