1,592 research outputs found
Just-In-Time GPU Compilation for Interpreted Languages with Partial Evaluation
Computer systems are increasingly featuring powerful parallel devices with the advent of many-core CPUs and GPUs. This offers the opportunity to solve computationally-intensive problems at a fraction of the time traditional CPUs need. However, exploiting heterogeneous hardware requires the
use of low-level programming language approaches such as OpenCL, which is incredibly challenging, even for advanced programmers.
On the application side, interpreted dynamic languages are increasingly becoming popular in many domains due to their simplicity, expressiveness and flexibility. However, this creates a wide gap between the high-level abstractions offered to programmers and the low-level hardware-specific
interface. Currently, programmers must rely on high performance libraries or they are forced to write parts of their application in a low-level language like OpenCL. Ideally, non-expert programmers should be able to exploit heterogeneous hardware directly from their interpreted dynamic languages.
In this paper, we present a technique to transparently and automatically offload computations from interpreted dynamic languages to heterogeneous devices. Using just-in-time compilation, we automatically generate OpenCL code at runtime which is specialized to the actual observed data types using profiling information. We demonstrate our technique using R, which is a popular interpreted dynamic language predominately used in big data analytic. Our experimental results show the execution on a GPU yields speedups of over 150x compared to the sequential FastR implementation and the obtained performance is competitive with manually written GPU code. We also show that when taking into account start-up time, large speedups are achievable, even when the applications run for as little as a few seconds
Accelerating interpreted programming languages on GPUs with just-in-time compilation and runtime optimisations
Nowadays, most computer systems are equipped with powerful parallel devices
such as Graphics Processing Units (GPUs). They are present in almost every computer
system including mobile devices, tablets, desktop computers and servers. These
parallel systems have unlocked the possibility for many scientists and companies to
process significant amounts of data in shorter time. But the usage of these parallel
systems is very challenging due to their programming complexity. The most common
programming languages for GPUs, such as OpenCL and CUDA, are created for expert
programmers, where developers are required to know hardware details to use GPUs.
However, many users of heterogeneous and parallel hardware, such as economists,
biologists, physicists or psychologists, are not necessarily expert GPU programmers.
They have the need to speed up their applications, which are often written in high-level
and dynamic programming languages, such as Java, R or Python. Little work has
been done to generate GPU code automatically from these high-level interpreted and
dynamic programming languages. This thesis presents a combination of a programming
interface and a set of compiler techniques which enable an automatic translation
of a subset of Java and R programs into OpenCL to execute on a GPU. The goal is
to reduce the programmability and usability gaps between interpreted programming
languages and GPUs.
The first contribution is an Application Programming Interface (API) for programming
heterogeneous and multi-core systems. This API combines ideas from functional
programming and algorithmic skeletons to compose and reuse parallel operations.
The second contribution is a new OpenCL Just-In-Time (JIT) compiler that automatically
translates a subset of the Java bytecode to GPU code. This is combined with
a new runtime system that optimises the data management and avoids data transformations
between Java and OpenCL. This OpenCL framework and the runtime system
achieve speedups of up to 645x compared to Java within 23% slowdown compared to
the handwritten native OpenCL code.
The third contribution is a new OpenCL JIT compiler for dynamic and interpreted
programming languages. While the R language is used in this thesis, the developed
techniques are generic for dynamic languages. This JIT compiler uniquely combines
a set of existing compiler techniques, such as specialisation and partial evaluation, for
OpenCL compilation together with an optimising runtime that compile and execute R
code on GPUs. This JIT compiler for the R language achieves speedups of up to 1300x
compared to GNU-R and 1.8x slowdown compared to native OpenCL
Python Programmers Have GPUs Too: Automatic Python Loop Parallelization with Staged Dependence Analysis
Python is a popular language for end-user software development in many application domains. End-users want to harness parallel compute resources effectively, by exploiting commodity manycore technology including GPUs. However, existing approaches to parallelism in Python are esoteric, and generally seem too complex for the typical end-user developer. We argue that implicit, or automatic, parallelization is the best way to deliver the benefits of manycore to end-users, since it avoids domain-specific languages, specialist libraries, complex annotations or restrictive language subsets. Auto-parallelization fits the Python philosophy, provides effective performance, and is convenient for non-expert developers.
Despite being a dynamic language, we show that Python is a suitable target for auto-parallelization. In an empirical study of 3000+ open-source Python notebooks, we demonstrate that typical loop behaviour ‘in the wild’ is amenable to auto-parallelization. We show that staging the dependence analysis is an effective way to maximize performance. We apply classical dependence analysis techniques, then leverage the Python runtime’s rich introspection capabilities to resolve additional loop bounds and variable types in a just-in-time manner. The parallel loop nest code is then converted to CUDA kernels for GPU execution. We achieve orders of magnitude speedup over baseline interpreted execution and some speedup (up to 50x, although not consistently) over CPU JIT-compiled execution, across 12 loop-intensive standard benchmarks
Python Programmers Have GPUs Too: Automatic Python Loop Parallelization with Staged Dependence Analysis
Python is a popular language for end-user software development in many application domains. End-users want to harness parallel compute resources effectively, by exploiting commodity manycore technology including GPUs. However, existing approaches to parallelism in Python are esoteric, and generally seem too complex for the typical end-user developer. We argue that implicit, or automatic, parallelization is the best way to deliver the benefits of manycore to end-users, since it avoids domain-specific languages, specialist libraries, complex annotations or restrictive language subsets. Auto-parallelization fits the Python philosophy, provides effective performance, and is convenient for non-expert developers.
Despite being a dynamic language, we show that Python is a suitable target for auto-parallelization. In an empirical study of 3000+ open-source Python notebooks, we demonstrate that typical loop behaviour ‘in the wild’ is amenable to auto-parallelization. We show that staging the dependence analysis is an effective way to maximize performance. We apply classical dependence analysis techniques, then leverage the Python runtime’s rich introspection capabilities to resolve additional loop bounds and variable types in a just-in-time manner. The parallel loop nest code is then converted to CUDA kernels for GPU execution. We achieve orders of magnitude speedup over baseline interpreted execution and some speedup (up to 50x, although not consistently) over CPU JIT-compiled execution, across 12 loop-intensive standard benchmarks
ALPyNA: Acceleration of Loops in Python for Novel Architectures
We present ALPyNA, an automatic loop parallelization framework for Python, which analyzes data dependences within nested loops and dynamically generates CUDA kernels for GPU execution. The ALPyNA system applies classical dependence analysis techniques to discover and exploit potential parallelism. The skeletal structure of the dependence graph is determined statically (if possible) or at runtime; this is combined with type and bounds information discovered at runtime, to auto-generate high-performance kernels for offload to GPU.
We demonstrate speedups of up to 1000x relative to the native CPython interpreter across four array-intensive numerical Python benchmarks. Performance improvement is related to both iteration domain size and dependence graph complexity. Nevertheless, this approach promises to bring the benefits of manycore parallelism to application developers
- …