vllm.models.nemotron_shortcut.nvidia.moe.kernels
¶
Triton expert GEMMs for Nemotron Shortcut's clamped ReLU² experts.
routed_experts reproduces the training numerics: the clamp, the ReLU², and
the routing weight are applied after the up projection and rounded to the
activation dtype before the down projection, and the top-k sum is kept in
FP32. Both projections optionally read MXFP8 weights and quantize their
activations in-kernel.
Functions:
-
mxfp8_quantize_block–Quantize rows of 32 values to E4M3 with E8M0 scales.
-
routed_experts–Run the local experts on every route and sum the top-k in FP32.
mxfp8_quantize_block(x)
¶
Quantize rows of 32 values to E4M3 with E8M0 scales.
Source code in vllm/models/nemotron_shortcut/nvidia/moe/kernels.py
routed_experts(x, up, down, ids, weights, begin, clamp, up_scale=None, down_scale=None)
¶
Run the local experts on every route and sum the top-k in FP32.
up and down hold the experts [begin, begin + len(up)); routes to
other experts contribute zero, so EP ranks return partial sums.