We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Purely Functional GPU Programming with Futhark

Formale Metadaten

Titel
Purely Functional GPU Programming with Futhark
Serientitel
Anzahl der Teile
611
Autor
Lizenz
CC-Namensnennung 2.0 Belgien:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache
Produktionsjahr2017

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
We present the pure functional array language, Futhark, along with itsoptimising GPU-targeting compiler. Of particular focus are the languagetradeoffs necessary to ensure the ability to efficiently generate high-performance GPU code from a high-level parallel language. We also demonstrate(nested) data-parallel array programming, a programming paradigm that enablesconcise programming of massively parallel systems. We show how Futhark codecan be easily integrated with larger applications written in other language.Finally, we report benchmarks showing that Futhark is able to match theperformance of hand-written code on various published benchmarks. GPUs and other massively parallel systems are now common, yet programming themis often a painful experience. Languages are often low-level and fragile, withcareful hand-optimisation necessary to obtain good performance. The programmeris often forced to write highly coupled code with little modularity. The high-level languages that exist, often functional in nature, are ofteninsufficiently flexible, or poor performes in practice. We present our work ona programming language that seeks a common ground between imperative andfunctional approaches. Futhark is a small programming language designed to be compiled to efficientGPU code. It is a statically typed, data-parallel, and purely functional arraylanguage, and comes with a heavily optimising ahead-of-time compiler thatgenerates GPU code via OpenCL. Futhark is not designed for graphicsprogramming, but instead uses the compute power of the GPU to accelerate data-parallel array computations. We support regular nested data-parallelism, aswell as a form of imperative-style in-place modification of arrays, whilestill preserving the purity of the language via the use of a uniqueness typesystem. The Futhark language and compiler is an ongoing research project. It cancompile nontrivial programs which then run on real GPUs at high speed. TheFuthark compiler employs a set of optimisations (fusion, flattening,distribution, tiling, etc) to shield the programmer from having to know thedetails of the underlying hardware. The Futhark language itself is still veryspartan - due to the basic design criteria requiring the ability to generatehigh-performance GPU code, it takes more effort to support language featuresthat are common in languages with more forgiving compilation targets.Nevertheless, Futhark can already be used for nontrivial programs, and hasbeen used to port several real-world benchmark applications, with performancecomparable to original hand-written GPU (OpenCL or CUDA) code. Futhark is not intended to replace existing general-purpose languages. Ourintended use case is that Futhark is only used for relatively small butcompute-intensive parts of an application. The Futhark compiler generates codethat can be easily integrated with non-Futhark code. For example, you cancompile a Futhark program to a Python module that internally uses PyOpenCL toexecute code on the GPU, yet looks like an ordinary Python module from theoutside.