pub struct GraphCostSummary {
pub node_costs: Vec<NodeCostEstimate>,
pub total_flops: FlopEstimate,
pub total_memory: MemoryCostEstimate,
pub peak_memory_bytes: u64,
pub bottleneck_nodes: Vec<usize>,
pub num_nodes: usize,
pub estimated_time_ns: Option<u64>,
}Expand description
Full cost summary for an EinsumGraph.
Fields§
§node_costs: Vec<NodeCostEstimate>Per-node cost estimates, in node-index order.
total_flops: FlopEstimateSum of FLOPs across all nodes.
total_memory: MemoryCostEstimateSum of memory estimates across all nodes.
peak_memory_bytes: u64Maximum peak_bytes across all nodes.
bottleneck_nodes: Vec<usize>Node indices flagged as bottlenecks.
num_nodes: usizeTotal number of nodes estimated.
estimated_time_ns: Option<u64>Estimated wall-clock time in nanoseconds; None if throughput unknown.
Implementations§
Source§impl GraphCostSummary
impl GraphCostSummary
Sourcepub fn format_table(&self) -> String
pub fn format_table(&self) -> String
Format a human-readable table: node_id | op | shape | flops | mem.
Sourcepub fn top_k_by_flops(&self, k: usize) -> Vec<&NodeCostEstimate>
pub fn top_k_by_flops(&self, k: usize) -> Vec<&NodeCostEstimate>
Return the k nodes with the highest total_flops, sorted descending.
Sourcepub fn memory_breakdown(&self) -> String
pub fn memory_breakdown(&self) -> String
Format a breakdown of memory usage per node.
Trait Implementations§
Source§impl Clone for GraphCostSummary
impl Clone for GraphCostSummary
Source§fn clone(&self) -> GraphCostSummary
fn clone(&self) -> GraphCostSummary
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 moreAuto Trait Implementations§
impl Freeze for GraphCostSummary
impl RefUnwindSafe for GraphCostSummary
impl Send for GraphCostSummary
impl Sync for GraphCostSummary
impl Unpin for GraphCostSummary
impl UnsafeUnpin for GraphCostSummary
impl UnwindSafe for GraphCostSummary
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more