Performance Effort expected actual desired After expressing available parallelism, I often find that the code has slowed down. — Jeff Larkin, NVIDIA Developer Technology https://devblogs.nvidia.com/getting-started-openacc/
Why is this difficult? Concurrency Multiple interleaved threads of control All threads have effects on the world Non-determinism and concurrency control
Data parallelism Instead of unrestricted concurrency, let’s simplify The same operation is applied to different data abstracts over concurrency control abstracts over indeterminism great for developers and hardware
Accelerate Haskell/Accelerate program Target code Compile and run on the CPU/GPU Copy result back to Haskell Reify and optimise Accelerate program An embedded language for data-parallel arrays
Computers are good at operating on bulk data, not on single elements Restrictions can guide the programmer into writing an efficient parallel program Parallel programming and functional programming are a natural fit Thinking in parallel
Motivating examples validate and test your ideas improve performance what is good about this, what is bad about it? as a basis for future work Can we take what’s good as a seed and make it into something that is better?
Sequence of abstraction Machine language Assembly language Fortran / C / C++ C# / Haskell / Javascript “I am working at a higher level; being smart, saving effort!”
Loss of capability Can no longer program in assembly Don’t know how values are stored in memory Don’t know what the CPU is doing The rhetoric is “I shouldn’t have to” but the flip side is the loss of ability to
Functional high-performance computing Real-world examples as a laboratory to develop: new features, test performance, … Working at a high level is good but this also entails a loss of capability Reality exists at the low level
Functional high-performance computing Functional programming languages provides the right set of abstractions Instead of: climbing the tower of abstraction Better idea?: feet on the ground; reach for the heavens
acceleratehs.org https://github.com/AccelerateHS/ Trevor L. McDonell Robert Clifton-Everest Manuel M. T. Chakravarty Josh Meredith Gabriele Keller Ben Lippmeier
Image attribution Logo designed by Tina Lam http://instagram.com/tinabarbarina https://en.wikipedia.org/wiki/Waterman_butterfly_projection https://www.instagram.com/p/BbTjiebnaw1 http://book.realworldhaskell.org/read/profiling-and-optimization.html https://researchinprogress.tumblr.com/post/34088637501/fast-vs-exact-solutions https://researchinprogress.tumblr.com/post/34627563943/when-somebody-mixes-up-causality-and-correlation https://researchinprogress.tumblr.com/post/32886698944/how-is-your-research-useful https://en.wikipedia.org/wiki/Tower_of_Babel https://www.art.com/products/p46922818644-sa-i10543606/paul-souders-polar-bear-swimming-past-melting-iceberg-near- harbor-islands-canada.htm http://unseasonably.blogspot.com/2014/03/a-tangled-ball-of-yarn.html https://www.reddit.com/r/aww/comments/2oagj8/multithreaded_programming_theory_and_practice/