Spiral
A domain-specific language and program-generation system from Carnegie Mellon that expresses signal-processing transforms as mathematical formulas and automatically synthesizes high-performance, platform-tuned code.
Created by The SPIRAL project at Carnegie Mellon University (led by Markus Püschel and José M. F. Moura, with Jeremy Johnson, David Padua, Manuela Veloso, and later Franz Franchetti)
Spiral (usually written SPIRAL) is a domain-specific language and program-generation system developed at Carnegie Mellon University for the performance-critical domain of digital signal processing (DSP) transforms. Rather than being a language programmers use to write applications, SPIRAL is a system in which an algorithm — such as the Fast Fourier Transform (FFT) — is expressed as a concise mathematical formula, and the system automatically searches for and generates highly optimized, platform-tuned C, Fortran, or vectorized code. It is one of the defining examples of autotuning: treating the production of fast code as a search-and-optimization problem rather than a hand-coding task.
History & Origins
SPIRAL began in mid-1998 at Carnegie Mellon as a DARPA-funded research effort. The founding group brought together signal-processing and computer-architecture expertise (José M. F. Moura), symbolic and algorithmic work on transforms (Jeremy Johnson and Robert W. Johnson), compiler and language expertise (David Padua), machine learning for search (Manuela Veloso), high-performance computing (Viktor Prasanna), and, centrally, Markus Püschel, who became one of the project’s principal architects. Franz Franchetti later drove much of the work on vectorization, parallelism, and the generalized framework.
The motivation was a persistent problem in numerical computing: libraries like the FFT must be re-tuned for every new processor, and hand-optimizing them is slow, error-prone, and quickly obsolete as hardware changes. A contemporary and independent project, FFTW (from MIT, also 1998), attacked the same problem for the FFT specifically. SPIRAL took a broader, more formal route grounded in the mathematics of the transforms themselves.
Although the metadata year for Spiral is sometimes given as 2005, that date reflects the project’s most-cited publication — the Proceedings of the IEEE survey “SPIRAL: Code Generation for DSP Transforms” (February 2005) — rather than its first appearance. The SPL language was published in 2001 and the project itself dates to 1998.
Design Philosophy
SPIRAL’s core idea is that a DSP transform is best described not as a program but as a mathematical object, and that many valid algorithms for computing that transform can be derived by rewriting its formula. From this, SPIRAL builds a pipeline:
- Specify the transform (e.g., a discrete Fourier transform of a given size) in a high-level, declarative form.
- Apply breakdown rules — algebraic identities, most famously the Kronecker (tensor) product decomposition underlying the Cooley–Tukey FFT — to expand the transform into a large space of equivalent formulas.
- Search that space, combined with implementation choices (loop structure, unrolling, vectorization), guided by feedback from actually measuring the generated code’s performance on the target machine.
- Emit optimized code in C or Fortran, optionally using SIMD instruction sets or targeting parallel and GPU backends.
This “formula → code” translation is what makes SPIRAL a language system rather than merely a library: the formulas are a real notation with a compiler.
Key Features
- SPL (Signal Processing Language). The original SPIRAL language expresses transforms and their algorithms as formulas built from matrices, the Kronecker product, and composition. An SPL program is a declarative description of a computation, not a sequence of imperative statements. The SPL compiler translates these formulas into C or Fortran.
- Σ-SPL. An intermediate layer that makes loops and index mappings explicit, enabling loop-level optimizations before final code generation.
- Operator Language (OL). Introduced in 2009, OL generalizes SPL from linear transforms to a wider class of numerical kernels, describing computations as operators that can have multiple inputs and nonlinear behavior.
- Feedback-driven search. SPIRAL treats tuning as an optimization problem, exploring the degrees of freedom in both the algorithm and the code, and using empirical timing (and, historically, machine-learning techniques) to converge on fast implementations.
- Platform adaptation. Generated code can exploit vendor-specific vector instructions (for example, SSE-family instructions on x86 or AltiVec on PowerPC), and later work extended generation to multicore and CUDA GPU targets.
A simplified sense of the SPL style — expressing a transform via a tensor-product breakdown rather than as loops — looks conceptually like:
; A radix-based breakdown of a DFT of size n = k*m
DFT(n) -> (DFT(k) tensor I(m)) * T(n,m) * (I(k) tensor DFT(m)) * L(n,k)
Here the transform on the left is rewritten into a composition of smaller transforms, twiddle-factor and permutation matrices — an algebraic identity the system can apply recursively and then compile.
Evolution
SPIRAL’s trajectory tracks the broadening of its ambitions:
| Era | Development |
|---|---|
| 1998 | Project founded at CMU (DARPA-funded), focused on linear DSP transforms |
| 2001 | SPL language and compiler formalized (PLDI) |
| 2004–2005 | Comprehensive descriptions published; feedback-driven generation matured |
| ~2009 | Operator Language (OL) generalizes the approach beyond linear transforms; commercial deployment via SpiralGen and Intel libraries |
| 2018 | Recast as a framework for “extreme performance portability” across diverse hardware |
| 2020s | Exascale work (FFTX), GPU code generation, and open-source releases |
Over this span SPIRAL moved from a specialized FFT/DSP generator toward a general program-generation framework, while spinning off the company SpiralGen Inc. to bring the technology into commercial libraries.
Current Relevance
SPIRAL remains actively developed. The open-source spiral-software project on GitHub is distributed under a BSD-style license, is documented as building on Windows, Linux, and macOS, and supports CUDA GPU code generation; its version 8.5.3 was released in November 2025. Perhaps its most consequential modern role is as the code-generation engine behind FFTX, the exascale-oriented successor to FFTW developed under the U.S. Department of Energy’s Exascale Computing Project in collaboration with Lawrence Berkeley National Laboratory and CMU.
SPIRAL-generated code has also had quiet but enormous reach: kernels produced by the system shipped inside Intel’s IPP and MKL libraries and Mercury’s SAL, meaning code written by SPIRAL ran on a vast number of machines even though most users never heard the name.
Why It Matters
SPIRAL is a foundational example of a powerful idea: that for well-structured mathematical domains, the compiler can out-engineer the human. By encoding the algebraic structure of signal transforms as a language and searching the space of algorithms and implementations against real hardware measurements, it produced code competitive with expert hand-tuning — and, crucially, code that could be regenerated automatically as processors evolved. Alongside FFTW and ATLAS, it helped establish autotuning and generative programming as serious approaches to high-performance computing, and its formula-rewriting philosophy continues to influence domain-specific languages and compilers for numerical computing today.
Timeline
Notable Uses & Legacy
Intel Integrated Performance Primitives (IPP)
The ippGen domain of Intel IPP shipped thousands of transform functions (DFT, DCT, DHT, Walsh–Hadamard and related kernels) generated by SPIRAL/SpiralGen. The generated-code domain was later deprecated beginning with Intel IPP 9.0.
Intel Math Kernel Library (MKL)
SPIRAL-generated FFT and transform kernels were incorporated into Intel MKL, one of the most widely deployed numerical libraries for x86 platforms.
FFTX and the DOE Exascale Computing Project
FFTX, the exascale successor to FFTW, uses the SPIRAL engine as its code-generation back end for FFT-based computations on leadership-class supercomputers, developed by Lawrence Berkeley National Laboratory, CMU, and SpiralGen.
Mercury Computer Systems SAL
SPIRAL-generated signal-processing routines were used in Mercury's Scientific Algorithm Library (SAL), targeting embedded and high-performance DSP workloads.
Academic autotuning and program-generation research
SPIRAL is a canonical reference in the autotuning and generative-programming literature, frequently studied alongside FFTW and ATLAS as a foundational example of search-driven, domain-specific code generation.