Metadata-Version: 2.2
Name: docc-ai
Version: 0.0.7
Summary: Python bindings and MLIR conversion for JIT compiling PyTorch models to SDFGs.
Keywords: pytorch,mlir,sdfg,compiler,optimization
Author-Email: Daisytuner <hello@daisytuner.com>
Maintainer-Email: Daisytuner <hello@daisytuner.com>
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Compilers
Project-URL: Homepage, https://daisytuner.com
Project-URL: Documentation, https://docs.daisytuner.com
Project-URL: Repository, https://github.com/daisytuner/docc
Project-URL: Issues, https://github.com/daisytuner/docc/issues
Requires-Python: >=3.11
Requires-Dist: numpy>=1.19.0
Requires-Dist: ml_dtypes>=0.5.4
Description-Content-Type: text/markdown

# MLIR

The MLIR module contains a dialect and translation of core MLIR dialects to SDFGs.

- **SDFG Dialect**: A dialect to represent SDFGs in MLIR.
- **Conversion**: Conversion passes to convert core dialects (arith, linalg, etc.) to the SDFG dialect.
- **Translate**: A translation pass to dump an SDFG from the SDFG dialect.

## Build from Sources

To build the MLIR component from source install LLVM/MLIR dependencies first:
```bash
sudo apt-get install -y libmlir-19 libmlir-19-dev mlir-19-tools
```

Second, build from the root of the repository using cmake:

```bash
mkdir build && cd build
cmake -G Ninja \
    -DCMAKE_C_COMPILER=clang-19 \
    -DCMAKE_CXX_COMPILER=clang++-19 \
    -DCMAKE_BUILD_TYPE=Debug \
    -DMLIR_BUILD_FRONTEND=ON \
    -DMLIR_BUILD_TESTS=ON \
    -DMLIR_DIR=/usr/lib/llvm-19/lib/cmake/mlir \
    -DLLVM_EXTERNAL_LIT=/usr/lib/llvm-19/build/utils/lit/lit.py \
    -DWITH_SYMENGINE_THREAD_SAFE=ON \
    -DWITH_SYMENGINE_RCP=ON \
    -DINSTALL_GTEST=OFF \
    -DBUILD_TESTS:BOOL=OFF \
    -DBUILD_BENCHMARKS:BOOL=OFF \
    -DBUILD_BENCHMARKS_GOOGLE:BOOL=OFF \
    ..
ninja -j$(nproc)
```

To verify, the basic dialects and translation work, run the tests:

```bash
ninja check-docc-mlir
```

## License

This component is part of docc and is published under the BSD-3-Clause license.
See [LICENSE](../LICENSE) for details.
