Abstract
Scheduling on dataflow graphs (also known as computation graphs) is an NP-hard problem. The traditional exact methods are limited by runtime complexity, while reinforcement learning (RL) and heuristic-based approaches struggle with determinism and solution quality. This research aims to develop an innovative approach that employs machine learning (ML) for addressing combinatorial optimization problems, using scheduling as a case study. The goal is to provide guarantees in optimality and determinism while maintaining the runtime cost of heuristic methods. Specifically, we introduce a novel two-phase RL-to-ILP scheduling framework, which includes three steps: 1) RL solver acts as coarse-grain scheduler, 2) solution relaxation and 3) exact solving via ILP. Our framework demonstrates the same scheduling performance compared with using exact scheduling methods while achieving up to 128 $\times$ speed improvements. This was conducted on actual EdgeTPU platforms, utilizing ImageNet DNN computation graphs as input. Additionally, the framework offers improved on-chip inference runtime and acceleration compared to the commercially available EdgeTPU compiler.
Introduction: The Scheduling Dilemma
Scheduling tasks on a dataflow graph, such as a Deep Neural Network (DNN), onto hardware is a classic NP-hard combinatorial optimization (CO) problem. The challenge lies in determining the optimal sequence of operators across pipeline stages to minimize memory usage and communication overhead.
Currently, practitioners face a "pick two" dilemma:
- Exact Methods (ILP/SAT): Guarantee optimality and determinism but suffer from exponential runtime complexity, making them impractical for large graphs.
- Heuristics (Standard Compilers): Offer speed and determinism but often yield sub-optimal schedules that underutilize hardware resources.
- RL/ML Methods: Provide fast inference but lack formal guarantees of optimality or determinism.
Inc-ILP (Incremental ILP) breaks this trilemma by using machine learning to "warm-start" the exact solving process, combining the speed of RL with the mathematical rigor of Integer Linear Programming.
The Inc-ILP Framework
The Inc-ILP framework operates through a four-phase pipeline designed to narrow the search space for an exact solver without sacrificing the global optimum.
- RL Pre-scheduling: An RL agent utilizes an Encoder-Decoder architecture with LSTMs and a Pointer Network to act as a coarse-grain scheduler. It rapidly predicts a sequence of stages for the graph nodes.
- Search Space Relaxation: This step defines a relaxation level ($\gamma$). The framework takes the RL's initial guess and allows the ILP solver to re-schedule nodes only within a small topological window around that guess.
- Exact Solving (Multi-Obj ILP): The IBM CPLEX ILP solver explores the restricted search space to find the mathematically optimal solution for peak memory usage, total off-cache memory, and communication costs.
- Deployment: The final schedule is compiled via the TFLite TOCO converter for deployment on physical Google Edge TPU devices.
Experimental Setup and Results
The framework was trained on a synthetic dataset of 1 million Directed Acyclic Graphs (DAGs) designed to mimic real-world DNN distributions. Evaluation was conducted on 10 industry-standard ImageNet models, including ResNet, DenseNet, and Xception.
Performance and Speedup
Inc-ILP achieved remarkable speedups compared to pure ILP solvers: 54×, 128×, and 115× for 4, 5, and 6-stage scheduling, respectively, while maintaining 100% optimality. Furthermore, it outperformed commercial Edge TPU compilers by 19× to 27× in solving time.
Real-World Hardware Impact
On actual Edge TPU hardware, the optimal schedules generated by Inc-ILP resulted in up to 4.07× faster on-device inference for ResNet152 compared to standard compiler outputs. This demonstrates that better scheduling directly translates to significant hardware efficiency gains by reducing off-chip memory overhead.
Conclusion
Inc-ILP demonstrates that RL can effectively serve as a search space filter for exact solvers. By maintaining a small and stable relaxation level ($\gamma=10$), the framework consistently finds global optima at a fraction of the traditional computational cost. Future work will explore expanding the objective functions to include power and thermal constraints and testing the framework on even larger, more unconventional graph structures.
Summary updated