[Paper Review] On Optimizing Operator Fusion Plans for Large-Scale Machine Learning in SystemML
This paper presents a cost-based optimization framework for operator fusion in large-scale machine learning systems, specifically within SystemML. It introduces systematic algorithms for exploring valid fusion plans, selecting optimal candidates using cost models, and generating efficient code for both local and distributed operations over dense, sparse, and compressed data—achieving up to 21x performance improvement over hand-written fused operators with minimal overhead.
Many large-scale machine learning (ML) systems allow specifying custom ML algorithms by means of linear algebra programs, and then automatically generate efficient execution plans. In this context, optimization opportunities for fused operators---in terms of fused chains of basic operators---are ubiquitous. These opportunities include (1) fewer materialized intermediates, (2) fewer scans of input data, and (3) the exploitation of sparsity across chains of operators. Automatic operator fusion eliminates the need for hand-written fused operators and significantly improves performance for complex or previously unseen chains of operations. However, existing fusion heuristics struggle to find good fusion plans for complex DAGs or hybrid plans of local and distributed operations. In this paper, we introduce an optimization framework for systematically reason about fusion plans that considers materialization points in DAGs, sparsity exploitation, different fusion template types, as well as local and distributed operations. In detail, we contribute algorithms for (1) candidate exploration of valid fusion plans, (2) cost-based candidate selection, and (3) code generation of local and distributed operations over dense, sparse, and compressed data. Our experiments in SystemML show end-to-end performance improvements with optimized fusion plans of up to 21x compared to hand-written fused operators, with negligible optimization and code generation overhead.
Motivation & Objective
- To address the limitations of heuristic-based operator fusion in complex DAGs and hybrid local/distributed workloads.
- To systematically optimize fusion plans by considering materialization points, sparsity exploitation, and diverse fusion template types.
- To reduce development overhead by automating fusion without requiring hand-coded operators for each pattern.
- To enable efficient code generation for dense, sparse, and compressed data across local and distributed execution environments.
- To improve end-to-end performance in large-scale ML workloads through principled, cost-aware fusion planning.
Proposed method
- Proposes a three-phase framework: candidate exploration, cost-based candidate selection, and code generation for fused operators.
- Develops algorithms to explore valid fusion plans in DAGs while respecting memory constraints and data layout characteristics.
- Employs a cost model that accounts for materialization, I/O, computation, and sparsity exploitation across chains of operations.
- Supports multiple fusion template types, including single-pass, multi-aggregate, and sparsity-exploiting patterns.
- Generates optimized code for both local and distributed execution, handling dense, sparse, and compressed data representations.
- Integrates the optimization pipeline into SystemML’s compiler and runtime for seamless deployment.
Experimental results
Research questions
- RQ1How can fusion plans be systematically explored in DAGs of linear algebra operations to avoid exponential search space?
- RQ2What cost model is effective for comparing fusion plans that consider materialization, I/O, computation, and sparsity?
- RQ3How can fusion plans be optimized across hybrid workloads involving both local and distributed operations?
- RQ4Can automatic fusion outperform hand-written fused operators in terms of performance and generality?
- RQ5How can sparsity be exploited across chains of operations without materializing dense intermediates?
Key findings
- The proposed optimization framework achieves up to 21x end-to-end performance improvement over hand-written fused operators in SystemML.
- The framework matches the performance of hand-optimized code while eliminating the need for manual implementation of each fusion pattern.
- Optimization and code generation overhead is negligible, making the approach practical for real-world deployment.
- The system effectively exploits sparsity across operator chains, avoiding expensive dense intermediate computations.
- The cost-based selection mechanism outperforms heuristic-based fusion strategies on complex DAGs and hybrid execution plans.
- The framework generalizes across dense, sparse, and compressed data representations, enhancing applicability to diverse ML workloads.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.