KERNELGEN — A PROTOTYPE OF LLVM-BASED AUTO-PARALLELIZING C/FORTRAN COMPILER FOR NVIDIA GPUs
DOI:
https://doi.org/10.14529/cmse130403Keywords:
GPU, LLVM, OpenACC, JIT-компиляция, выпуклый анализAbstract
The KernelGen project (http://kernelgen.org/) aims to develop Fortran and C compilersbased on the state-of-art open-source technologies for automatic GPU kernels generation from unmodified CPU source code, significantly improving the code porting experiences. Parallelism detection is based on LLVM/Polly and CLooG, extended with mapping of loops onto GPU compute grid, and assisted with runtime alias analysis. PTX assembly code is generated with NVPTX backend. Thanks to integration with GCC frontend by means of DragonEgg plugin, and customized linker, KernelGen features full GCC compatibility, and is able to compile complex applications into hybrid binaries containing both CPU and GPU-enabled executables. In addition to more robust parallelism detection, test kernels produced by KernelGen are up to 60 % faster than generated by PGI compiler for kernels source with manually inserted OpenACC directives.
References
Christen, M. PATUS for Convenient High-Performance Stencils: Evaluation in Earthquake Simulations / M. Christen, O. Schenk, Y. Cui // Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis (Salt Lake City, USA,
November 10–16, 2012).
Grosser, T. Polly – Polyhedral Optimization in LLVM / T. Grosser, H. Zheng, R. Aloor, A. Simb¨urger, A. Gr¨oßlinger, L.-N. Pouchet // International Symposium on Code Generation and Optimization (Charmonix, France, April 2–6, 2011).
Hou, Y. AsFermi: An assembler for the NVIDIA Fermi Instruction Set / Y. Hou // URL: http://code.google.com/p/asfermi/ (дата обращения: 03.12.2012).
Gysi, T. HP2C Dycore / T. Gysi // Workshop on COSMO dynamical core rewrite and HP2C project — March 2012, Offenbach, Germany — URL: http://mail.cosmo-model.org/
pipermail/pompa/attachments/20120306/079fadc1/DWD_HP2C_Dycore_120305.pdf (дата обращения: 03.12.2012).
Ragan-Kelley, J. Decoupling Algorithms from Schedules for Easy Optimization of Image Processing Pipelines / J. Ragan-Kelley, A. Adams, S. Paris, M. Levoy, S. Amarasinghe,
F. Durand. // ACM Trans. Graph. — 2012. — Vol. 31, No. 4. — P. 32:1–32:12.
Адинец, А.В. Программирование графических процессов при помощи расширяемых языков. // А.В. Адинец // Вестник Южно-Уральского государственного университета. Серия «Математическое моделирование и программирование». — 2011. — N. 25 (242). — Вып. 9. — С. 52-63.
The OpenACC TM Application Programming Interface. Version 1.0. URL: http://www.openacc-standard.org (дата обращения: 27.05.2012).
OpenHMPP, New HPC Open Standard for Many-Core. URL: http://www.openhmpp.org/en/OpenHMPPConsortium.aspx (дата обращения: 03.12.2012).
The Heterogeneous Offload Model for Intel R Many Integrated Core Architecture. URL: http://software.intel.com/sites/default/files/article/326701/heterogeneous-programming-model.pdf (дата обращения: 03.12.2012).
Govett, M. Development and Use of a Fortran → CUDA translator to run a NOAA Global Weather Model on a GPU cluster / M. Govett // Path to Petascale: Adapting GEO/CHEM/ASTRO Applications for Accelerators and Accelerator Clusters — 2009. — National Center for Supercomputing Applications, University of Illinois at Urbana-Champaign. — URL: http://gladiator.ncsa.uiuc.edu/PDFs/accelerators/
day2/session3/govett.pdf (дата обращения: 27.05.2012).
Бахтин, В.А. Автоматическое распараллеливание Фортран-программ на кластер с графическими ускорителями / В.А. Бахтин, Н.А. Катаев, М.С. Клинов, В.А. Крюков, Н.В. Поддерюгина, М.Н. Притула // Параллельные вычислительные технологии (ПаВТ’2012): Труды международной научной конференции (Новосибирск, 26 марта – 30 марта 2012 г.). — Челябинск: Издательский центр ЮУрГУ, 2012. — С. 373–379.
Kravets, A. GRAPHITE-OpenCL: Automatic parallelization of some loops in polyhedra representation / A. Kravets, A. Monakov, A. Belevantsev // GCC Developers’ Summit (Ottawa, Canada, October 25–27, 2010).
Verdoolaege, S. Polyhedral parallel code generation for CUDA / S. Verdoolaege, J. Carlos Juega, A. Cohen, J. Ignacio G´omez, C. Tenllado, F. Catthoor // ACM Trans. Archit. Code Optim. — 2013. — Vol. 9, No. 4. — P. 54:1–54:23.
Bastoul, C. Code Generation in the Polyhedral Model Is Easier Than You Think / C. Bastoul // PACT’13 IEEE International Conference on Parallel Architecture and Compilation Techniques (Antibes Juan-les-Pins, France, September 29 - October 3, 2004).
Torquati, M. An innovative compilation tool-chain for embedded multi-core architectures / M. Torquati, M. Venneschi, M. Amini, S. Guelton, R. Keryell, V. Lanore, F.-X. Pasquier, M. Barreteau, R. Barr`ere, C.-T. Petrisor, E. Lenormand, C. Cantini, F. De Stefani. // Embedded World Conference (Nuremberg, Germany, February 2012).
Sands, D. Reimplementing llvm-gcc as a gcc plugin / D. Sands // Third Annual LLVM Developers’ Meeting. — 2009. — Apple Inc. Campus, Cupertino, California. — URL: http:
//llvm.org/devmtg/2009-10/Sands_LLVMGCCPlugin.pdf (дата обращения: 03.12.2012).
Wolfe, M. The PGI Accelerator Programming Model on NVIDIA GPUs Part 3: Porting WRF / M. Wolfe, C. Toepfer // URL: http://www.pgroup.com/lit/articles/insider/v1n3a1.htm (дата обращения: 03.12.2012).
Squyres, J. Open MPI State of the Union / J. Squyres, G. Bosilca, S. Sumimoto, R. vandeVaart // Open MPI Community Meeting. — Supercomputing, 2011. — URL: http:
//www.open-mpi.org/papers/sc-2011/Open-MPI-SC11-BOF-1up.pdf (дата обращения: 03.12.2012).
Consortium for Small-scale Modeling. URL: http://www.cosmo-model.org/ (дата обращения: 03.12.2012).
The Weather Research & Forecasting Model. URL: http://www.wrf-model.org/index.php (дата обращения: 03.12.2012).
KernelGen Performance Test Suite. URL: https://hpcforge.org/plugins/mediawiki/wiki/kernelgen/index.php/Performance_Test_Suite (дата обращения: 27.01.2013).
Практика суперкомпьютера «Ломоносов» / Вл.В. Воеводин, С.А. Жуматий, С.И. Соболев и др. // Открытые системы. — 2012. — No. 7. — С. 36–39.


