moe_w4a4_grouped_gemm_relu2

Function moe_w4a4_grouped_gemm_relu2 

Source
pub fn moe_w4a4_grouped_gemm_relu2(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    a_packed: DevicePtr,
    a_sf: DevicePtr,
    b_packed_ptrs: DevicePtr,
    b_scale_ptrs: DevicePtr,
    scale2_vals: DevicePtr,
    output: DevicePtr,
    expert_offsets: DevicePtr,
    sorted_token_ids: DevicePtr,
    num_experts: u32,
    n_out: u32,
    k: u32,
    max_m_tiles: u32,
    stream: u64,
) -> Result<()>
Expand description

2026-09-25: Grouped W4A4 expert up GEMM on the FP4 block-scale MMA, with relu^2 applied to the accumulator before the BF16 store. A is NVFP4 (packed E2M1 + per-16 E4M3 scales) in token order, gathered through sorted_token_ids; B is read from the per-expert NVFP4 pointer tables. blockIdx.z is the expert, and expert_offsets bounds its rows. The kernel ships only in kernels/gb10/nemotron-labs-3-puzzle-75b-a9b/nvfp4/moe_w4a4_grouped.cu.