moe_topk_sqrtsoftplus_batched

Function moe_topk_sqrtsoftplus_batched 

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

Batched sqrtsoftplus + correction-bias routing (DeepSeek-V4 prefill).

Same I/O as moe_topk_sigmoid_batched but scores experts with sqrt(log(1+exp(logits))) (matching the single-token decode path), so V4 prefill and decode route identically. Grid (N) / Block (256).