O'Caml for Numerical Computing
Project Description
In the paper, "Flops to Megaflops", Moreira, et. al enumerate many
reasons why current Java compilers are not able to obtain anywhere near the
level of performance that a C or C++ compiler is able to obtain for matrix
computations. Some of these reasons include,
- Array bounds checks must be performed to ensure that every array access is
legal.
- Many of the primitive arithmetic operations can throw exceptions, and in
order to ensure precise exceptions, the compiler cannot rearrange these
operations without great care.
- Java does not have primitive matrices (only 1-d arrays), and so the
compiler must be able to work with user constructed data structures.
In addition to spelling out these problems, the paper spells out possible
compiler techniques that might be used to overcome them.
Objective Caml (O'Caml) is a dialect of ML that suffers many of the same
defects as Java.
Project Goals
The goal of this project is to implement the Moreira's techniques in the
O'Caml native code compiler and show that a Higher-Order Typed language, like
O'Caml, can be used to generate code for matrix computations thtat is competitive
in performance with commercial C or Fortran compilers.
What you need to do
- Read and understand Moreira's papers.
- Install and understand the O'Caml well enough to make changes to it.
- Implement some set of the transformations discussed in the Moreira papers.
- Design a set of matrix-intensive benchmarks in O'Caml and C or Fortran.
- Evaluate your compiler and a commercial compiler using your benchmarks.
References