GPU-accelerated array computations in Haskell

I just published stable release 0.12 of the embedded array language Accelerate for high-performance GPU computing on Hackage. The release includes example applications, such as a real-time Canny edge detector, a fluid flow simulator, and a quasicrystal animation, as well as example algorithms, such as radixsort, matrix computations, and a Black-Scholes option pricing model.

In the new modularised architecture, the Accelerate release comprises four packages:

  • accelerate (the main package providing the Accelerate language),
  • accelerate-io (conversion operations with other Haskell array libraries, including the data-parallel companion library Repa),
  • accelerate-cuda (backend targetting NVIDIA GPUs via the CUDA SDK), and
  • accelerate-examples (example applications and regression tests).

For more information, see Accelerate on GitHub. To use the CUDA backend, you need a CUDA-enabled NVIDIA GPU as well as having the CUDA SDK already installed.

Filed under  //  accelerate   gpgpu   haskell   parallelism  
Posted

Using the Glasgow Haskell Compiler (GHC) on OS X Lion with Xcode 4.3

Here is what you need to do if you want to use the Glasgow Haskell Compiler (GHC) on OS X Lion with a clean installation of Xcode 4.3.

Command line tools

You need to install the command line tools from Apple. You may do that in two ways (the second is faster as it is a much smaller download):

  1. Install all of Xcode:
    • Install Xcode from the Mac App Store.
    • Launch Xcode.
    • In the Preferences dialog of Xcode, select the "Downloads" pane and install "Command line tools".
  2. Install the command line tools only:

In both cases, you need to register as an Apple developer. (This is a free registration.)

Install GHC 7.4.1 (or later)

Older versions of GHC —including GHC 7.0.4, which is part of the Haskell Platform 2011.4.0.0 (December 2011)— won't work. They complain about not being able to execute '/Developer/usr/bin/gcc'. (You can fix this by modifying GHC's wrapper script as mentioned in the comments.)

Download and install GHC 7.4.1 (or a later version) — or install the Haskell Platform once a 2012 release has been made.

Install Cabal tools (optional)

To facilitate the easy installation of Haskell packages, you should get the cabal-install tool.

  • Download cabal-install-0.14.0.tar.gz
  • Unpack the tarball and, inside the created 'cabal-install-0.14.0' directory, run the following: 'sh bootstrap.sh'

Update: As @zmoazeni points out in the comments, Homebrew has now been updated, so that you can install both GHC and cabal-install version 0.14 by executing

brew install ghc --devel
brew install cabal-install

Using GHC's LLVM backend (optional)

If you like to use GHC's LLVM backend —which is more efficient for array-based and other loop-oriented code— you need to seperately install LLVM. (This is despite the Apple tools being based on LLVM as well.)

  • Install Homebrew (as per the instructions on that webpage).
  • Then, execute the following: 'brew install llvm'

Compiling GHC from the sources in the Git repositories (GHC developers only)

If you plan to work on GHC itself and you need to compile the develeopment version of GHC straight from the Git repositories, you need to install the GNU auto tools as well (which are no longer distributed by Apple).

  • Install Homebrew (as per the instructions on that webpage) — if you didn't do that already to install LLVM above.
  • Then, execute the following: 'brew install autoconf automake'

The GHC Trac has more information on Building and Porting GHC.

Filed under  //  ghc   haskell   lion   mac  
Posted

GPU computing in Haskell: version 0.10 of Data.Array.Accelerate

Accelerate is an embedded language for GPU-accelerated array computations in Haskell that targets NVIDIA's CUDA framework and also has an experimental OpenCL backend (that currently does not support the whole feature set of the language). I just released version 0.10.0.0 of Accelerate. A considerable amount of example code is in the companion package accelerate-examples. The main user-visible changes in this release are frontend bug fixes.

For more information, have a look at Accelerate on GitHub.

Filed under  //  accelerate   gpgpu   haskell  
Posted

Work Efficient Higher-Order Vectorisation

Our new draft paper on Work Efficient Higher-Order Vectorisation introduces a novel representation for nested, irregular parallel arrays that enables the work-efficient SIMD-ification of nested data parallelism — i.e., nested parallelism is transformed into flat parallelism, while maintaining the work complexity of a naive pointer-based representation of nested arrays. This solves a long standing problem that dates back to the original implementation of the language NESL.

Filed under  //  dph   haskell   parallelism   vectorisation  
Posted

Android's Achilles Heel

Marco Arment reports,

Contrast that with Russell Ivanovic's figure for the latest Android OS (Ice Cream Sandwich):

This is not the whole story as Marco's number is for the users of a single app (Instapaper) and I don't know whether Russell's numbers are for the users of Pocket Weather AU and Pocketcasts or generally for the whole Android ecosystem. I still think these numbers are indicative of the state of OS updates in the iOS and Android ecosystems.

Of all the differences between the two ecosystems, this is to me Android's biggest problem. (This assumes that smartphone OS updates will contain many important user-visible changes for some more years.)

Filed under  //  Android   iPhone  
Posted

Released Data.Array.Accelerate 0.9.0.0 — the Haskell array library for GPUs

I just released accelerate 0.9.0.0 on Hackage. This is the version that has been available from the GitHub repository for a while (supporting shape polymorphism, stencil computations, block I/O, and much more), but adapted such that it works with the forthcoming GHC 7.4.1 release. (I tested it with 7.4.1 RC2).

It doesn't yet include Trevor's recent work that improved the CUDA backend in many significant ways — you can get that code from Trevor's fork on GitHub.

For more details, see the main GitHub repository and the GitHub wiki pages.

Filed under  //  accelerate   edsl   gpgpu   parallelism  
Posted

Free, nicely presented textbooks with good distribution

Free, nicely presented textbooks with good distribution have got quite an appeal.

Filed under  //  ibooks  
Posted

Unix wins

We are witnessing the transition from Windows on Intel to Unix on (mostly) ARM. It is a testament to the flexibility of the design that a system originally designed for mainframes achieves mass market appeal on resource-constrained mobile systems.

http://twitpic.com/87bt3s

Filed under  //  unix  
Posted

Video and slides of "Data Parallelism in Haskell" @ Brisbane FP Group

The Brisbane FP Group (BFPG) kindly invited me to give a talk about our work on data parallel programming in Haskell. The talk motivates the use of functional programming for parallel, and in particular, data parallel programming and explains the difference between regular and irregular (or nested) data parallelism. It also discusses the Repa library (regular data parallelism for multicore CPUs), the embedded language Accelerate (regular data parallelism for GPUs), and Data Parallel Haskell (nested data parallelism for multicore CPUs).  The slides of the presentation are available in two formats: HTML5 slideshow and PDF. Thank you to everybody who attended. Special thanks go to OJ Reeves and Tony Morris for organising everything, to Rob Manthey for producing the video, to Mincom for the venue, and to Functional IO for the sponsorship.

Filed under  //  accelerate   dph   haskell   parallelism   repa  
Posted

Data.Array.Accelerate now on GitHub

Prompted by GHC's move to Git and the unreliability of the community.haskell.org infrastructure, I decided to move Data.Array.Accelerate to GitHub: mchakravarty/accelerate. The GitHub repository is now the main public repository for the project. I will also move the tickets of the old Trac bug tracker over to GitHub Issues.

Filed under  //  edsl   gpgpu   haskell   parallelism  
Posted