TY - GEN
T1 - Direct GPU Compilation and Execution for Host Applications with OpenMP Parallelism
AU - Tian, Shilei
AU - Huber, Joseph
AU - Parasyris, Konstantinos
AU - Chapman, Barbara
AU - Doerfert, Johannes
N1 - Publisher Copyright:
© 2022 IEEE.
PY - 2022
Y1 - 2022
N2 - Currently, offloading to accelerators requires users to identify which regions are to be executed on the device, what memory needs to be transferred, and how synchronization is to be resolved. On top of these manual tasks, many standard (C/C++ library) functions, such as file I/O or memory manipulation, cannot be directly executed on the device and need to be worked around by the user explicitly. This makes it challenging to port programs in the first place and hinders developers from testing features on the GPU and within the GPU compilation pipeline. Existing tests and test suites for the host are effectively unusable for accelerators and need to be manually ported to provide the same benefits for the devices as they do on the host. In this paper, we propose a direct GPU compilation scheme that leverages the portable target offloading interface provided by LLVM/OpenMP. Utilizing this infrastructure allows us to compile an existing host application for the GPU and execute it there with only a minimal wrapper layer for the user code, command line arguments, and a compiler provided GPU implementation of C/C++ standard library functions. The C/C++ library functions are partially implemented for direct device execution and otherwise fallback to remote procedure call (RPC) to call host functions transparently. Our proposed prototype will allow users to quickly compile for, and test on, the GPU without explicitly handling kernel launches, data mapping, or host-device synchronization. We evaluate our implementation using three proxy applications with host OpenMP parallelism and three microbenchmarks to test the correctness of our prototype GPU compilation.
AB - Currently, offloading to accelerators requires users to identify which regions are to be executed on the device, what memory needs to be transferred, and how synchronization is to be resolved. On top of these manual tasks, many standard (C/C++ library) functions, such as file I/O or memory manipulation, cannot be directly executed on the device and need to be worked around by the user explicitly. This makes it challenging to port programs in the first place and hinders developers from testing features on the GPU and within the GPU compilation pipeline. Existing tests and test suites for the host are effectively unusable for accelerators and need to be manually ported to provide the same benefits for the devices as they do on the host. In this paper, we propose a direct GPU compilation scheme that leverages the portable target offloading interface provided by LLVM/OpenMP. Utilizing this infrastructure allows us to compile an existing host application for the GPU and execute it there with only a minimal wrapper layer for the user code, command line arguments, and a compiler provided GPU implementation of C/C++ standard library functions. The C/C++ library functions are partially implemented for direct device execution and otherwise fallback to remote procedure call (RPC) to call host functions transparently. Our proposed prototype will allow users to quickly compile for, and test on, the GPU without explicitly handling kernel launches, data mapping, or host-device synchronization. We evaluate our implementation using three proxy applications with host OpenMP parallelism and three microbenchmarks to test the correctness of our prototype GPU compilation.
KW - compilation
KW - GPU
KW - OpenMP
KW - portability
UR - https://www.scopus.com/pages/publications/85148031046
U2 - 10.1109/LLVM-HPC56686.2022.00010
DO - 10.1109/LLVM-HPC56686.2022.00010
M3 - Conference contribution
AN - SCOPUS:85148031046
T3 - Proceedings of LLVM-HPC 2022: 8th Annual Workshop on the LLVM Compiler Infrastructure in HPC, Held in conjunction with SC 2022: The International Conference for High Performance Computing, Networking, Storage and Analysis
SP - 43
EP - 51
BT - Proceedings of LLVM-HPC 2022
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 8th IEEE/ACM Annual Workshop on the LLVM Compiler Infrastructure in HPC, LLVM-HPC 2022
Y2 - 13 November 2022 through 18 November 2022
ER -