pub enum AllReduceStrategy {
Centralized,
Tree(u32),
Ring,
}Expand description
All reduce can be implemented with different algorithms, which all have the same result.
Variants§
Centralized
One device is the “central”. The other devices, “peripherals”, send their tensors to the central. The central does the reduction, and sends the result back to each peripheral.
Tree(u32)
Devices are organized in a tree structure (with a given arity). Each node reduces its children’s tensors with its own, and sends the result to its parent. Leaf nodes will simply send their tensors to their parents. When the root node calculates the result, it is propagated down the tree.
Ring
Devices are organized in a ring. The tensors are split into N slices, where N is the
number of devices participating. The slices are progressively sent around the ring until
every device has one fully reduced slice of the tensor. Then, the resulting slices are sent
around until every device has the full result.
See ring.rs for details.
Trait Implementations§
Source§impl Clone for AllReduceStrategy
impl Clone for AllReduceStrategy
Source§fn clone(&self) -> AllReduceStrategy
fn clone(&self) -> AllReduceStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AllReduceStrategy
impl Debug for AllReduceStrategy
Source§impl<'de> Deserialize<'de> for AllReduceStrategy
impl<'de> Deserialize<'de> for AllReduceStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AllReduceStrategy
impl PartialEq for AllReduceStrategy
Source§impl Serialize for AllReduceStrategy
impl Serialize for AllReduceStrategy
impl Copy for AllReduceStrategy
impl Eq for AllReduceStrategy
impl StructuralPartialEq for AllReduceStrategy
Auto Trait Implementations§
impl Freeze for AllReduceStrategy
impl RefUnwindSafe for AllReduceStrategy
impl Send for AllReduceStrategy
impl Sync for AllReduceStrategy
impl Unpin for AllReduceStrategy
impl UnwindSafe for AllReduceStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.