Skip to main content

analyze_parallelization

Function analyze_parallelization 

Source
pub fn analyze_parallelization(
    graph: &EinsumGraph,
) -> Result<ParallelizationAnalysis, IrError>
Expand description

Analyze graph for parallel execution opportunities

This function performs a topological analysis of the computation graph to identify sets of operations that can execute in parallel. It uses level-based scheduling to group independent operations.

§Returns

Returns a ParallelizationAnalysis containing:

  • Groups of parallelizable operations at each level
  • Critical path analysis
  • Estimated speedup from parallelization

§Example

use tensorlogic_ir::{EinsumGraph, analyze_parallelization};

let mut graph = EinsumGraph::new();
// Build your graph...

let analysis = analyze_parallelization(&graph).unwrap();
if analysis.has_parallelism() {
    println!("Max parallelism: {}", analysis.max_parallelism);
    println!("Estimated speedup: {:.2}x", analysis.estimated_speedup);
}