Skip to main content

DistributedSession

Trait DistributedSession 

Source
pub trait DistributedSession {
    type Value;
    type Completion: Completion<Error = Self::Error>;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn descriptor(&self) -> DistributedSessionDescriptor;
    fn capabilities(&self) -> DistributedCapabilities;
    fn all_reduce_sum(
        &self,
        scope: CollectiveScope,
        input: &Self::Value,
    ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>;
    fn all_gather(
        &self,
        scope: CollectiveScope,
        input: &Self::Value,
    ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>;
    fn all_to_all_v(
        &self,
        scope: CollectiveScope,
        input: &Self::Value,
        send_counts: &[usize],
        receive_counts: &[usize],
    ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>;
    fn send(
        &self,
        scope: CollectiveScope,
        peer: usize,
        input: &Self::Value,
    ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>;
    fn receive(
        &self,
        scope: CollectiveScope,
        peer: usize,
        value: &ValueDescriptor,
    ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>;
    fn all_gather_words(&self, local: &[u32]) -> Result<Vec<u32>, Self::Error>;
}
Expand description

Optional high-level transfer and collective capability of a selected session.

This contract deliberately operates on an opaque backend value. It models the few communication submissions needed by model execution without making core define a tensor algebra or exposing native groups, streams, or events. Every operation is scoped to the session selected for the complete model.

Required Associated Types§

Source

type Value

Backend-owned tensor or buffer value.

Source

type Completion: Completion<Error = Self::Error>

Exact completion retaining the submitted communication resources.

Source

type Error: Error + Send + Sync + 'static

Structured backend error.

Required Methods§

Source

fn descriptor(&self) -> DistributedSessionDescriptor

Stable topology and rank identity.

Source

fn capabilities(&self) -> DistributedCapabilities

Fail-closed communication support.

Source

fn all_reduce_sum( &self, scope: CollectiveScope, input: &Self::Value, ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>

Submits a sum reduction over scope.

Source

fn all_gather( &self, scope: CollectiveScope, input: &Self::Value, ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>

Submits a leading-rank-axis gather over scope.

Source

fn all_to_all_v( &self, scope: CollectiveScope, input: &Self::Value, send_counts: &[usize], receive_counts: &[usize], ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>

Submits a variable-count all-to-all exchange over scope.

Source

fn send( &self, scope: CollectiveScope, peer: usize, input: &Self::Value, ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>

Submits a point-to-point send to a rank within scope.

Source

fn receive( &self, scope: CollectiveScope, peer: usize, value: &ValueDescriptor, ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>

Submits a point-to-point receive from a rank within scope.

Source

fn all_gather_words(&self, local: &[u32]) -> Result<Vec<u32>, Self::Error>

Synchronously gathers portable scheduler metadata across the world.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§