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§
Sourcetype CollectiveError: Error + Send + Sync + 'static
type CollectiveError: Error + Send + Sync + 'static
Backend-specific collective failure.
Required Methods§
Sourcefn all_reduce(
value: Self::Tensor,
group: &Self::Group,
executor: &Self::Executor,
) -> Result<Self::Tensor, Self::CollectiveError>
fn all_reduce( value: Self::Tensor, group: &Self::Group, executor: &Self::Executor, ) -> Result<Self::Tensor, Self::CollectiveError>
Reduces a tensor across the selected group.
Sourcefn all_gather(
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>
Gathers a tensor across the selected group.
Sourcefn all_to_all(
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>
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".