Futhark Language Can Generate C and/or Python Code

Researchers at the University of Copenhagen’s Department of Computer Science has officially released and shown off their new functional programming language called Futhark. This new programming language, which is free and open source, is designed to run on a GPU for machine learning and other high performance applications.

The commo method for GPU programming involves using frameworks like OpenCL or CUDA, both which are variations of C or C++. Furthark can generate C code, but it is actually its own language. You can relate this new language to Haskell (Furthark is written in Haskell).

The language developers claim that the more expressive a language will make it easier to describe complex operations that use parallelism. This includes the support for nested parallelizations (parallel operations inside other parallel operations).

The Futhark Developers stated:

Futhark can do this despite the complexities of efficiently mapping to the flat parallelism supported by hardware, as a great many programs depend on this feature.

Futhark GPU programs were put to the test. They were put against other GPU libraries showed mixed, but some pretty promising results. For the maximum segment sum test, it matched or was only slightly slower than the competition. The developers thought that this was attributed to the newness of the language and the unrefined results for memory usage and allocation.

The current toolchain can generate code capable of running on the CPU or GPU, with a good variety of targets. For the former, it will generate C code compiled by the CGG; for the later it will compile C code that uses the OpenCL platform. This will allow the code to run on whichever hardware is available to support it.

For the Python developers and coders who want a speed boost, they will be able to generate code with Futhark wrapped in a Python module. This code will run via PyOpenCL, which is a library that interfaces with GPUs. There are examples of this, such as a Futhark-driven GPU implementation of Conway’s Game of Life.

Please remember with reading this article, Futhark is still currently a research project, it is not as polished or complete as other languages. The current documention is incomplete, but both docs and language are open source on GitHub

Advertisements


Categories: Programming

Tags: , , , , ,

%d bloggers like this: