Skip to main content

ExpertRouteExchange

Trait ExpertRouteExchange 

Source
pub trait ExpertRouteExchange<T> {
    type Error;

    // Required methods
    fn exchange_tensor(
        &mut self,
        counts: &CommunicationPeerCounts,
        value: T,
    ) -> Result<T, Self::Error>;
    fn exchange_indices(
        &mut self,
        counts: &CommunicationPeerCounts,
        values: Vec<usize>,
    ) -> Result<Vec<usize>, Self::Error>;
}
Expand description

Opaque variable-count transport used by architecture-owned expert routing.

Implementations must preserve peer-block and within-block order, validate every tensor against the selected communication requirement, and retain all native resources until the exact completion has finished.

Required Associated Types§

Source

type Error

Communication or metadata transport failure.

Required Methods§

Source

fn exchange_tensor( &mut self, counts: &CommunicationPeerCounts, value: T, ) -> Result<T, Self::Error>

Exchanges one tensor whose leading rows match the supplied peer counts.

Source

fn exchange_indices( &mut self, counts: &CommunicationPeerCounts, values: Vec<usize>, ) -> Result<Vec<usize>, Self::Error>

Exchanges one unsigned metadata value per leading tensor row.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§