pub struct DistributedPlacementPlan {
pub node_placement: HashMap<usize, Device>,
pub sharding_specs: Vec<ShardingSpec>,
pub communication_deps: HashMap<usize, Vec<usize>>,
}Expand description
Placement plan for distributed execution.
Fields§
§node_placement: HashMap<usize, Device>Node to device mapping
sharding_specs: Vec<ShardingSpec>Sharding specifications for model parallelism
communication_deps: HashMap<usize, Vec<usize>>Communication dependencies (node -> nodes it depends on)
Implementations§
Source§impl DistributedPlacementPlan
impl DistributedPlacementPlan
Sourcepub fn place_node(&mut self, node_id: usize, device: Device)
pub fn place_node(&mut self, node_id: usize, device: Device)
Add a node placement.
Sourcepub fn add_sharding(&mut self, spec: ShardingSpec)
pub fn add_sharding(&mut self, spec: ShardingSpec)
Add a sharding specification.
Sourcepub fn get_device(&self, node_id: usize) -> Option<&Device>
pub fn get_device(&self, node_id: usize) -> Option<&Device>
Get the device for a node.
Sourcepub fn get_sharding(&self, node_id: usize) -> Option<&ShardingSpec>
pub fn get_sharding(&self, node_id: usize) -> Option<&ShardingSpec>
Get sharding spec for a node.
Sourcepub fn is_sharded(&self, node_id: usize) -> bool
pub fn is_sharded(&self, node_id: usize) -> bool
Check if a node is sharded.
Trait Implementations§
Source§impl Clone for DistributedPlacementPlan
impl Clone for DistributedPlacementPlan
Source§fn clone(&self) -> DistributedPlacementPlan
fn clone(&self) -> DistributedPlacementPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DistributedPlacementPlan
impl Debug for DistributedPlacementPlan
Auto Trait Implementations§
impl Freeze for DistributedPlacementPlan
impl RefUnwindSafe for DistributedPlacementPlan
impl Send for DistributedPlacementPlan
impl Sync for DistributedPlacementPlan
impl Unpin for DistributedPlacementPlan
impl UnwindSafe for DistributedPlacementPlan
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
Mutably borrows from an owned value. Read more