Just Testing RSS

Random ramblings by me.

Archive

May
14th
Mon
permalink

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).

Posted via email from Just Testing | Comment »

Apr
21st
Sat
permalink

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’.

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

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.

Posted via email from Just Testing | Comment »

Apr
12th
Thu
permalink

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.

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

Posted via email from Just Testing | Comment »

Mar
24th
Sat
permalink

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.

Posted via email from Just Testing | Comment »

Mar
12th
Mon
permalink

Seminar by Peter Thiemann on “A Calculus for Gradual Access Control”

We are having the pleasure to host Peter Thiemann from the University of Freiburg at UNSW at the moment. His many contributions span the areas of functional programming, type systems, static analysis, program specialisation, and web programming.

Coming Monday (19 March), Peter will give a presentation at the School of Computer Science and Engineering (CSE) of the University of New South Wales. The details are as follows.

 

Time: 19 March 2012 (Friday), 11AM

Location: CSE Seminar room (K17_113), Level 1, CSE Building (K17)

Title: A Calculus for Gradual Access Control

Speaker: Peter Thiemann (University of Freiburg, Germany)

Abstract

 

Many client-side Web applications are composed of script fragments that are independently downloaded from the Web. A recurring problem in that scenario is the need to impose an access control policy on the execution of a downloaded script. No script should be able to compromise the state of the base application, that is, it should neither access nor change sensitive data, which can be private data of the application, sensitive state of the browser, or a part of the DOM that is not explicitly assigned to it.

To address this situation, we want to construct a browser-embedded facility that regulates access control according to directives in a trusted program fragment. The calculus for gradual access control is the foundation of this facility. It incorporates a component that performs dynamic access control according to the directives. It also incorporates a static component that enables the system to omit the dynamic checks if it can prove them unnecessary. The two components are tightly connected by a gradual typing approach.

Bio

 

Peter Thiemann obtained his diploma in computer science in 1987 at the Technical University of Aachen, Germany. He graduated in 1991 at the University of Tübingen, Germany, where worked as a research and teaching assistent until 1997. In 1998, he was a lecturer in Computer Science at the University of Nottingham, England. Since 1999 he is a professor at the computer science department of the University of Freiburg, Germany, where he leads the programming languages group.

His research interests comprise theory and practice of modern programming languages, in particular program analysis, compiler construction, and program specialization for functional programming languages. The focus of his current research is static and dynamic program analysis for scripting languages.

Posted via email from PLS @ UNSW | Comment »

Feb
2nd
Thu
permalink

The n-body problem and vectorisation of nested data parallelism in the face of shared data structures

Last year, we spent a lot of energy on reducing the memory consumption of vectorised Data Parallel Haskell (DPH) programs that use large shared data structures. This work was driven by an implementation of the Barnes-Hut algorithm in DPH. Ben produced an illustrative video animating an n-body simulation with his Gloss library. The video is part of his blog article Vectorisation without Replication in Data Parallel Haskell, where he explains the performance of our new DPH array library in comparison to our old library and a purely sequential implementation of Barnes-Hut based on Data.Vector.
If you are interested in how vectorisation works, what the problem with shared data structures is, and how we are solving that problem, you may like to have a look at the slides of a talk that I gave in Copenhagen end of last year. It is available in two formats: HTML5 slideshow & PDF.

Posted via email from PLS @ UNSW | Comment »

Feb
1st
Wed
permalink

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.

Posted via email from Just Testing | Comment »

Jan
27th
Fri
permalink

Free, nicely presented textbooks with good distribution

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

Posted via email from Just Testing | Comment »

Nov
21st
Mon
permalink

Seminar by John Hughes & Simon Peyton Jones @ UNSW

As part of YOW! 2011 (the Australian Software Developer Conference), Simon Peyton Jones and John Hughes will be in Sydney on the 7th and 8th of December 2011. On the evening of the 7th, they will appear at the YOW! Night Sydney.

On Thursday (8 December), John and Simon will give two presentations at the School of Computer Science and Engineering (CSE) of the University of New South Wales. The details are as follows.

Time: 8 December 2011, 10AM

Location: CSE Seminar room (K17_113), Level 1, CSE Building (K17)

 

Talk #1

Title: Accelerating race condition detection through procrastination

Speaker: John Hughes (Chalmers University & Quviq AB)

Abstract

Race conditions are notoriously frustrating to find, and good tools can help. The main difficulty is reliably provoking the race condition. In previous work we presented a randomising scheduler for Erlang that helps with this task.

In a language without pervasive shared mutable state, such as Erlang, performing scheduling decisions at random uncovers race conditions surprisingly well. However, it is not always enough. We describe a technique, procrastination, that aims to provoke race conditions more often than by random scheduling alone. It works by running the program and looking for pairs of events that might interfere, such as two message sends to the same process. Having found such a pair of events, we re-run the program but try to provoke a race condition by reversing the order of the two events.

We apply our technique to a piece of industrial Erlang code. Compared to random scheduling alone, procrastination allows us to find minimal failing test cases more reliably and more quickly.

John Hughes

John Hughes has worked with functional programming since 1980, was one of the designers of Haskell, and has been heavily involved with Erlang in recent years. In 2000 he and Koen Claessen published the first version of QuickCheck, a software testing tool which recently won the ACM SIGPLAN award for Most Influential Paper from ICFP in that year. He has focussed more and more on testing since then, co-founding Quviq AB in 2006 to market a commercial version of QuickCheck. He is currently both a Professor at Chalmers University, Sweden, and CEO of Quviq AB.

Talk #2

Title: Termination Combinators Forever

Speaker: Simon Peyton Jones (Microsoft Research)

Abstract

Nobody wants their compiler, or theorem prover, to go into an infinite loop, but making sure that never happens usually means applying some over-conservative heuristic like “never unfold a recursive function”. Approaches like that don’t work at all when you are doing partial evaluation or supercompilation, which fundamentally depend on inlining recursive functions. 

What we need is an online termination test. That is easier said than done; it is easy to make a mistake. In this talk I’ll describe a new combinator library that lets you build complex termination tests by combining simpler ones, while guaranteeing that that the result really is a termination test. The library elegantly encapsulates some clever mathematical ideas on well-quasi orders the cunning details are hidden from the customer.

I’ll use Haskell as the language of exposition, but you don’t need to be a Haskell guru to understand it, and the library would work equally well in other languages.

Simon Peyton Jones

Simon Peyton Jones, MA, MBCS, CEng, graduated from Trinity College Cambridge in 1980. After two years in industry, he spent seven years as a lecturer at University College London, and nine years as a professor at Glasgow University, before moving to Microsoft Research (Cambridge) in 1998.

His main research interest is in functional programming languages, their implementation, and their application. He has led a succession of research projects focused around the design and implementation of production-quality functional-language systems for both uniprocessors and parallel machines. He was a key contributor to the design of the now-standard functional language Haskell, and is the lead designer of the widely-used Glasgow Haskell Compiler (GHC). He has written two textbooks about the implementation of functional languages.

More generally, he is interested in language design, rich type systems, software component architectures, compiler technology, code generation, runtime systems, virtual machines, and garbage collection. He is particularly motivated by direct use of principled theory to practical language design and implementation — that’s one reason he loves functional programming so much.

Posted via email from PLS @ UNSW | Comment »

Sep
3rd
Sat
permalink

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

Video @ vimeo

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.

Posted via email from Just Testing | Comment »