McFLAT: A Profile-Based Framework for MATLAB Loop Analysis and Transformations [chapter]

Amina Aslam, Laurie Hendren
2011 Lecture Notes in Computer Science  
Parallelization and optimization of the MATLAB ® programming language presents several challenges due to the dynamic nature of MATLAB. Since MATLAB does not have static type declarations, neither the shape and size of arrays, nor the loop bounds are known at compile-time. This means that many standard array dependence tests and associated transformations cannot be applied straight-forwardly. On the other hand, many MATLAB programs operate on arrays using loops and thus are ideal candidates for
more » ... oop transformations and possibly loop vectorization/parallelization. This thesis presents a new framework, McFLAT, which uses profile-based training runs to determine likely loop-bounds ranges for which specialized versions of the loops may be generated. The main idea is to collect information about observed loop bounds and hot loops using training data which is then used to heuristically decide upon which loops and which ranges are worth specializing using a variety of loop transformations. Our McFLAT framework has been implemented as part of the McLAB extensible compiler toolkit. Currently, McFLAT is used to automatically transform ordinary MATLAB code into specialized MATLAB code with transformations applied to it. This specialized code can be executed on any MATLAB system, and we report results for four execution engines, Mathwork's proprietary MATLAB system, the GNU Octave open-source interpreter, McLAB's McVM interpreter and the McVM JIT. For several benchmarks, we observed significant speedups for the specialized versions, and noted that loop transformations had different impacts depending on the loop range and execution engine. This thesis reports on the design and implementation of McFLAT, a framework that is designed to study the effect of various loop transformations on different loop-bound ranges i by introducing loop-level specializations in MATLAB programs. ii I would like to thank all the members of the McLAB team for providing the basis which McFLAT uses.
doi:10.1007/978-3-642-19595-2_1 fatcat:hrmratvvvjdyjmcvftzd6tceru