Skip to main content

CollectiveBackend

Trait CollectiveBackend 

Source
pub trait CollectiveBackend: SubmissionBackend {
    type Group: ?Sized;
    type CollectiveError: Error + Send + Sync + 'static;

    // Required methods
    fn all_reduce(
        value: Self::Tensor,
        group: &Self::Group,
        executor: &Self::Executor,
    ) -> Result<Self::Tensor, Self::CollectiveError>;
    fn all_gather(
        value: Self::Tensor,
        group: &Self::Group,
        executor: &Self::Executor,
    ) -> Result<Self::Tensor, Self::CollectiveError>;
    fn all_to_all(
        value: Self::Tensor,
        group: &Self::Group,
        executor: &Self::Executor,
    ) -> Result<Self::Tensor, Self::CollectiveError>;
}
Expand description

Collective operations available to distributed runtime policies.

Required Associated Types§

Source

type Group: ?Sized

Backend-native collective group.

Source

type CollectiveError: Error + Send + Sync + 'static

Backend-specific collective failure.

Required Methods§

Source

fn all_reduce( value: Self::Tensor, group: &Self::Group, executor: &Self::Executor, ) -> Result<Self::Tensor, Self::CollectiveError>

Reduces a tensor across the selected group.

Source

fn all_gather( value: Self::Tensor, group: &Self::Group, executor: &Self::Executor, ) -> Result<Self::Tensor, Self::CollectiveError>

Gathers a tensor across the selected group.

Source

fn all_to_all( value: Self::Tensor, group: &Self::Group, executor: &Self::Executor, ) -> Result<Self::Tensor, Self::CollectiveError>

Exchanges tensor partitions across the selected group.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§