12767

Enhancing R with Advanced Compilation Tools and Methods

Duncan Temple Lang
Department of Statistics, University of California at Davis, 4210 Math Sciences Building, Davis, California, 95616, USA
arXiv:1409.3144 [stat.CO], (9 Sep 2014)

@article{2014arXiv1409.3144T,

   author={Temple Lang}, D.},

   title={"{Enhancing R with Advanced Compilation Tools and Methods}"},

   journal={ArXiv e-prints},

   archivePrefix={"arXiv"},

   eprint={1409.3144},

   primaryClass={"stat.CO"},

   keywords={Statistics – Computation, Computer Science – Mathematical Software},

   year={2014},

   month={sep},

   adsurl={http://adsabs.harvard.edu/abs/2014arXiv1409.3144T},

   adsnote={Provided by the SAO/NASA Astrophysics Data System}

}

I describe an approach to compiling common idioms in R code directly to native machine code and illustrate it with several examples. Not only can this yield significant performance gains, but it allows us to use new approaches to computing in R. Importantly, the compilation requires no changes to R itself, but is done entirely via R packages. This allows others to experiment with different compilation strategies and even to define new domain-specific languages within R. We use the Low-Level Virtual Machine (LLVM) compiler toolkit to create the native code and perform sophisticated optimizations on the code. By adopting this widely used software within R, we leverage its ability to generate code for different platforms such as CPUs and GPUs, and will continue to benefit from its ongoing development. This approach potentially allows us to develop high-level R code that is also fast, that can be compiled to work with different data representations and sources, and that could even be run outside of R. The approach aims to both provide a compiler for a limited subset of the R language and also to enable R programmers to write other compilers. This is another approach to help us write high-level descriptions of what we want to compute, not how.
No votes yet.
Please wait...

* * *

* * *

HGPU group © 2010-2024 hgpu.org

All rights belong to the respective authors

Contact us: