Abstract
Optimizing large-scale machine learning (ML) training is challenging due to the high cost and limited scalability of online profiling. This paper presents a performance simulator that replaces online execution with offline operation-level profiling. By replaying a model's dataflow graph using pre-measured operation timings, the simulator achieves high accuracy, with an error rate of less than 2% in predicting training performance. This methodology allows developers to explore parallelization strategies and evaluate hardware configurations without requiring physical access to the target systems.
Introduction
The current industry standard for optimizing ML performance is online profiling—running a model on a specific hardware cluster to measure its speed. However, this approach suffers from significant scalability issues, hardware constraints (requiring ownership of the hardware before testing), and a lack of transparency regarding specific bottlenecks. To address these challenges, we propose a simulation-based approach that decouples the model design from the physical hardware.
Methods
The proposed simulator is built on two primary pillars: operation-level (op-level) profiling and dataflow-based simulation.
System Architecture
The system consists of several key components that work together to predict performance:
- Preprocessing Module: Unifies different framework formats into a standard representation.
- Op Estimator: Predicts execution times for individual operations (e.g.,
Conv2D,MatMul) based on input tensor shapes. - Simulation Module: Replays the model's Directed Acyclic Graph (DAG), managing parallel execution and synchronization on virtual devices.
Op-level Profiling
Instead of profiling entire models, the system profiles individual operations. Since performance varies with input shapes, a machine learning model is trained on a fixed set of profiled inputs to estimate performance for any arbitrary input. This "Goldilocks" granularity—finer than the model level but coarser than the kernel level—balances accuracy with ease of automation.
Evaluation
The simulator was evaluated using three standard Convolutional Neural Network (CNN) architectures: VGG_19, ResNet_50, and ResNet_152. These models were tested on the CIFAR-10 dataset with a batch size of 64. The profiling database included over 20 common operations and various GPU communication scenarios, such as NCCL-AllReduce and Host-to-GPU transfers.
Key Results
The simulator demonstrated exceptional accuracy and provided deep insight into system performance.
High Prediction Accuracy
When compared against actual execution times measured via TF.timeline, the simulator consistently achieved an error rate of less than 2% across all tested models. This confirms that offline profiling is a viable foundation for accurate system simulation.
Insights into Hardware and Communication
The research confirmed that operation performance is remarkably stable, often exhibiting a strong linear relationship with input shapes. Furthermore, the simulator successfully modeled the throughput differences of various interconnects (e.g., QPI vs. PCI-e Switch), accurately capturing communication bottlenecks that are critical in distributed training environments.
Limitations and Future Work
While the current results are promising, several areas for improvement remain:
- Op Coverage: The database currently covers approximately 20 operations; expanding this library is necessary for broader model support.
- Overhead Modeling: Minor errors are attributed to unaccounted memory copy times and inter-operation gaps.
- Distributed Scaling: Future work will focus on validating the simulator for multi-machine distributed settings involving complex networking like RDMA.
The ultimate goal is to develop a community-driven, open-source simulator and profiling database to democratize ML system optimization.
Summary updated