Ben Lippmeier

Share

Haskeller & creator of Repa library
benl.ouroborus.net

Ben Lippmeier is building an analytic database based on Repa Flow for a recently started startup. In previous incarnations he was working with the Hadoop at the Commonwealth Bank of Australia (CBA), on Data Parallel Haskell at the University of New South Wales (UNSW), and teaching programming language theory at University of Sydney (USyd). Other projects include the Gloss graphics library for Haskell, and the Disciplined Disciple research compiler. Ben’s mind is empty, believing nothing in particular, least of all anyone’s favourite paradigm.

YOW! Lambda Jam 2013 Brisbane

Practical Parallel Array Fusion with Repa

TALK –  VIEW SLIDES WATCH VIDEO

Array fusion is an approach to writing numerical code that allows the program to be written in terms of high-level bulk array combinators (map, fold, filter etc) but then compiled down to efficient object code. If done correctly, the resulting code can run as fast as hand written loops expressed in imperative languages. Repa-style array fusion is one method that also provides parallel evaluation without the programmer needing to write anything extra to enable it. In effect, array fusion converts the program you want to write into the one you want to run. I’ll discuss how Repa-style array fusion works, covering enough technical detail so that client programmers can reliably get good performance out of their own programs. I’ll also discuss the limitations inherent in the fusion model, to give a feel for how much performance can reasonably be expected.


Practical Parallel Array Fusion with Repa

WORKSHOP –  VIEW SLIDES

This workshop will elaborate on the technical details of Repa-style array fusion. The fusion method depends on general purpose optimising code transforms performed by the Glasgow Haskell Compiler (GHC). I’ll briefly cover the structure of GHC itself, give an overview of GHC’s main intermediate representation (GHC Core), and discuss the transforms applied to it. I’ll work though the development of several Repa programs, starting with naive Haskell implementations using lists, and converting them to efficient array programs that run in parallel. I’ll show how to benchmark the original and optimised programs effectively, using the GHC runtime system command-line interface and the ThreadScope tool. I’ll demonstrate how to extract a readable dump of the intermediate GHC core program, and show how to identify performance problems in this intermediate code. Finally, I’ll compare the x86 assembly code produced via fusion with that of equivalent code produced via hand written C, and touch on interactions with the GHC optimiser and LLVM, which GHC uses for back-end code generation.

This workshop can be enjoyed non-interactively, but those that wish to follow along should have a working copy of GHC (preferably 7.6.2), LLVM, and gloss-examples from Hackage. Also use “cabal unpack gloss-examples” to get the source for this package. Installing gloss-examples will install the current Repa library as a dependency.