Cross-Feature Transfer Learning for Efficient Tensor Program Generation
Source abstract
Abstract
Tuning tensor program generation involves navigating a vast search space to find optimal program transformations and measurements for a program on the target hardware. The complexity of this process is further amplified by the exponential combinations of transformations, especially in heterogeneous environments. This research addresses these challenges by introducing a novel approach that learns the joint neural network and hardware features space, facilitating knowledge transfer to new, unseen target hardware. A comprehensive analysis is conducted on the existing state-of-the-art dataset, TenSet, including a thorough examination of test split strategies and the proposal of methodologies for dataset pruning. Leveraging an attention-inspired technique, we tailor the tuning of tensor programs to embed both neural network and hardware-specific features. Notably, our approach substantially reduces the dataset size by up to 53% compared to the baseline without compromising Pairwise Comparison Accuracy (PCA). Furthermore, our proposed methodology demonstrates competitive or improved mean inference times with only 25–40% of the baseline tuning time across various networks and target hardware. The attention-based tuner can effectively utilize schedules learned from previous hardware program measurements to optimize tensor program tuning on previously unseen hardware, achieving a top-5 accuracy exceeding 90%. This research introduces a significant advancement in autotuning tensor program generation, addressing the complexities associated with heterogeneous environments and showcasing promising results regarding efficiency and accuracy.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Parallel Computing and Optimization Techniques · Tensor decomposition and applications · Advanced Neural Network Applications
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Deparment of Computer Science, Stony Brook University, Stony Brook, NY 11794, USA
Argonne National Laboratory, Lemont, IL 60439, USA
Funding
Stony Brook Research Computing and Cyberinfrastructure · Argonne Leadership Computing Facility (ALCF) · Exascale Computing Project · National Science Foundation
References (50)
Show source-provided references
1. Sabne, A. (2023, November 30). XLA: Compiling Machine Learning for Peak Performance. Available online: https://www.tensorflow.org/xla.
2. Chen, T., Moreau, T., Jiang, Z., Zheng, L., Yan, E., Shen, H., Cowan, M., Wang, L., Hu, Y., and Ceze, L. (2018, January 8–10). {TVM}: An automated {End-to-End} optimizing compiler for deep learning. Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18), Carlsbad, CA, USA.
3. Rotem, N., Fix, J., Abdulrasool, S., Catron, G., Deng, S., Dzhabarov, R., Gibson, N., Hegeman, J., Lele, M., and Levenstein, R. (2018). Glow: Graph lowering compiler techniques for neural networks. arXiv.
4. The Tensor Algebra Compiler10.1145/3133901 ↗
5. The deep learning compiler: A comprehensive survey10.1109/TPDS.2020.3030548 ↗
6. Shoeybi, M., Patwary, M., Puri, R., LeGresley, P., Casper, J., and Catanzaro, B. (2019). Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv.
7. Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., and Isard, M. (2016, January 2–4). {TensorFlow}: A system for {Large-Scale} machine learning. Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), Savannah, GA, USA.
8. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., and Antiga, L. (2019, January 8–14). Pytorch: An imperative style, high-performance deep learning library. Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada.
9. Chen, T., Zheng, L., Yan, E., Jiang, Z., Moreau, T., Ceze, L., Guestrin, C., and Krishnamurthy, A. (2018, January 3–8). Learning to optimize tensor programs. Proceedings of the Advances in Neural Information Processing System, Montreal, QC, Canada.
10. Ryu, J., Park, E., and Sung, H. (2022, January 2–3). One-shot tuner for deep learning compilers. Proceedings of the 31st ACM SIGPLAN International Conference on Compiler Construction, Seoul, Republic of Korea.10.1145/3497776.3517774 ↗
11. Zheng, L., Liu, R., Shao, J., Chen, T., Gonzalez, J.E., Stoica, I., and Ali, A.H. (2021, January 6). Tenset: A large-scale program performance dataset for learned tensor compilers. Proceedings of the Thirty-Fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), Virtual.
12. Gibson, P., and Cano, J. (2022, January 8–12). Transfer-Tuning: Reusing Auto-Schedules for Efficient Tensor Program Code Generation. Proceedings of the 31st International Conference on Parallel Architectures and Compilation Techniques (PACT), Chicago, IL, USA.10.1145/3559009.3569682 ↗
13. Verma, G., Raskar, S., Xie, Z., Malik, A.M., Emani, M., and Chapman, B. (2023, January 17–18). Transfer Learning Across Heterogeneous Features For Efficient Tensor Program Generation. Proceedings of the 2nd International Workshop on Extreme Heterogeneity Solutions, New York, NY, USA. ExHET 23.10.1145/3587278.3595644 ↗
14. Verma, G. (2020, January 01). Efficient Transfer Tuning Tenset. Available online: https://github.com/xintin/TransferLearn_HetFeat_TenProgGen.
15. Verma, G., Finviya, S., Malik, A.M., Emani, M., and Chapman, B. (2022, January 17–19). Towards neural architecture-aware exploration of compiler optimizations in a deep learning {graph} compiler. Proceedings of the 19th ACM International Conference on Computing Frontiers, Turin, Italy.10.1145/3528416.3530251 ↗
16. Mendis, C., Renda, A., Amarasinghe, S., and Carbin, M. (2019, January 9–15). Ithemal: Accurate, portable and fast basic block throughput estimation using deep neural networks. Proceedings of the International Conference on Machine Learning. PMLR, Long Beach, CA, USA.
17. Siddiqui, T., Jindal, A., Qiao, S., Patel, H., and Le, W. (2020, January 14–19). Cost models for big data query processing: Learning, retrofitting, and our findings. Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, Portland, OR, USA.10.1145/3318464.3380584 ↗
18. Autosync: Learning to synchronize for data-parallel distributed deep learning
19. Zhai, Y., Zhang, Y., Liu, S., Chu, X., Peng, J., Ji, J., and Zhang, Y. (2023, January 25–29). Tlp: A deep learning-based cost model for tensor program tuning. Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Vancouver, BC, Canada.10.1145/3575693.3575737 ↗
20. Zhao, Z., Shuai, X., Bai, Y., Ling, N., Guan, N., Yan, Z., and Xing, G. (2022). Moses: Efficient exploitation of cross-device transferable features for tensor program optimization. arXiv.10.1145/3572864.3580330 ↗
21. A learned performance model for tensor processing units
22. Cummins, C., Petoumenos, P., Wang, Z., and Leather, H. (2017, January 9–13). End-to-end deep learning of optimization heuristics. Proceedings of the 2017 26th International Conference on Parallel Architectures and Compilation Techniques (PACT), Portland, OR, USA.10.1109/PACT.2017.24 ↗
23. Learning to optimize halide with tree search and random programs10.1145/3306346.3322967 ↗
24. Jung, W., Dao, T.T., and Lee, J. (2021, January 20–25). DeepCuts: A deep learning optimization framework for versatile GPU workloads. Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, Virtual.10.1145/3453483.3454038 ↗
25. Nakandala, S., Saur, K., Yu, G.I., Karanasos, K., Curino, C., Weimer, M., and Interlandi, M. (2020, January 4–6). A tensor compiler for unified machine learning prediction serving. Proceedings of the 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), Virtual.
26. Zhang, M., Li, M., Wang, C., and Li, M. (2020, January 26–30). Dynatune: Dynamic tensor program optimization in deep neural network compilation. Proceedings of the International Conference on Learning Representations, Addis Ababa, Ethiopia.
27. Ansel, J., Kamil, S., Veeramachaneni, K., Ragan-Kelley, J., Bosboom, J., O’Reilly, U.M., and Amarasinghe, S. (2014, January 24–27). Opentuner: An extensible framework for program autotuning. Proceedings of the 23rd International Conference on Parallel Architectures and Compilation, Edmonton, AB, Canada.10.1145/2628071.2628092 ↗
28. Verma, G., Gupta, Y., Malik, A.M., and Chapman, B. (2021, January 17–21). Performance evaluation of deep learning compilers for edge inference. Proceedings of the 2021 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), Portland, OR, USA.10.1109/IPDPSW52791.2021.00128 ↗
29. Zheng, L., Jia, C., Sun, M., Wu, Z., Yu, C.H., Haj-Ali, A., Wang, Y., Yang, J., Zhuo, D., and Sen, K. (2020, January 4–6). Ansor: Generating {High-Performance} Tensor Programs for Deep Learning. Proceedings of the 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), Virtual.
30. Value learning for throughput optimization of deep learning workloads
31. Whaley, R.C., and Dongarra, J.J. (1998, January 7–13). Automatically tuned linear algebra software. Proceedings of the SC’98: Proceedings of the 1998 ACM/IEEE Conference on Supercomputing, Orlando, FL, USA.10.1109/SC.1998.10004 ↗
32. Mendis, C., Yang, C., Pu, Y., Amarasinghe, D., and Carbin, M. (2019, January 8–14). Compiler auto-vectorization with imitation learning. Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada.
33. Mutlu, E., Tian, R., Ren, B., Krishnamoorthy, S., Gioiosa, R., Pienaar, J., and Kestor, G. (2020, January 14–16). Comet: A domain-specific compilation of high-performance computational chemistry. Proceedings of the Languages and Compilers for Parallel Computing: 33rd International Workshop, LCPC 2020, Virtual Event. Revised Selected Papers.
34. Bradbury, J., Frostig, R., Hawkins, P., Johnson, M.J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., and Wanderman-Milne, S. (2023, November 30). JAX: Composable Transformations of Python+NumPy Programs. Available online: https://github.com/google/jax.
35. NWChem: A comprehensive and scalable open-source solution for large scale molecular simulations10.1016/j.cpc.2010.04.018 ↗
36. Bi, J., Li, X., Guo, Q., Zhang, R., Wen, Y., Hu, X., Du, Z., Song, X., Hao, Y., and Chen, Y. (2022, January 25–29). BALTO: Fast tensor program optimization with diversity-based active learning. Proceedings of the Eleventh International Conference on Learning Representations, Virtual.
37. Liu, L., Shen, M., Gong, R., Yu, F., and Yang, H. (September, January 29). Nnlqp: A multi-platform neural network latency query and prediction system with an evolving database. Proceedings of the 51st International Conference on Parallel Processing, Bordeaux, France.
38. Zhu, H., Wu, R., Diao, Y., Ke, S., Li, H., Zhang, C., Xue, J., Ma, L., Xia, Y., and Cui, W. (2022, January 11–13). {ROLLER}: Fast and Efficient Tensor Compilation for Deep Learning. Proceedings of the 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), Carlsbad, CA, USA.
39. Zheng, S., Liang, Y., Wang, S., Chen, R., and Sheng, K. (2020, January 16–20). Flextensor: An automatic schedule exploration and optimization framework for tensor computation on heterogeneous system. Proceedings of the Twenty-Fifth International Conference on Architectural Support for Programming Languages and Operating Systems, Lausanne, Switzerland.10.1145/3373376.3378508 ↗
40. Xu, Z., Xu, J., Peng, H., Wang, W., Wang, X., Wan, H., Dai, H., Xu, Y., Cheng, H., and Wang, K. (2023, January 8–12). ALT: Breaking the Wall between Data Layout and Loop Optimizations for Deep Learning Compilation. Proceedings of the Eighteenth European Conference on Computer Systems, Rome, Italy.10.1145/3552326.3587440 ↗
41. Ahn, B.H., Kinzer, S., and Esmaeilzadeh, H. (2022, January 10–14). Glimpse: Mathematical embedding of hardware specification for neural compilation. Proceedings of the 59th ACM/IEEE Design Automation Conference, San Francisco, CA, USA.10.1145/3489517.3530590 ↗
42. Li, M., Yang, H., Zhang, S., Yu, F., Gong, R., Liu, Y., Luan, Z., and Qian, D. (2023, January 7–10). Exploiting Subgraph Similarities for Efficient Auto-tuning of Tensor Programs. Proceedings of the 52nd International Conference on Parallel Processing, Salt Lake City, UT, USA.10.1145/3605573.3605596 ↗
43. HAOTuner: A Hardware Adaptive Operator Auto-Tuner for Dynamic Shape Tensor Compilers10.1109/TC.2023.3288758 ↗
44. Bai, J., Lu, F., and Zhang, K. (2020, January 01). ONNX: Open Neural Network Exchange. Available online: https://github.com/onnx/onnx.
45. Pezoa, F., Reutter, J.L., Suarez, F., Ugarte, M., and Vrgoč, D. (2016, January 11–15). Foundations of JSON schema. Proceedings of the 25th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee, Montreal, QC, Canada.10.1145/2872427.2883029 ↗
46. Long Short-Term Memory10.1162/neco.1997.9.8.1735 ↗
47. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., and Polosukhin, I. (2017, January 4–9). Attention is all you need. Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA.
48. Chen, T., and Guestrin, C. (2016, January 13–17). XGBoost: A Scalable Tree Boosting System. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA. KDD ’16.10.1145/2939672.2939785 ↗
49. Haykin, S. (1994). Neural Networks: A Comprehensive Foundation, Prentice Hall PTR.
50. Lightgbm: A highly efficient gradient boosting decision tree