Predição de Tamanho de Código utilizando Benchmarks Sintetizados: Um Estudo de Caso

  • André Felipe Zanella UEM
  • Anderson Faustino da Silva UEM

Resumo


Um dos principais problemas que impedem Redes Neurais Profundas se tornarem predominantes para otimização de compiladores é a dificuldade de criação de conjuntos de dados de alta qualidade. Benchmarks reais geralmente são programas grandes e complexos, e por não serem abundantes, modelos de compilação preditiva geralmente apresentam dificuldades de generalização devido ao vasto espaço de programas. Esforços recentes da comunidade para mitigar este problema resultaram em ferramentas para síntese automática de benchmarks, capazes de gerar milhares ou milhões de programas sintéticos. No entanto, esses códigos dificilmente coincidem em termos de similaridade com benchmarks codificados manualmente. Este artigo tem como objetivo avaliar o desempenho dos benchmarks AnghaBench, uma proeminente suíte de programas C sintetizados para compilação preditiva, em um problema de aprendizagem de máquina. Comparamos o desempenho desses benchmarks com aplicações provenientes da suíte de testes LLVM, utilizando um modelo LSTM para prever o tamanho de código proporcionado por uma sequência de otimizações, sem a necessidade de compilar o programa. Os resultados experimentais indicam que, em alguns domínios, benchmarks sintéticos são equiparáveis, mas não superam aplicações reais.

Referências

Ashouri, A. H., Killian, W., Cavazos, J., et al. (2018). A Survey on Compiler Autotuning Using Machine Learning. ACM Comput. Surv., 51(5).

Barany, G. (2018a). Finding Missed Compiler Optimizations by Differential Testing. In Proceedings of the 27th International Conference on Compiler Construction, CC 2018, page 82–92, New York, NY, USA. Association for Computing Machinery.

Barany, G. (2018b). Liveness-driven random program generation. In Fioravanti, F. and Gallagher, J. P., editors, Logic-Based Program Synthesis and Transformation, pages 112–127, Cham. Springer International Publishing.

Cummins, C., Petoumenos, P., Murray, A., et al. (2018). Compiler Fuzzing through Deep Learning. In Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2018, page 95–105, New York, NY, USA. Association for Computing Machinery.

Cummins, C., Petoumenos, P., Wang, Z., et al. (2017). Synthesizing Benchmarks for Predictive Modeling. In Proceedings of the 2017 International Symposium on Code Generation and Optimization, CGO ’17, page 86–99, Austin, USA. IEEE Press.

da Silva, A. F., Kind, B. C., de Souza Magalhães, J. W., et al. (2021). ANGHABENCH: A Suite with One Million Compilable C Benchmarks for Code-Size Reduction. In 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), pages 378–390, Seoul, South Korea. IEEE Computer Society.

Goens, A., Brauckmann, A., Ertel, S., et al. (2019). A Case Study on Machine Learning for Synthesizing Benchmarks. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, MAPL 2019, page 38–46, New York, NY, USA. Association for Computing Machinery.

Hashimoto, A. and Ishiura, N. (2016). Detecting Arithmetic Optimization Opportunities for C Compilers by Randomly Generated Equivalent Programs. IPSJ Transactions on System LSI Design Methodology, 9:21–29.

Heo, K., Lee, W., Pashakhanloo, P., et al. (2018). Effective Program Debloating via Reinforcement Learning. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, CCS ’18, page 380–394, New York, NY, USA. Association for Computing Machinery.

Hochreiter, S. and Schmidhuber, J. (1997). Long Short-Term Memory. Neural Comput., 9(8):1735–1780.

Huang, Q., Haj-Ali, A., Moses, W., et al. (2020). AutoPhase: Juggling HLS Phase Orderings in Random Forests with Deep Reinforcement Learning.

Lattner, C. and Adve, V. (2004). LLVM: A Compilation Framework for Lifelong Program Analysis and Transformation. In CGO, pages 75–88, San Jose, CA, USA.

Otter, D. W., Medina, J. R., and Kalita, J. K. (2021). A Survey of the Usages of Deep Learning for Natural Language Processing. IEEE Transactions on Neural Networks and Learning Systems, 32(2):604–624.

Rocha, R. C. O., Petoumenos, P., Wang, Z., Cole, M., and Leather, H. (2019). Function merging by sequence alignment. In 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), pages 149–163.

Rocha, R. C. O., Petoumenos, P., Wang, Z., Cole, M., and Leather, H. (2020). Effective function merging in the ssa form. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2020, page 854–868, New York, NY, USA. Association for Computing Machinery.

Silva, A. F. d., de Lima, B. N. B., and Pereira, F. M. Q. a. (2021). Exploring the Space of Optimization Sequences for Code-Size Reduction: Insights and Tools. In Proceedings of the 30th ACM SIGPLAN International Conference on Compiler Construction, CC 2021, page 47–58, New York, NY, USA. Association for Computing Machinery.

Trofin, M., Qian, Y., Brevdo, E., et al. (2021). MLGO: a Machine Learning Guided Compiler Optimizations Framework.

Wei, X.-S., Wu, J., and Cui, Q. (2019). Deep Learning for Fine-Grained Image Analysis: A Survey.

Yang, X., Chen, Y., Eide, E., et al. (2011). Finding and Understanding Bugs in C Compilers. SIGPLAN Not., 46(6):283–294.

Zhang, S., Yao, L., Sun, A., et al. (2019). Deep Learning Based Recommender System: A Survey and New Perspectives. ACM Computing Surveys, 52(1).
Publicado
26/10/2021
Como Citar

Selecione um Formato
ZANELLA, André Felipe; SILVA, Anderson Faustino da. Predição de Tamanho de Código utilizando Benchmarks Sintetizados: Um Estudo de Caso. In: SIMPÓSIO EM SISTEMAS COMPUTACIONAIS DE ALTO DESEMPENHO (SSCAD), 22. , 2021, Belo Horizonte. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2021 . p. 84-95. DOI: https://doi.org/10.5753/wscad.2021.18514.