75 lines
2.0 KiB
Rust
75 lines
2.0 KiB
Rust
//! AOT (Ahead-of-Time) graph compilation and optimization
|
|
//!
|
|
//! This module provides comprehensive graph compilation with:
|
|
//! - Static graph analysis and operation fusion detection
|
|
//! - Multi-pass optimization (fusion, CSE, DCE, memory reuse)
|
|
//! - Hardware-aware kernel selection using autotuning results
|
|
//! - Optimized code generation with memory and stream planning
|
|
//! - Performance validation targeting 20-40% step-time improvement
|
|
|
|
pub mod types {
|
|
include!("aot_impl/types.rs");
|
|
}
|
|
|
|
pub mod compiler {
|
|
include!("aot_impl/compiler.rs");
|
|
}
|
|
|
|
pub mod analysis {
|
|
include!("aot_impl/analysis.rs");
|
|
}
|
|
|
|
pub mod fusion {
|
|
include!("aot_impl/fusion.rs");
|
|
}
|
|
|
|
pub mod optimization {
|
|
include!("aot_impl/optimization.rs");
|
|
}
|
|
|
|
pub mod selection {
|
|
include!("aot_impl/selection.rs");
|
|
}
|
|
|
|
pub mod codegen {
|
|
include!("aot_impl/codegen.rs");
|
|
}
|
|
|
|
pub mod metal_fusion {
|
|
include!("aot_impl/metal_fusion.rs");
|
|
}
|
|
|
|
pub mod fusion_patterns {
|
|
include!("aot_impl/fusion_patterns.rs");
|
|
}
|
|
|
|
pub mod shape_guards {
|
|
include!("aot_impl/shape_guards.rs");
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
include!("aot_impl/tests.rs");
|
|
}
|
|
|
|
// Re-export all public types and functions for backward compatibility
|
|
pub use types::*;
|
|
pub use compiler::AotCompiler;
|
|
pub use analysis::StaticGraphAnalyzer;
|
|
pub use fusion::OperationFuser;
|
|
pub use optimization::{CommonSubexpressionEliminator, DeadCodeEliminator, MemoryReuseOptimizer};
|
|
pub use selection::KernelSelector;
|
|
pub use codegen::CodeGenerator;
|
|
pub use metal_fusion::{
|
|
Activation, FusedOp, FusionBuilder, FusionChain, FusionPatternMatcher,
|
|
FusionStats, Normalization,
|
|
};
|
|
pub use fusion_patterns::{
|
|
Architecture, FusionPattern, FusionPatternLibrary, PatternMatch, PatternMatcher, PatternOp,
|
|
};
|
|
pub use shape_guards::{
|
|
ShapeDim, ShapeGuard, ShapeSignature, GuardedCompiledGraph,
|
|
ShapeGuardManager, ShapeGuardConfig, ShapeGuardStats,
|
|
GuardCheckResult, GuardFailure,
|
|
generate_guards_from_operations, generate_symbolic_guards, compute_graph_hash,
|
|
}; |