Programming GPUs with OpenMP and Python
摘要
Python, the world’s most popular programming language, offers high productivity and a vast, robust, production-level ecosystem. However, its use in HPC has generally been limited to regions that are not performance critical due to performance limitations that arise from it being an interpreted language, its implementation of thread-safety, and its lack of a general, well-defined approach to parallelization. Instead, performance critical code is typically implemented in low-level languages, such as C/C++, which limits access to Python’s ecosystem. An earlier effort created PyOMP, an implementation of OpenMP in Python that demonstrated promising performance on CPUs but did not support GPUs. This paper presents our new design and implementation of PyOMP to support GPUs with significant extensions to interface Python to OpenMP GPU offloading and dynamic compilation. Using HPC proxy applications from HeCBench, we demonstrate performance competitive with OpenMP/GPU programs using C/C++ while maintaining the high productivity that has made Python so popular.