Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3427081.3427089acmotherconferencesArticle/Chapter ViewAbstractPublication PagessblpConference Proceedingsconference-collections
research-article

YACOS: a Complete Infrastructure to the Design and Exploration of Code Optimization Sequences

Published: 22 October 2020 Publication History

Abstract

The growing popularity of machine learning frameworks and algorithms has greatly contributed to the design and exploration of good code optimization sequences. Yet, in spite of this progress, mainstream compilers still provide users with only a handful of fixed optimization sequences. Finding optimization sequences that are good in general is challenging because the universe of possible sequences is potentially infinite. This paper describes a infrastructure that provides developers with the means to explore this space. Said infrastructure, henceforth called YaCoS, consists of benchmarks, search algorithms, metrics to estimate the distance between programs, and compilation strategies. YaCoS's features let users build learning models that predict, for unknown programs, optimization sequences that are likely to yield good results for them. In this paper, as a case study, we have used YaCoS to find good optimization sequences for LLVM, using code size as the objective function. Such study lets us evaluate three feature sets: two variations of the feature vectors proposed by Namolaru at al in 2010, plus the optimization statistics produced by LLVM. Our results show that YaCoS is able to find sequences that improve onto clang -Oz by 3.75% on average. Our experiments do not indicate a dominant feature set out of the three approaches that we have investigated---it is possible to find programs in which one of them is strictly better than the others.

References

[1]
F. Agakov, E. Bonilla, J. Cavazos, B. Franke, G. Fursin, M. F. P. O'Boyle, J. Thomson, M. Toussaint, and C. K. I. Williams. 2006. Using Machine Learning to Focus Iterative Optimization. In CGO. IEEE Computer Society, Washington, DC, USA, 295--305. https://doi.org/10.1109/CGO.2006.37
[2]
Charu C. Aggarwal, Alexander Hinneburg, and Daniel A. Keim. 2001. On the Surprising Behavior of Distance Metrics in High Dimensional Spaces. In ICDT. Springer-Verlag, Berlin, Heidelberg, 420--434.
[3]
Amir H. Ashouri, William Killian, John Cavazos, Gianluca Palermo, and Cristina Silvano. 2018. A Survey on Compiler Autotuning Using Machine Learning. Comput. Surv. 51, 5 (2018), 96:1--96:42. https://doi.org/10.1145/3197978
[4]
Sorav Bansal and Alex Aiken. 2008. Binary Translation Using Peephole Superoptimizers. In OSDI. USENIX Association, Berkeley, CA, USA, 177--192.
[5]
Rajkishore Barik, Naila Farooqui, Brian T. Lewis, Chunling Hu, and Tatiana Shpeisman. 2016. A Black-box Approach to Energy-aware Scheduling on Integrated CPU-GPU Systems. In CGO. ACM, New York, NY, USA, 70--81. https://doi.org/10.1145/2854038.2854052
[6]
Francesco Biscani and Dario Izzo. 2020. esa/pagmo2: pagmo 2.15.0. https://doi.org/10.5281/zenodo.3738182
[7]
Craig Blackmore, Oliver Ray, and Kerstin Eder. 2017. Automatically Tuning the GCC Compiler to Optimize the Performance of Applications Running on the ARM Cortex-M3. arXiv:1703.08228 http://arxiv.org/abs/1703.08228
[8]
Rudy Bunel, Alban Desmaison, M. Pawan Kumar, Philip H. S. Torr, and Pushmeet Kohli. 2017. Learning to superoptimize programs. In ICLR. OpenReview, Toulon, France, Article 1, 14 pages.
[9]
Chris Cummins, Pavlos Petoumenos, Alastair Murray, and Hugh Leather. 2018. Compiler Fuzzing Through Deep Learning. In ISSTA. ACM, New York, NY, USA, 95--105. https://doi.org/10.1145/3213846.3213848
[10]
Chris Cummins, Pavlos Petoumenos, Zheng Wang, and Hugh Leather. 2017. Synthesizing Benchmarks for Predictive Modeling. In CGO. IEEE, Piscataway, NJ, USA, 86--99.
[11]
E. Daniel de Lima and A. Faustino da Silva. 2015. Improved batch elimination: A fast algorithm to identify and remove harmful compiler optimizations. In 2015 Latin American Computing Conference (CLEI). IEE, Arequipa, Peru, 1--8.
[12]
Tiago de Souza Xavier and Anderson da Silva. 2018. Exploration of Compiler Optimization Sequences Using a Hybrid Approach. COMPUTING AND INFORMATICS 37, 1 (2018), 165--185. http://www.cai.sk/ojs/index.php/cai/article/view/2018_1_165
[13]
Jack Dongarra, Kevin London, Shirley Moore, Phil Mucci, and Dan Terpstra. 2001. Using PAPI for Hardware Performance Monitoring on Linux Systems. In In Conference on Linux Clusters: The HPC Revolution, Linux Clusters Institute. LCI, New Mexico, USA, 1--11.
[14]
João Fabrício Filho, Luis Gustavo Araujo Rodriguez, and Anderson Faustino da Silva. 2018. Yet Another Intelligent Code-Generating System: A Flexible and Low-Cost Solution. J. Comput. Sci. Technol. 33, 5 (2018), 940--965. https://doi.org/10.1007/s11390-018-1867-7
[15]
Grigori Fursin, Yuriy Kashnikov, Abdul Wahid Memon, Zbigniew Chamski, Olivier Temam, Mircea Namolaru, Elad Yom-Tov, Bilha Mendelson, Ayal Zaks, Eric Courtois, et al. 2011. Milepost GCC: Machine Learning Enabled Self-tuning Compiler. International journal of parallel programming 39, 3 (2011), 296--327.
[16]
Grigori Fursin and Olivier Temam. 2010. Collective Optimization: A Practical Collaborative Approach. Trans. Archit. Code Optim. 7, 4 (2010), 20:1--20:29. https://doi.org/10.1145/1880043.1880047
[17]
Andrés Goens, Alexander Brauckmann, Sebastian Ertel, Chris Cummins, Hugh Leather, and Jeronimo Castrillon. 2019. A Case Study on Machine Learning for Synthesizing Benchmarks. In MAPL. ACM, New York, NY, USA, 38--46. https://doi.org/10.1145/3315508.3329976
[18]
Kenneth Hoste and Lieven Eeckhout. 2007. Microarchitecture-independent workload characterization. IEEE micro 27, 3 (2007), 63--72.
[19]
Chi-Keung Luk, Robert Cohn, Robert Muth, Harish Patil, Artur Klauser, Geoff Lowney, Steven Wallace, Vijay Janapa Reddi, and Kim Hazelwood. 2005. Pin: building customized program analysis tools with dynamic instrumentation. In Acm sigplan notices, Vol. 40. ACM, USA, 190--200.
[20]
Mircea Namolaru, Albert Cohen, Grigori Fursin, Ayal Zaks, and Ari Freund. 2010. Practical Aggregation of Semantical Program Properties for Machine Learning Based Optimization. In CASES. ACM, New York, NY, USA, 197--206. https://doi.org/10.1145/1878921.1878951
[21]
S. B. Needleman and C. D. Wunsch. 1970. A general method applicable to the search for similarities in the amino acid sequence of two proteins. J. Mol. Biol. 48 (1970), 443--453.
[22]
Rajiv Nishtala, Paul M. Carpenter, Vinicius Petrucci, and Xavier Martorell. 2017. Hipster: Hybrid Task Manager for Latency-Critical Cloud Workloads. In HPCA. IEEE, New York, NY, USA, 409--420.
[23]
Marcelo Novaes, Vinicius Petrucci, Abdoulaye Gamatié, and Fernando Magno Quintão Pereira. 2019. Compiler-assisted adaptive program scheduling in big.LITTLE systems: poster. In PPoPP. ACM, New York, NY, USA, 429--430. https://doi.org/10.1145/3293883.3301493
[24]
W. F. Ogilvie, P. Petoumenos, Z. Wang, and H. Leather. 2017. Minimizing the cost of iterative compilation with active learning. In CGO. IEE, Austin, TX, USA, 245--256.
[25]
Eunjung Park, Christos Kartsaklis, and John Cavazos. 2014. HERCULES: Strong Patterns towards More Intelligent Predictive Modeling. In ICPP. IEEE, New York, NY, USA, 172--181. https://doi.org/10.1109/ICPP.2014.26
[26]
Fernando Magno Quintão Pereira, Guilherme Vieira Leobas, and Abdoulaye Gamatié. 2018. Static Prediction of Silent Stores. ACM Trans. Archit. Code Optim. 15, 4, Article 44 (2018), 26 pages. https://doi.org/10.1145/3280848
[27]
Gabriel Poesia, Breno Campos Ferreira Guimarães, Fabricio Ferracioli, and Fernando Magno Quintão Pereira. 2017. Static placement of computation on heterogeneous devices. PACMPL 1, OOPSLA (2017), 50:1--50:28.
[28]
Suresh Purini and Lakshya Jain. 2013. Finding Good Optimization Sequences Covering Program Space. ACM Trans. Archit. Code Optim. 9, 4, Article 56 (Jan. 2013), 23 pages. https://doi.org/10.1145/2400682.2400715
[29]
Douglas Simon, John Cavazos, Christian Wimmer, and Sameer Kulkarni. 2013. Automatic Construction of Inlining Heuristics Using Machine Learning. In CGO. IEEE Computer Society, Washington, DC, USA, 1--12. https://doi.org/10.1109/CGO.2013.6495004
[30]
Marcos Yukio Siraichi, Caio Henrique Segawa Tonetti, and Anderson Faustino da Silva. 2019. Pinhão: An Auto-tunning System for Compiler Optimizations Guided by Hot Functions. j-jucs 25, 1 (2019), 42--72. http://www.jucs.org/jucs_25_1/pinhao_an_auto_tunning
[31]
Jyothi Krishna Viswakaran Sreelatha, Shankar Balachandran, and Rupesh Nasre. 2018. CHOAMP: Cost Based Hardware Optimization for Asymmetric Multicore Processors. Trans. Multi-Scale Computing Systems 4, 2 (2018), 163--176.
[32]
Mark Stephenson, Saman Amarasinghe, Martin Martin, and Una-May O'Reilly. 2003. Meta Optimization: Improving Compiler Heuristics with Machine Learning. In PLDI. ACM, New York, NY, USA, 77--90. https://doi.org/10.1145/781131.781141
[33]
Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, Ziyue Huang, Qipeng Guo, Hao Zhang, Haibin Lin, Junbo Zhao, Jinyang Li, Alexander J. Smola, and Zheng Zhang. 2019. Deep Graph Library: Towards Efficient and Scalable Deep Learning on Graphs. ArXiv abs/1909.01315 (2019), 1--7.
[34]
Zheng Wang and Michael F. P. O'Boyle. 2018. Machine Learning in Compiler Optimization. Proc. IEEE 106, 11 (2018), 1879--1901. https://doi.org/10.1109/JPROC.2018.2817118
[35]
Yuan Wen, Zheng Wang, and Michael F. P. O'Boyle. 2014. Smart multitask scheduling for OpenCL programs on CPU/GPU heterogeneous platforms. In HiPC. IEEE, Los Alamitos, CA, USA, 1--10. https://doi.org/10.1109/HiPC.2014.7116910
[36]
Peng Zhao and José Nelson Amaral. 2003. To Inline or Not to Inline? Enhanced Inlining Decisions. In LCPC. Springer, Heidelberg, Germany, 405--419.
[37]
Zhelong Pan and R. Eigenmann. 2006. Fast and effective orchestration of compiler optimizations for automatic performance tuning. In International Symposium on Code Generation and Optimization (CGO'06). IEE, New York, NY, USA, 12 pp.-332.

Cited By

View all
  • (2024)A Two-Stage LLVM Option Sequence Optimization Method to Minimize Energy ConsumptionSwarm and Evolutionary Computation10.1016/j.swevo.2024.10159188(101591)Online publication date: Jul-2024
  • (2022)Impacto de Ofuscadores e Otimizadores de Código na Acurácia de Classificadores de ProgramasProceedings of the XXVI Brazilian Symposium on Programming Languages10.1145/3561320.3561322(68-75)Online publication date: 6-Oct-2022
  • (2022)POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learning2022 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS)10.1109/ISPASS55109.2022.00012(121-131)Online publication date: May-2022
  • Show More Cited By

Index Terms

  1. YACOS: a Complete Infrastructure to the Design and Exploration of Code Optimization Sequences

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      SBLP '20: Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity
      October 2020
      81 pages
      ISBN:9781450389433
      DOI:10.1145/3427081
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      In-Cooperation

      • SBC: Brazilian Computer Society

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 22 October 2020

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Compilers
      2. Exploration
      3. Optimizations

      Qualifiers

      • Research-article
      • Research
      • Refereed limited

      Funding Sources

      • Conselho Nacional de Desenvolvimento Científico e Tecnológico

      Conference

      SBLP '20

      Acceptance Rates

      Overall Acceptance Rate 22 of 50 submissions, 44%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)8
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 08 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)A Two-Stage LLVM Option Sequence Optimization Method to Minimize Energy ConsumptionSwarm and Evolutionary Computation10.1016/j.swevo.2024.10159188(101591)Online publication date: Jul-2024
      • (2022)Impacto de Ofuscadores e Otimizadores de Código na Acurácia de Classificadores de ProgramasProceedings of the XXVI Brazilian Symposium on Programming Languages10.1145/3561320.3561322(68-75)Online publication date: 6-Oct-2022
      • (2022)POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learning2022 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS)10.1109/ISPASS55109.2022.00012(121-131)Online publication date: May-2022
      • (2022)Fast selection of compiler optimizations using performance prediction with graph neural networksConcurrency and Computation: Practice and Experience10.1002/cpe.686935:17Online publication date: 16-Mar-2022
      • (2021)New Optimization Sequences for Code-Size Reduction for the LLVM Compilation InfrastructureProceedings of the 25th Brazilian Symposium on Programming Languages10.1145/3475061.3475085(33-40)Online publication date: 27-Sep-2021
      • (2021)A Graph-based Model for Building Optimization SequencesProceedings of the 25th Brazilian Symposium on Programming Languages10.1145/3475061.3475083(92-99)Online publication date: 27-Sep-2021
      • (2021)Graphs based on IR as Representation of CodeProceedings of the 25th Brazilian Symposium on Programming Languages10.1145/3475061.3475063(75-82)Online publication date: 27-Sep-2021
      • (2021)AnghaBenchProceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization10.1109/CGO51591.2021.9370322(378-390)Online publication date: 27-Feb-2021

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media