ePrints@IIScePrints@IISc Home | About | Browse | Latest Additions | Advanced Search | Contact | Help

Automatic Compilation of MATLAB Programs for Synergistic Execution on Heterogeneous Processors

Prasad, Ashwin and Anantpur, Jayvant and Govindarajan, R (2011) Automatic Compilation of MATLAB Programs for Synergistic Execution on Heterogeneous Processors. In: ACM Sigplan Notices, 46 (6). pp. 152-163.

[img] PDF
Automatic.pdf - Published Version
Restricted to Registered users only

Download (1MB) | Request a copy
Official URL: http://dl.acm.org/citation.cfm?id=1993517

Abstract

MATLAB is an array language, initially popular for rapid prototyping, but is now being increasingly used to develop production code for numerical and scientific applications. Typical MATLAB programs have abundant data parallelism. These programs also have control flow dominated scalar regions that have an impact on the program's execution time. Today's computer systems have tremendous computing power in the form of traditional CPU cores and throughput oriented accelerators such as graphics processing units(GPUs). Thus, an approach that maps the control flow dominated regions to the CPU and the data parallel regions to the GPU can significantly improve program performance. In this paper, we present the design and implementation of MEGHA, a compiler that automatically compiles MATLAB programs to enable synergistic execution on heterogeneous processors. Our solution is fully automated and does not require programmer input for identifying data parallel regions. We propose a set of compiler optimizations tailored for MATLAB. Our compiler identifies data parallel regions of the program and composes them into kernels. The problem of combining statements into kernels is formulated as a constrained graph clustering problem. Heuristics are presented to map identified kernels to either the CPU or GPU so that kernel execution on the CPU and the GPU happens synergistically and the amount of data transfer needed is minimized. In order to ensure required data movement for dependencies across basic blocks, we propose a data flow analysis and edge splitting strategy. Thus our compiler automatically handles composition of kernels, mapping of kernels to CPU and GPU, scheduling and insertion of required data transfer. The proposed compiler was implemented and experimental evaluation using a set of MATLAB benchmarks shows that our approach achieves a geometric mean speedup of 19.8X for data parallel benchmarks over native execution of MATLAB.

Item Type: Journal Article
Publication: ACM Sigplan Notices
Publisher: Association for Computing Machinery
Additional Information: Copyright of this article belongs to Association for Computing Machinery.
Keywords: Algorithms;Languages;Performance
Department/Centre: Division of Interdisciplinary Sciences > Supercomputer Education & Research Centre
Date Deposited: 28 Sep 2011 11:24
Last Modified: 28 Sep 2011 11:24
URI: http://eprints.iisc.ac.in/id/eprint/40788

Actions (login required)

View Item View Item