moe_topk_softmax

Function moe_topk_softmax 

Source
pub fn moe_topk_softmax(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    gate_logits: DevicePtr,
    expert_indices: DevicePtr,
    expert_weights: DevicePtr,
    num_experts: u32,
    top_k: u32,
    normalize: bool,
    stream: u64,
) -> Result<()>
Expand description

GPU-side MoE top-K softmax.

Finds top-K experts from BF16 gate logits, computes softmax weights.

Kernel: moe_topk_softmax(gate_logits, expert_indices, expert_weights, num_experts, top_k, normalize) Grid: (1, 1, 1) Block: (256, 1, 1)