vllm.models.muse_spark.nvidia.ops.prepare_megamoe_nvfp4
¶
Triton input staging for MuseSpark1x on the NVFP4 MegaMoE kernel.
MegaMoE reads linear scales, not scaled_fp4_quant's swizzled 128x4 layout.
Functions:
-
prepare_megamoe_nvfp4_inputs–Stage
hidden_statesand routing into MegaMoE's symmetric buffer. -
prepare_megamoe_nvfp4_with_norm–Normalize BF16 pooled states and write NVFP4 into MegaMoE's buffer.
prepare_megamoe_nvfp4_inputs(hidden_states, topk_weights, topk_ids, x_packed, x_sf, topk_idx_out, topk_weights_out, is_padding=None)
¶
Stage hidden_states and routing into MegaMoE's symmetric buffer.
Source code in vllm/models/muse_spark/nvidia/ops/prepare_megamoe_nvfp4.py
prepare_megamoe_nvfp4_with_norm(hidden_states, norm_weight, norm_eps, gain_center, x_packed, x_sf)
¶
Normalize BF16 pooled states and write NVFP4 into MegaMoE's buffer.
The caller must join the routing aux stream before launching MegaMoE.