pub struct ModelParallelCoordinator { /* private fields */ }Expand description
Model parallelism coordinator.
Implementations§
Source§impl ModelParallelCoordinator
impl ModelParallelCoordinator
Sourcepub fn new(
config: DistributedConfig,
backend: Arc<RwLock<dyn CommunicationBackend>>,
) -> Self
pub fn new( config: DistributedConfig, backend: Arc<RwLock<dyn CommunicationBackend>>, ) -> Self
Create a new model parallel coordinator.
Sourcepub fn create_sharding_plan(
&mut self,
graph: &EinsumGraph,
) -> Result<(), ExecutorError>
pub fn create_sharding_plan( &mut self, graph: &EinsumGraph, ) -> Result<(), ExecutorError>
Create a sharding plan for the graph.
Sourcepub fn placement_plan(&self) -> &DistributedPlacementPlan
pub fn placement_plan(&self) -> &DistributedPlacementPlan
Get the placement plan.
Sourcepub fn shard_tensor(
&self,
_node_id: usize,
shape: &TensorShape,
shard_dim: usize,
) -> Result<Vec<TensorShape>, ExecutorError>
pub fn shard_tensor( &self, _node_id: usize, shape: &TensorShape, shard_dim: usize, ) -> Result<Vec<TensorShape>, ExecutorError>
Shard a tensor along a dimension.
Sourcepub fn gather_shards(&self, _shard_dim: usize) -> Result<(), ExecutorError>
pub fn gather_shards(&self, _shard_dim: usize) -> Result<(), ExecutorError>
Gather sharded tensors.
Auto Trait Implementations§
impl Freeze for ModelParallelCoordinator
impl RefUnwindSafe for ModelParallelCoordinator
impl Send for ModelParallelCoordinator
impl Sync for ModelParallelCoordinator
impl Unpin for ModelParallelCoordinator
impl UnwindSafe for ModelParallelCoordinator
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