TCL: Enabling Fast and Efficient Cross-Hardware Tensor Program Optimization via Continual Learning
About
Deep learning (DL) compilers rely on cost models and auto-tuning to optimize tensor programs for target hardware. However, existing approaches depend on large offline datasets, incurring high collection costs and offering suboptimal transferability across platforms. In this paper, we introduce TCL, a novel efficient and transferable compiler framework for fast tensor program optimization across diverse hardware platforms to address these challenges. Specifically, TCL is built on three core enablers: (1) the RDU Sampler, a data-efficient active learning strategy that selects only 10% of tensor programs by jointly optimizing Representativeness, Diversity, and Uncertainty, substantially reducing data collection costs while maintaining near-original model accuracy; (2) a new Mamba-based cost model that efficiently captures long-range schedule dependencies while achieving a favorable trade-off between prediction accuracy and computational cost through reduced parameterization and lightweight sequence modeling; and (3) a continuous knowledge distillation framework that effectively and progressively transfers knowledge across multiple hardware platforms while avoiding the parameter explosion and data dependency issues typically caused by traditional multi-task learning. Extensive experiments validate the effectiveness of each individual enabler and the holistic TCL framework. When optimizing a range of mainstream DL models on both CPU and GPU platforms, TCL achieves, on average, 16.8x and 12.48x faster tuning time, and 1.20x and 1.13x lower inference latency, respectively, compared to Tenset-MLP.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Cost modeling | Intel E5-2673 v4 | Top-1 Score90.5 | 3 | |
| Cost modeling | AMD EPYC 7452 | Top-1 Accuracy90.58 | 3 | |
| Cost modeling | ARM Graviton2 | Top-1 Score83 | 3 | |
| Cost modeling | Intel i7-12700F | Top-1 Score92.29 | 3 | |
| Cost modeling | NVIDIA Tesla T4 | Top-1 Score88.91 | 3 | |
| Cost modeling | NVIDIA RTX 3080Ti | Top-1 Score85.21 | 3 | |
| Tensor Program Optimization | Intel i7-12700F 10% sample (target) | Top-1 Score89.38 | 3 | |
| Tensor Program Optimization | NVIDIA 3080Ti 10% sample (target) | Top-1 Score84.26 | 3 | |
| Cost modeling | Intel Platinum 8272CL | Top-1 Accuracy91.32 | 3 | |
| Cost modeling | NVIDIA Tesla K80 | Top-1 Score88.39 | 3 |