Domain-specific languages to Manycore and GPU: Building High-Performance Tools with Python
A tutorial on Domain-Specific Languages
This tutorial teaches you:
- how to define mathematically-oriented domain-specific languages ("DSLs") in Python
- how to build transformations for your DSLs to take them from abstraction to implementation
- how to generate highly efficient code from your domain-specific language
- how to use just-in-time compilation with OpenCL from Python to execute generated code
- a few existing design studies and use cases for domain-specific languages
- how to use loopy to generate highly efficient code to work with array data targeting heterogeneous processor architectures (CPUs/GPUs)
The tutorial also includes a brief introductory section to familiarize you with the Python and numpy syntax.
Virtual machine image
A virtual machine image is available that has all the necessary tools installed, to allow for easy experimentation. Follow these instructions to get started:
Download a version of VirtualBox suitable for your system and install it:
Download the machine image itself:
(Optionally) Check whether the image downloaded correctly using the md5sum command line tool (Linux/OS X). On Windows, use this tool:
Compare the computed checksum with the following value: 6aa97e046293f8811d1749ab046f7f61
Only proceed once the two match. If they don't, delete the file and retry the download.
Open VirtualBox, click "File > Import Appliance", select the downloaded image and just click "Next" a few times. Once imported, double-click on the virtual machine to make sure it starts. After a little while, you should see a simple desktop environment.
Once all these steps complete successfully, congratulations! You are good to go. I'm looking forward to seeing you at the tutorial.
Double-click the "Terminal" symbol on the desktop and enter:
curl -L https://bit.ly/sc15-dsl | bash
This will download these materials onto the virtual machine and put them into a subdirectory called
sc15-tutorial-materials. Next, type:
to launch a browser-based interface and get started.
The tutorial demonstrates the use of the following pieces of software:
- Python: https://www.python.org
- numpy: https://www.numpy.org
- pymbolic: https://github.com/inducer/pymbolic
- PyOpenCL: https://github.com/pyopencl/pyopencl
- loopy: https://github.com/inducer/loopy
- matplotlib: http://www.matplotlib.org
- mako: http://www.makotemplates.org
- cgen: https://github.com/inducer/cgen
All open-source under MIT/BSD licenses.
Copyright 2015 Andreas Kloeckner
Materials are available for use under a Creative Commons CC-BY license. See
LICENSE for details. (I.e. by and large: retain authorship
information, and otherwise do what you want)