README.md
1# MLIR-PyTACO: Implementing PyTACO with MLIR
2
3TACO (http://tensor-compiler.org/) is a tensor algebra compiler. TACO defines
4PyTACO, a domain specific language in Python, for writing tensor algebra
5applications.
6
7This directory contains the implementation of PyTACO using MLIR. In particular,
8we implement a Python layer that accepts the PyTACO language, generates MLIR
9linalg.generic OPs with sparse tensor annotation to represent the tensor
10computation, and invokes the MLIR sparse tensor code generator
11(https://mlir.llvm.org/docs/Dialects/SparseTensorOps/) as well as other MLIR
12compilation passes to generate an executable. Then, we invoke the MLIR execution
13engine to execute the program and pass the result back to the Python layer.
14
15As can be seen from the tests in this directory, in order to port a PyTACO
16program to MLIR-PyTACO, we basically only need to replace this line that imports
17PyTACO:
18
19```python
20import pytaco as pt
21```
22
23with this line to import MLIR-PyTACO:
24
25```python
26from tools import mlir_pytaco_api as pt
27```
28