pub struct EpRoutingTable {
pub local_token_indices: Vec<u32>,
pub local_expert_ids: Vec<u32>,
pub local_weights: Vec<f32>,
pub remote_token_indices: Vec<u32>,
pub remote_expert_ids: Vec<u32>,
pub remote_weights: Vec<f32>,
}Expand description
Routing table for EP token dispatch.
Partitions top-K expert assignments into local (this rank owns the expert) and remote (partner rank owns the expert) buckets. Each entry is a (token_index, expert_id, weight) triple.
Fields§
§local_token_indices: Vec<u32>Token indices routed to this rank’s experts.
local_expert_ids: Vec<u32>Expert IDs for local tokens (absolute, not rank-relative).
local_weights: Vec<f32>Routing weights for local tokens.
remote_token_indices: Vec<u32>Token indices routed to the remote rank’s experts.
remote_expert_ids: Vec<u32>Expert IDs for remote tokens (absolute, not rank-relative).
remote_weights: Vec<f32>Routing weights for remote tokens.
Implementations§
Source§impl EpRoutingTable
impl EpRoutingTable
Sourcepub fn local_count(&self) -> usize
pub fn local_count(&self) -> usize
Number of (token, expert) pairs handled locally.
Sourcepub fn remote_count(&self) -> usize
pub fn remote_count(&self) -> usize
Number of (token, expert) pairs dispatched to remote rank.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of (token, expert) pairs (should equal num_tokens * top_k).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EpRoutingTable
impl RefUnwindSafe for EpRoutingTable
impl Send for EpRoutingTable
impl Sync for EpRoutingTable
impl Unpin for EpRoutingTable
impl UnwindSafe for EpRoutingTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more