A code transformation framework for linear algebra operations targeting multiple platforms
Linear algebra is used in many fields of mathematics, natural sciences, computer science, and social science. The researchers in those fields, who are not experienced programmers, may write naive linear algebra codes for their applications. Despite the availability of multiple hardware platforms for...
Saved in:
Main Author: | |
---|---|
Other Authors: | |
Format: | Theses and Dissertations |
Language: | English |
Published: |
2014
|
Subjects: | |
Online Access: | https://hdl.handle.net/10356/61835 |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Nanyang Technological University |
Language: | English |
id |
sg-ntu-dr.10356-61835 |
---|---|
record_format |
dspace |
spelling |
sg-ntu-dr.10356-618352023-03-04T00:49:31Z A code transformation framework for linear algebra operations targeting multiple platforms Tan, Wen Jun Stephen John Turner School of Computer Engineering Parallel and Distributed Computing Centre DRNTU::Engineering::Computer science and engineering::Software::Programming techniques DRNTU::Engineering::Computer science and engineering::Software::Programming languages Linear algebra is used in many fields of mathematics, natural sciences, computer science, and social science. The researchers in those fields, who are not experienced programmers, may write naive linear algebra codes for their applications. Despite the availability of multiple hardware platforms for computation, such as vector processing units, multi-core processors and general-purpose graphics processing units, it is particularly difficult for them to optimize their applications for these platforms. It is necessary to make use of hardware-specific architectural features to fully exploit the capabilities of the underlying hardware. This thesis presents a code transformation framework for assisting users writing naive linear algebra codes to optimize their applications. The code transformation framework recognizes and extracts the linear algebra operations from naive codes. The linear algebra intermediate representation can be expressed in terms of a domain specific language. The user can also write linear algebra kernels using this language directly. Using the intermediate representation, the framework transforms the linear algebra operations to equivalent library calls. There are two possible classes of code generated from the framework: (i) linear algebra template libraries and (ii) BLAS function calls. The linear algebra template libraries present the linear algebra operations in an algebraic form that is easily understandable by the user, and at the same time provides good performance when codes are compiled. It is possible to target multiple platforms through different linear algebra template libraries, such as Eigen and Armadillo. Although C++ template libraries are more intuitive to the user, these template libraries introduce additional overhead due to the library design. Therefore the code transformation framework is extended to generate calls to BLAS for different platforms, such as Intel MKL or Nvidia CUBLAS. We demonstrate that the code transformation framework can result in better performance in the generated codes compared to those which are generated by existing compilers. This is substantiated by experimental results on different hardware platforms, including vector processing units, multi-core processors and graphics processing units. MASTER OF ENGINEERING (SCE) 2014-11-06T01:26:14Z 2014-11-06T01:26:14Z 2014 2014 Thesis Tan, W. J. (2014). A code transformation framework for linear algebra operations targeting multiple platforms. Master’s thesis, Nanyang Technological University, Singapore. https://hdl.handle.net/10356/61835 10.32657/10356/61835 en 116 p. application/pdf |
institution |
Nanyang Technological University |
building |
NTU Library |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
NTU Library |
collection |
DR-NTU |
language |
English |
topic |
DRNTU::Engineering::Computer science and engineering::Software::Programming techniques DRNTU::Engineering::Computer science and engineering::Software::Programming languages |
spellingShingle |
DRNTU::Engineering::Computer science and engineering::Software::Programming techniques DRNTU::Engineering::Computer science and engineering::Software::Programming languages Tan, Wen Jun A code transformation framework for linear algebra operations targeting multiple platforms |
description |
Linear algebra is used in many fields of mathematics, natural sciences, computer science, and social science. The researchers in those fields, who are not experienced programmers, may write naive linear algebra codes for their applications. Despite the availability of multiple hardware platforms for computation, such as vector processing units, multi-core processors and general-purpose graphics processing units, it is particularly difficult for them to optimize their applications for these platforms. It is necessary to make use of hardware-specific architectural features to fully exploit the capabilities of the underlying hardware.
This thesis presents a code transformation framework for assisting users writing naive linear algebra codes to optimize their applications. The code transformation framework recognizes and extracts the linear algebra operations from naive codes. The linear algebra intermediate representation can be expressed in terms of a domain specific language. The user can also write linear algebra kernels using this language directly.
Using the intermediate representation, the framework transforms the linear algebra operations to equivalent library calls. There are two possible classes of code generated from the framework: (i) linear algebra template libraries and (ii) BLAS function calls. The linear algebra template libraries present the linear algebra operations in an algebraic form that is easily understandable by the user, and at the same time provides good performance when codes are compiled. It is possible to target multiple platforms through different linear algebra template libraries, such as Eigen and Armadillo. Although C++ template libraries are more intuitive to the user, these template libraries introduce additional overhead due to the library design. Therefore the code transformation framework is extended to generate calls to BLAS for different platforms, such as Intel MKL or Nvidia CUBLAS.
We demonstrate that the code transformation framework can result in better performance in the generated codes compared to those which are generated by existing compilers. This is substantiated by experimental results on different hardware platforms, including vector processing units, multi-core processors and graphics processing units. |
author2 |
Stephen John Turner |
author_facet |
Stephen John Turner Tan, Wen Jun |
format |
Theses and Dissertations |
author |
Tan, Wen Jun |
author_sort |
Tan, Wen Jun |
title |
A code transformation framework for linear algebra operations targeting multiple platforms |
title_short |
A code transformation framework for linear algebra operations targeting multiple platforms |
title_full |
A code transformation framework for linear algebra operations targeting multiple platforms |
title_fullStr |
A code transformation framework for linear algebra operations targeting multiple platforms |
title_full_unstemmed |
A code transformation framework for linear algebra operations targeting multiple platforms |
title_sort |
code transformation framework for linear algebra operations targeting multiple platforms |
publishDate |
2014 |
url |
https://hdl.handle.net/10356/61835 |
_version_ |
1759858130419712000 |