Opportunistic acceleration of array-centric Python computation in heterogeneous environments

Jacob, Dejice (2020) Opportunistic acceleration of array-centric Python computation in heterogeneous environments. PhD thesis, University of Glasgow.

Full text available as:
[img]
Preview
PDF
Available under License Creative Commons Attribution.

Download (2MB) | Preview

Abstract

Dynamic scripting languages, like Python, are growing in popularity and increasingly used by non-expert programmers. These languages provide high level abstractions such as safe memory management, dynamic type handling and array bounds checking. The reduction in boilerplate code enables the concise expression of computation compared to statically typed and compiled languages. This improves programmer productivity. Increasingly, scripting languages are used by domain experts to write numerically intensive code in a variety of domains (e.g. Economics, Zoology, Archaeology and Physics). These programs are often used not just for prototyping but also in deployment. However, such managed program execution comes with a significant performance penalty arising from the interpreter having to decode and dispatch based on dynamic type checking.

Modern computer systems are increasingly equipped with accelerators such as GPUs. However, the massive speedups that can be achieved by GPU accelerators come at the cost of program complexity. Directly programming a GPU requires a deep understanding of the computational model of the underlying hardware architecture. While the complexity of such devices is abstracted by programming languages specialised for heterogeneous devices such as CUDA and OpenCL, these are dialects of the low-level C systems programming language used primarily by expert programmers.

This thesis presents the design and implementation of ALPyNA, a loop parallelisation and GPU code generation framework. A novel staged parallelisation approach is used to aggressively parallelise each execution instance of a loop nest. Loop dependence relationships that cannot be inferred statically are deferred for runtime analysis. At runtime, these dependences are augmented with runtime information obtained by introspection and the loop nest is parallelised. Parallel GPU kernels are customised to the runtime dependence graph, JIT compiled and executed.

A systematic analysis of the execution speed of loop nests is performed using 12 standard loop intensive benchmarks. The evaluation is performed on two CPU–GPU machines. One is a server grade machine while the other is a typical desktop. ALPyNA’s GPU kernels achieve orders of magnitude speedup over the baseline interpreter execution time (up to 16435x) and large speedups (up to 179.55x) over JIT compiled CPU code.

The varied performance of JIT compiled GPU code motivates the need for a sophisticated cost model to select the device providing the best speedups at runtime for varying domain sizes. This thesis describes a novel lightweight analytical cost model to determine the fastest device to execute a loop nest at runtime. The ALPyNA Cost Model (ACM) adapts to runtime dependence analysis and is parameterised on the hardware characteristics of the underlying target CPU or GPU. The cost model also takes into account the relative rate at which the interpreter is able to supply the GPU with computational work. ACM is re-targetable to other accelerator devices and only requires minimal install time profiling.

Item Type: Thesis (PhD)
Qualification Level: Doctoral
Keywords: Python, GPU, JIT, compilers, dynamic languages, loop parallelism, heterogeneous architectures.
Subjects: Q Science > QA Mathematics > QA75 Electronic computers. Computer science
Colleges/Schools: College of Science and Engineering > School of Computing Science
Funder's Name: Engineering and Physical Sciences Research Council (EPSRC), Engineering and Physical Sciences Research Council (EPSRC)
Supervisor's Name: Singer, Dr Jeremy and Trinder, Prof. Phil
Date of Award: 2020
Depositing User: Dejice Jacob
Unique ID: glathesis:2020-82011
Copyright: Copyright of this thesis is held by the author.
Date Deposited: 15 Feb 2021 13:28
Last Modified: 16 Feb 2021 15:08
Thesis DOI: 10.5525/gla.thesis.82011
URI: http://theses.gla.ac.uk/id/eprint/82011

Actions (login required)

View Item View Item

Downloads

Downloads per month over past year