pub struct CollectiveConfig { /* private fields */ }Expand description
Parameter struct for setting up and getting parameters for collective operations. Used in most collective api calls. This config is per-node. It is passed to reduce.
Implementations§
Source§impl CollectiveConfig
impl CollectiveConfig
Sourcepub fn with_num_devices(self, num: usize) -> Self
pub fn with_num_devices(self, num: usize) -> Self
Selects the number of devices (local peers) on the current node
Sourcepub fn with_local_all_reduce_strategy(self, strategy: AllReduceStrategy) -> Self
pub fn with_local_all_reduce_strategy(self, strategy: AllReduceStrategy) -> Self
Selects an all-reduce strategy to use on the local level.
In multi-node contexts, use of the Ring strategy in the local level may be less advantageous. With multiple nodes, the global all-reduce step is enabled, and its result is redistributed to all devices. The Ring strategy inherently distributes the result, which in this context would not be necessary.
It is recommended to use a tree strategy locally, and a ring strategy globally.
Sourcepub fn with_local_reduce_strategy(self, strategy: ReduceStrategy) -> Self
pub fn with_local_reduce_strategy(self, strategy: ReduceStrategy) -> Self
Selects a reduce strategy to use on the local level.
Sourcepub fn with_local_broadcast_strategy(self, strategy: BroadcastStrategy) -> Self
pub fn with_local_broadcast_strategy(self, strategy: BroadcastStrategy) -> Self
Selects a broadcast strategy to use on the local level.
Sourcepub fn with_num_nodes(self, n: u32) -> Self
pub fn with_num_nodes(self, n: u32) -> Self
Set the number of nodes in the collective
This parameter is a global parameter and should only be set in multi-node contexts
Sourcepub fn with_global_address(self, addr: Address) -> Self
pub fn with_global_address(self, addr: Address) -> Self
Set the network address of the Global Collective Orchestrator
This parameter is a global parameter and should only be set in multi-node contexts
Sourcepub fn with_node_address(self, addr: Address) -> Self
pub fn with_node_address(self, addr: Address) -> Self
Define the address for this node
This parameter is a global parameter and should only be set in multi-node contexts
Sourcepub fn with_data_service_port(self, port: u16) -> Self
pub fn with_data_service_port(self, port: u16) -> Self
Selects the network port on which to expose the tensor data service used for peer-to-peer tensor downloading.
This parameter is a global parameter and should only be set in multi-node contexts
Sourcepub fn with_global_all_reduce_strategy(
self,
strategy: AllReduceStrategy,
) -> Self
pub fn with_global_all_reduce_strategy( self, strategy: AllReduceStrategy, ) -> Self
Selects an all-reduce strategy to use on the global level.
This parameter is a global parameter and should only be set in multi-node contexts. See the local strategy
Sourcepub fn with_global_reduce_strategy(self, strategy: ReduceStrategy) -> Self
pub fn with_global_reduce_strategy(self, strategy: ReduceStrategy) -> Self
Selects an reduce strategy to use on the global level.
This parameter is a global parameter and should only be set in multi-node contexts. See the local strategy
Sourcepub fn with_global_broadcast_strategy(self, strategy: BroadcastStrategy) -> Self
pub fn with_global_broadcast_strategy(self, strategy: BroadcastStrategy) -> Self
Selects an broadcst strategy to use on the global level.
This parameter is a global parameter and should only be set in multi-node contexts. See the local strategy
Trait Implementations§
Source§impl Clone for CollectiveConfig
impl Clone for CollectiveConfig
Source§fn clone(&self) -> CollectiveConfig
fn clone(&self) -> CollectiveConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CollectiveConfig
impl Debug for CollectiveConfig
Source§impl Default for CollectiveConfig
impl Default for CollectiveConfig
Source§impl<'de> Deserialize<'de> for CollectiveConfig
impl<'de> Deserialize<'de> for CollectiveConfig
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 Display for CollectiveConfig
impl Display for CollectiveConfig
Source§impl PartialEq for CollectiveConfig
impl PartialEq for CollectiveConfig
Source§impl Serialize for CollectiveConfig
impl Serialize for CollectiveConfig
impl Eq for CollectiveConfig
impl StructuralPartialEq for CollectiveConfig
Auto Trait Implementations§
impl Freeze for CollectiveConfig
impl RefUnwindSafe for CollectiveConfig
impl Send for CollectiveConfig
impl Sync for CollectiveConfig
impl Unpin for CollectiveConfig
impl UnwindSafe for CollectiveConfig
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.