McLab Projects

Analysis Tools

  • McSAF

    In order for a compiler to perform optimizations or to provide feedback to programmers, it must analyze the program source code. Making such analyses easier to write requires a simple, well-defined Intermediate Representation (IR) and analysis framework. This framework should also allow new language extensions to use and adapt existing analyses. In spite of MATLAB’s popularity, and the apparent need for static analysis, there has been no publicly available framework for creating static analyses for the M ATLAB programming language. The McLAB Static Analysis Framework, or McSAF is such a framework. McSAF was created as part of the Mc L AB project to satisfy these requirements. The goal of the framework is to make new analyses easy to write and easy to extend to new language features.

  • Tamer

    Our open source toolkit, called the MATLAB Tamer, targets a large subset of MATLAB. Given information about the entry point of the program, the MATLAB Tamer builds a complete callgraph, transforms every function into a reduced intermediate representation, and provides typing information to aid the generation of static code.

  • Tamer+

    An extension to Tamer that reverses TamerIR to a high-level, human-readable representation.

  • McFlat

    We apply 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 transformation. This project is no longer maintained.

Static Compilers

  • VeloCty

    VeloCty is a tool for enhancing the performance of scientific languages by selectively compiling hot sections of the code to parallel C++.

  • AspectMatlab

    Our aim is to bring aspect-oriented features in a way that is both accessible to scientists and where the aspect-oriented features concentrate on array accesses and loops, the core computation elements in scientific programs.

  • MiX10

    MiX10 (a recursive acronym for Mix10 Isn't X10) is an open MATLAB compiler that ports MATLAB programs for efficient execution on high performance computing systems by translating them to IBM's new-age high performance computing languge, X10, which in turn compiles to more commonly used languages, C++ and Java.

  • Mc2For

    A new and improved MATLAB to Fortran 95 Compiler using McSAF and Tamer.

  • McCli

    A compiler that compilers MATLAB to .NET bytecode. This project is no longer maintained.

  • McFor

    The MATLAB-to-Fortran 95 compiler, McFor, is designed to translate MATLAB programs that are focussed on scientific computations to efficient and reusable Fortran code. This project has been superseded by Mc2For.

JIT Compilers

  • McVM & McJIT

    The McVM virtual machine currently integrates an interpreter and an optimizing JIT compiler called McJIT supporting a non-trivial subset of the MATLAB programming language. The primary objective of this project is to serve as a platform to help researchers explore both static and dynamic optimization techniques for dynamic scientific languages. A secondary objective of the project is to make McVM a viable alternative implementation of the language for those who use MATLAB for scientific computing.

  • McOSR

    On-stack replacement (OSR) is a technique that allows a virtual machine to interrupt running code during the execution of a function/method, to re-optimize the function on-the-fly using an optimizing JIT compiler, and then to resume the interrupted function at the point and state at which it was interrupted. OSR is particularly useful for programs with potentially long-running loops, as it allows dynamic optimization of those loops as soon as they become hot.

JavaScript, Web and Distributed Scientific Computing

  • McNumJS

    McNumJS is a high-performance JavaScript library for numerical computations which provides an easy-to-use API like NumPy. McNumJS makes use of TypedArrays which provide a mechanism for accessing data much more efficiently. McNumJS uses implicitly typed objects specified by asm.js so that modern javascript engines can optimize the code more efficiently and provide higher performance. Compiler writers who target javascript language and other web developers or scientists can make use of this library for numeric computations on the web.

  • Pando

    The goal of the Pando project is to show that idle computing resources in end-user general purpose computers can be efficiently and securely leveraged for large-scale numerical computing through a web browser using a high-level dynamic array-oriented language, such as MATLAB.

  • Ostrich Benchmark Suite

    Ostrich is a benchmark suite developed in the Sable Lab at McGill University with the objective of studying the performance of JavaScript and WebCL for numerical code. Version of the benchmarks are available in C/C++, JavaScript, OpenCL and WebCL.

Parallel Scientific Computing

  • Velociraptor

    Velociraptor is a compiler toolkit consisting of a code generation library as well as a runtime system. It takes as input a high-level IR called Velociraptor IR (VRIR for short) that is designed to accomodate array semantics of many different languages. VRIR is a typed AST based representation that is easy to generate, and has built-in operators for many high-level array operations (like matrix multiplication), flexible array indexing schemes, and array layouts. Velociraptor generates LLVM for CPUs and OpenCL for GPUs, making it portable across many different systems. Velociraptor is accompanied by its intelligent runtime system, that is designed for maximizing throughput in hybrid systems by doing operations in parallel and by minimizing redundant data transfers.

  • RaijinCL

    RaijinCL is a high-performance, portable libary for implementing many matrix operations on the GPU such as matrix multiplication and reductions. It is difficult to write a single OpenCL code that works well everywhere. Therefore, RaijinCL does autotuning, a process where it tests hundreds of different versions of important functions and records the best one found on a user's machine. Initial results are encouraging, and we are able to match the performance of vendor libraries on some systems, and deliver good performance everywhere. RaijinCL currently consists of GEMM-inspired (GEMM = general matrix multiply) routines, reduction routines for calulating sum and product of elements of multidimensional arrays along a particular axis as well as several element-wise operations on strided multidimensional arrays. We are also looking into more routines such as matrix decomposition.

Programmer Tools

  • McIDE

    McIDE is a browser-based IDE for MATLAB, with support for refactorings, code navigation, and various checks and warnings, all backed by a mix of static and dynamic analysis.