build_ep_routing_table

Function build_ep_routing_table 

Source
pub fn build_ep_routing_table(
    gate_indices: &[u32],
    gate_weights: &[f32],
    num_tokens: usize,
    top_k: usize,
    local_expert_start: usize,
    local_expert_end: usize,
) -> EpRoutingTable
Expand description

2026-09-25: Build the table from row-major [num_tokens, top_k] expert ids and weights. An expert is local when it lies in local_expert_start..local_expert_end.

ยงPanics

If gate_indices.len() or gate_weights.len() is not num_tokens * top_k.