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§
Sourcetype Completion: Completion<Error = Self::Error>
type Completion: Completion<Error = Self::Error>
Exact completion retaining the submitted communication resources.
Required Methods§
Sourcefn descriptor(&self) -> DistributedSessionDescriptor
fn descriptor(&self) -> DistributedSessionDescriptor
Stable topology and rank identity.
Sourcefn capabilities(&self) -> DistributedCapabilities
fn capabilities(&self) -> DistributedCapabilities
Fail-closed communication support.
Sourcefn all_reduce_sum(
&self,
scope: CollectiveScope,
input: &Self::Value,
) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>
fn all_reduce_sum( &self, scope: CollectiveScope, input: &Self::Value, ) -> Result<Submission<Self::Value, Self::Completion>, Self::Error>
Submits a sum reduction over scope.
Sourcefn all_gather(
&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>
Submits a leading-rank-axis gather over scope.
Sourcefn 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 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.
Sourcefn send(
&self,
scope: CollectiveScope,
peer: usize,
input: &Self::Value,
) -> 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>
Submits a point-to-point send to a rank within scope.
Sourcefn receive(
&self,
scope: CollectiveScope,
peer: usize,
value: &ValueDescriptor,
) -> 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>
Submits a point-to-point receive from a rank within scope.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".