moe_w8a8_grouped_gemm_pm4

Function moe_w8a8_grouped_gemm_pm4 

Source
pub fn moe_w8a8_grouped_gemm_pm4(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    a_fp8: DevicePtr,
    a_scale: DevicePtr,
    weight_ptrs: DevicePtr,
    scale_ptrs: DevicePtr,
    output: DevicePtr,
    expert_offsets: DevicePtr,
    sorted_token_ids: DevicePtr,
    num_experts: u32,
    n: u32,
    k: u32,
    worklist: DevicePtr,
    total_tiles: DevicePtr,
    max_tiles: u32,
    stream: u64,
) -> Result<()>
Expand description

W8A8 + FP32 epilogue grouped MoE GEMM — PM4 geometry over the COMPACTED work-list built by moe_build_tile_worklist (kernel moe_w8a8_grouped_gemm_pm4, same module/numerics as moe_w8a8_grouped_gemm: bit-identical output, measured).

Same grid-compaction contract as moe_fp8_grouped_gemm: the kernel grid-strides by gridDim.x over the work-list, so the launch is sized to max_tiles (wl_cap_items), clamped to MAX_GRID_CTAS. Oversubscription is safe; undersizing is merely slower, never wrong.

SAME-STREAM INVARIANT: MUST be launched on the SAME stream as the preceding moe_build_tile_worklist (read-after-write of total_tiles).

Grid: (max_tiles.clamp(1, MAX_GRID_CTAS), 1, 1) Block: (256, 1, 1)