TACO compiler generates optimized sparse tensor algebra kernels

TACO, short for the Tensor Algebra Compiler, is a tool for writing sparse and dense linear and tensor algebra applications. The project page, tensor-compiler.org, presents it under three headings: it is versatile, fast and easy to use.

On range, the page says TACO supports a wide span of computations, from simple ones such as sparse matrix-vector multiplication to more complex ones such as MTTKRP on higher-order sparse tensors. Tensors can be stored in several formats, including the common sparse matrix and tensor formats CSR and COO as well as the specialized CSF format.

On speed, the page says TACO uses a novel compiler-based technique to generate kernels optimized for the computation you want to run. According to the page, this gives performance that exceeds the MATLAB Tensor Toolbox by up to several orders of magnitude and is competitive with other high-performance sparse linear and tensor algebra libraries such as Eigen, Intel oneMKL and SPLATT. These are the project's own claims; the page gives no benchmark setup or concrete speedup figures.

On ease of use, the page says complex computations take just a few lines of code. TACO provides C++ and Python APIs that can be used in similar ways to libraries like Eigen and SciPy. A command-line tool and a web tool also let users build their own library of custom kernels and link them into their applications.

To get started, the code base is hosted on GitHub. Its README explains how to build the C++ and Python APIs and the command-line tool. Online documentation covers both APIs and includes example programs. The command-line tool has a help menu, reached with the --help option. TACO can also be used as a code generator directly in the browser, with no download. Users are invited to file GitHub issues for bugs and suggestions, and pull requests that fix bugs or add features are welcome.

TACO is developed and maintained by members of Prof. Fredrik Kjolstad's research group at Stanford University, members of the COMMIT research group (led by Prof. Saman Amarasinghe) at MIT CSAIL, and other contributors. The page lists research support from the National Science Foundation; the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research; the Direction Générale de l'Armement; the Toyota Research Institute; the Application Driving Architectures (ADA) Research Center, a JUMP Center co-sponsored by SRC and DARPA; the Defense Advanced Research Projects Agency; the Google Research Scholar Program; and the Stanford DAWN Affiliate Program. It adds that the opinions expressed are those of the TACO developers and do not necessarily reflect the views of the funding agencies.

This is a general project description, not an announcement: the page gives no release date or version number and does not say anything has changed recently.

Key facts

  • TACO is a compiler that generates kernels for sparse and dense linear and tensor algebra, from sparse matrix-vector multiplication to MTTKRP on higher-order sparse tensors.
  • The page claims performance that exceeds the MATLAB Tensor Toolbox by up to several orders of magnitude and is competitive with Eigen, Intel oneMKL and SPLATT.
  • It offers C++ and Python APIs, a command-line tool and a browser-based code generator that needs no download.
  • Supported storage formats include CSR and COO as well as the specialized CSF.
  • It is developed by Prof. Fredrik Kjolstad's group at Stanford and the COMMIT group (led by Prof. Saman Amarasinghe) at MIT CSAIL, with code on GitHub.

Why it matters

TACO's pitch is to describe the computation in a few lines and let a compiler generate a kernel tuned for it, across several storage formats. The page says the result can beat the MATLAB Tensor Toolbox by up to several orders of magnitude and stay competitive with Eigen, Intel oneMKL and SPLATT. The page is a general description of the project; it does not say anything new has been released.

Who it affects

The page targets people implementing sparse linear and tensor algebra applications who would otherwise rely on libraries such as Eigen, SciPy or the MATLAB Tensor Toolbox. It also offers a path for those who want their own library of custom kernels to link into applications, through the command-line and web tools. Contributors are invited via GitHub issues and pull requests.

How to use it

Download the code base from GitHub and follow the README to build the C++ and Python APIs and the command-line tool. The online documentation covers both APIs and includes example programs. The command-line tool documents its features through the --help option. To try it without installing anything, use the web-based code generator in the browser.

How solid is it

The source is the project's own page, so every performance statement is the developers' claim. The only quantified comparison is the upper bound of "up to several orders of magnitude" over the MATLAB Tensor Toolbox. Against Eigen, Intel oneMKL and SPLATT the claim is only "competitive". The page names its academic homes, Stanford and MIT CSAIL, and its funders.

Risks and caveats

No benchmark setup, hardware, datasets or concrete speedup figures are given beyond the upper bound, and the "several orders of magnitude" figure is a maximum, not a typical result. No release date or version number is stated, and the page does not say that anything changed recently. No licence is stated on the page.

“TACO lets you perform complex sparse linear and tensor algebra computations by writing just a few lines of code.”

— TACO project page, tensor-compiler.org