Мультипрофильная статическая бинарная оптимизация приложения на основе трасс исполнения

  • Sergey Alekseevich Lisitsyn Российский исследовательский институт Huawei; Московский физико-технический институт (национальный исследовательский университет) http://orcid.org/0000-0002-8904-0601

Аннотация

Профилирование – сбор характеристик об исполнении программ, которые можно использовать во время оптимизаций. Одним из примеров использования является статический бинарный оптимизатор BOLT. Основной прирост производительности в нём достигается за счёт перекомпоновки кода на основе полученного во время исполнения приложения профиля. Однако, реализована данная оптимизация без учета переключения между сценариями приложения, когда происходит смена собираемых характеристик программы во время её исполнения. Это приводит к тому, что при исполнении приложения на сценарии, отличном от профилируемого, прирост производительности будет меньше, либо будет наблюдаться регрессия. Объединение всех возможных профилей программы в один не решает все возможные проблемы. В данной работе описывается алгоритм мультипрофильного анализа кода, учитывающий смену сценариев работы программы. Данный алгоритм основан на обработке трасс исполнения приложения, собираемых с помощью динамической бинарной инструментации. На основе этого анализа можно проводить оптимизацию по размещению кода в зависимости от его принадлежности определенному сценарию, что будет приводить к повышению локальности кода. Также на основе мультипрофильного анализа можно проводить оптимизацию, производя дублирование кода, попадающего одновременно в несколько сценариев.

Сведения об авторе

Sergey Alekseevich Lisitsyn, Российский исследовательский институт Huawei; Московский физико-технический институт (национальный исследовательский университет)

ведущий инженер; аспирант

Литература

1. Ottoni G., Maher B. Optimizing function placement for large-scale data-center applications. 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Austin, TX, USA; 2017. p. 233-244. (In Eng.) DOI: https://doi.org/10.1109/CGO.2017.7863743
2. Lebras Y., Charif-Rubial A.S., Jalby W. Combining static and dynamic analysis to guide PGO for HPC applications: a case study on real-world applications. 2019 International Conference on High Performance Computing & Simulation (HPCS). IEEE Press, Dublin, Ireland; 2019. p. 513-520. (In Eng.) DOI: https://doi.org/10.1109/HPCS48598.2019.9188161
3. Chen D., Li D.X., Moseley T. AutoFDO: automatic feedback-directed optimization for warehouse-scale applications. Proceedings of the 2016 International Symposium on Code Generation and Optimization (CGO '16). Association for Computing Machinery, New York, NY, USA; 2016. p. 12-23. (In Eng.) DOI: https://doi.org/10.1145/2854038.2854044
4. Panchenko M., Auler R., Nell B., Ottoni G. BOLT: A Practical Binary Optimizer for Data Centers and beyond. 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Washington, DC, USA; 2019. p. 2-14. (In Eng.) DOI: https://doi.org/10.1109/CGO.2019.8661201
5. Newell A., Pupyrev S. Improved Basic Block Reordering. IEEE Transactions on Computers. 2020; 69(12):1784-1794. (In Eng.) DOI: https://doi.org/10.1109/TC.2020.2982888
6. Li J., Ma X., Zhu C. Dynamic Binary Translation and Optimization. Journal of Computer Research & Development. 2007. 44(1):161. (In Eng.) DOI: https://doi.org/10.1360/crad20070123
7. Nethercote N., Seward J. Valgrind: a framework for heavyweight dynamic binary instrumentation. ACM SIGPLAN Notices. 2007; 42(6):89-100. (In Eng.) DOI: https://doi.org/10.1145/1273442.1250746
8. Vandeputte F., Eeckhout L., de Bosschere K. Exploiting program phase behavior for energy reduction on multi-configuration processors. Journal of Systems Architecture. 2007; 53(8):489-500. (In Eng.) DOI: https://doi.org/10.1016/j.sysarc.2006.11.004
9. Blem E., Menon J., Sankaralingam K. Power struggles: Revisiting the RISC vs. CISC debate on contemporary ARM and x86 architectures. 2013 IEEE 19th International Symposium on High Performance Computer Architecture (HPCA). IEEE Press, Shenzhen, China; 2013. p. 1-12. (In Eng.) DOI: https://doi.org/10.1109/HPCA.2013.6522302
10. Khan T.A., Sriraman A., Devietti J., Pokam G., Litz H., Kasikci B. I-SPY: Context-Driven Conditional Instruction Prefetching with Coalescing. 2020 53rd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). IEEE Press, Athens, Greece; 2020. p. 146-159. (In Eng.) DOI: https://doi.org/10.1109/MICRO50266.2020.00024
11. Lavaee R., Criswell J., Ding C. Codestitcher: inter-procedural basic block layout optimization. Proceedings of the 28th International Conference on Compiler Construction (CC 2019). Association for Computing Machinery, New York, NY, USA; 2019. p. 65-75. (In Eng.) DOI: https://doi.org/10.1145/3302516.3307358
12. Ottoni G., Liu B. HHVM Jump-Start: Boosting Both Warmup and Steady-State Performance at Scale. 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Seoul, Korea (South); 2021. p. 340-350. (In Eng.) DOI: https://doi.org/10.1109/CGO51591.2021.9370314
13. Sari A., Butun I. A Highly Scalable Instruction Scheduler Design based on CPU Stall Elimination. 2021 Zooming Innovation in Consumer Technologies Conference (ZINC). IEEE Press, Novi Sad, Serbia; 2021. p. 105-110. (In Eng.) DOI: https://doi.org/10.1109/ZINC52049.2021.9499298
14. Neves N., Tomás P., Roma N. Compiler-Assisted Data Streaming for Regular Code Structures. IEEE Transactions on Computers. 2021; 70(3):483-494. (In Eng.) DOI: https://doi.org/10.1109/TC.2020.2990302
15. Ying V.A., Jeffrey M.C., Sanchez D. T4: Compiling Sequential Code for Effective Speculative Parallelization in Hardware. 2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA). IEEE Press, Valencia, Spain; 2020. p. 159-172. (In Eng.) DOI: https://doi.org/10.1109/ISCA45697.2020.00024
16. Gadioli D., et al. SOCRATES ‒ A seamless online compiler and system runtime autotuning framework for energy-aware applications. 2018 Design, Automation & Test in Europe Conference & Exhibition (DATE). IEEE Press, Dresden, Germany; 2018. p. 1143-1146. (In Eng.) DOI: https://doi.org/10.23919/DATE.2018.8342183
17. Lin Y. Control-Flow Integrity Enforcement with Dynamic Code Optimization. Novel Techniques in Recovering, Embedding, and Enforcing Policies for Control-Flow Integrity. Information Security and Cryptography. Springer, Cham; 2021. p. 77-94. (In Eng.) DOI: https://doi.org/10.1007/978-3-030-73141-0_5
18. Ottoni G. 2018. HHVM JIT: a profile-guided, region-based compiler for PHP and Hack. ACM SIGPLAN Notices. 2018; 53(4):151-165. (In Eng.) DOI: https://doi.org/10.1145/3296979.3192374
19. Valiante E., Hernandez M., Barzegar A., Katzgraber H.G. Computational overhead of locality reduction in binary optimization problems. Computer Physics Communications. 2021; 269:108102. (In Eng.) DOI: https://doi.org/10.1016/j.cpc.2021.108102
20. Hong D.-Y., Wu J.-J., Liu Y.-P., Fu S.-Y., Hsu W.-C. Processor-Tracing Guided Region Formation in Dynamic Binary Translation. ACM Transactions on Architecture and Code Optimization. 2018; 15(4):52. (In Eng.) DOI: https://doi.org/10.1145/3281664
21. Li G., Liu L., Feng X. Accelerating GPU Computing at Runtime with Binary Optimization. 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Washington, DC, USA; 2019. p. 276-277. (In Eng.) DOI: https://doi.org/10.1109/CGO.2019.8661168
22. Zhou R., Jones T.M. Janus: Statically-Driven and Profile-Guided Automatic Dynamic Binary Parallelisation. 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Washington, DC, USA; 2019. p. 15-25. (In Eng.) DOI: https://doi.org/10.1109/CGO.2019.8661196
23. Fu S. -Y., Lin C. -M., Hong D. -Y., Liu Y. -P., Wu J. -J., Hsu W. -C. Work-in-Progress: Exploiting SIMD Capability in an ARMv7-to-ARMv8 Dynamic Binary Translator. 2018 International Conference on Compilers, Architectures and Synthesis for Embedded Systems (CASES). IEEE Press, Turin, Italy; 2018. p. 1-3. (In Eng.) DOI: https://doi.org/10.1109/CASES.2018.8516794
24. Arif M., Zhou R., Ho H. -M., Jones T. M. Cinnamon: A Domain-Specific Language for Binary Profiling and Monitoring. 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). IEEE Press, Seoul, Korea (South); 2021. p. 103-114. (In Eng.) DOI: https://doi.org/10.1109/CGO51591.2021.9370313
25. Desmond M., Exton C. An evaluation of the inline source code exploration technique. Proceedings of the 21st Annual Workshop on Psychology of Programming Interest Group (PPIG 2009). University of Limerick, Ireland; 2009. 16 p. Available at: https://www.ppig.org/papers/2009-ppig-21st-desmond (accessed 17.06.2021). (In Eng.)
Опубликована
2021-09-30
Как цитировать
LISITSYN, Sergey Alekseevich. Мультипрофильная статическая бинарная оптимизация приложения на основе трасс исполнения. Современные информационные технологии и ИТ-образование, [S.l.], v. 17, n. 3, p. 593-602, sep. 2021. ISSN 2411-1473. Доступно на: <http://sitito.cs.msu.ru/index.php/SITITO/article/view/815>. Дата доступа: 03 july 2024 doi: https://doi.org/10.25559/SITITO.17.202103.593-602.
Раздел
Исследования и разработки в области новых ИТ и их приложений