HTTPS SSH

FastR-GPU Compiler

This is a fork of FastR with GPU support. The GPU backend is an extension of GraalVM and Graal Compiler with OpenCL code generation and data management for GPU computing.

The goal of the FastR-GPU compiler is to automatically execute R expressions on the GPU. It extends Truffle, Graal and a GPU backend for Graal (Marawacc) for compiling an R program into OpenCL. It profiles and specialises R input programs to OpenCL using the Graal Partial Evaluator and compiles the resulting intermediate representation to OpenCL at runtime. This project is a research prototype.

Example

> marawacc.deviceInfo()
NAME             : Hawaii
VENDOR           : Advanced Micro Devices, Inc.
TYPE             : GPU
DRIVER           : 1598.5 (VM)
MAX COMPUTE UNITS: 44
MAX FREQUENCY    : 1030
GLOBAL MEMORY    : 3221225472
LOCAL  MEMORY    : 32768
ENDIANESS        : LITTLE_ENDIAN


> marawacc.init()
> size <- 100000
> # It is executed on the GPU when the R program is JIT by Graal
> mapply(function(x, y) x * y, runif(size), runif(size)) 

Installation

Get mx tool:

mkdir mx
hg clone https://bitbucket.org/allr/mx

Create source file:

export PATH=/path/to/mx/mx/:$PATH
export JAVA_HOME=/path/to/jdk1.8x/
export DEFAULT_VM="jvmci"

OpenCL R JIT compiler:

$ mkdir fastr-gpu
$ cd fastr-gpu
$ mx clone ssh://hg@bitbucket.org/juanfumero/fastr-gpu
$ cd fastr-gpu
$ make 

Make will download all the dependencies. For updating the repository:

#!/bin/bash 

$ mx sforceimports
$ make

Eclipse

To generate the Eclipse files:

$ make eclipse 

Then import the projects into eclipse

Note

This compiler has been tested on Linux Fedora 21/22/23, CentOS 7.4 and OpenSuse 13 with OpenJDK >= 1.8_61. Current implementation with JDK 8 u91.

Publications

License

GPL V2

Who do I talk to?

This project is a research prototype implemented at The University of Edinburgh. The project was partially funded by Oracle Labs.

Main Developer

Juan Fumero < juan.fumero @ ed.ac.uk >

Advisors

Christophe Dubach < christophe.dubach @ ed.ac.uk >
Michel Steuwer < michel.steuwer @ ed.ac.uk >
Lukas Stadler < lukas.stadler @ oracle.com >

FastR

FastR is an implementation of the R Language in Java atop Truffle and Graal. Truffle is a framework for building self-optimizing AST interpreters. Graal is a dynamic compiler that is used to generate efficient machine code from partially evaluated Truffle ASTs.

FastR is an open-source effort of Purdue University, Johannes Kepler University Linz, and Oracle Labs.

For more details and instructions for downloading and building the system, please visit the FastR Wiki.