pub struct PlacementPlan {
pub node_placement: HashMap<usize, Device>,
pub tensor_placement: HashMap<usize, Device>,
pub transfer_cost: f64,
}Expand description
Device placement plan
Fields§
§node_placement: HashMap<usize, Device>Node index -> Device mapping
tensor_placement: HashMap<usize, Device>Tensor index -> Device mapping
transfer_cost: f64Estimated transfer cost
Implementations§
Source§impl PlacementPlan
impl PlacementPlan
pub fn new() -> Self
Sourcepub fn single_device(
num_nodes: usize,
num_tensors: usize,
device: Device,
) -> Self
pub fn single_device( num_nodes: usize, num_tensors: usize, device: Device, ) -> Self
Create a single-device placement plan
Sourcepub fn get_node_device(&self, node_idx: usize) -> Option<Device>
pub fn get_node_device(&self, node_idx: usize) -> Option<Device>
Get device for a node
Sourcepub fn get_tensor_device(&self, tensor_idx: usize) -> Option<Device>
pub fn get_tensor_device(&self, tensor_idx: usize) -> Option<Device>
Get device for a tensor
Sourcepub fn count_transfers(&self, graph: &EinsumGraph) -> usize
pub fn count_transfers(&self, graph: &EinsumGraph) -> usize
Count number of cross-device transfers
Trait Implementations§
Source§impl Clone for PlacementPlan
impl Clone for PlacementPlan
Source§fn clone(&self) -> PlacementPlan
fn clone(&self) -> PlacementPlan
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 PlacementPlan
impl Debug for PlacementPlan
Auto Trait Implementations§
impl Freeze for PlacementPlan
impl RefUnwindSafe for PlacementPlan
impl Send for PlacementPlan
impl Sync for PlacementPlan
impl Unpin for PlacementPlan
impl UnwindSafe for PlacementPlan
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