MPACT retargetable ML compiler
Project description
The MPACT Project
Introduction
The MPACT project's main objective is to dramatically reduce the effort required to create highly optimizing HPC and ML compilers for a large class of architectures using LLVM and MLIR. We do this by providing a declarative language-based mechanism for collecting and expressing critical aspects of a target architecture in a way that can be reasoned about and leveraged by all passes in both MLIR and LLVM.
Building the MPACT compiler
To build and run the MPACT compiler from source (for developers), please follow the steps below.
Check out code and sync submodules
Use the following commands to clone the MPACT compiler repository.
git clone https://github.com/MPACT-ORG/mpact-compiler.git
cd mpact-compiler
git submodule update --init --recursive --progress
All following commands assume you remain in the mpact-compiler directory.
Setup Python virtual environment
The following commands initialize a virtual environment.
python3.11 -m venv mpact_venv # one time set up
source mpact_venv/bin/activate # for each session
Also make sure to set the Python paths as follows.
export PYTHONPATH=`pwd`/build/tools/mpact/python_packages/mpact
Install build requirements
Note that currently we rely on torch-mlir requirements defined in the
submodule to ensure all the build requirements are consistent.
python -m pip install --upgrade pip
python -m pip install -r externals/torch-mlir/requirements.txt
python -m pip install -r externals/torch-mlir/torchvision-requirements.txt
Building the MPACT compiler in-tree
The following command generates configuration files to build the MPACT compiler project completely in-tree, which means that both LLVM as well as torch-mlir are built from source.
cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DPython3_FIND_VIRTUALENV=ONLY \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;mpact" \
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="${PWD}/externals/torch-mlir" \
-DLLVM_EXTERNAL_MPACT_SOURCE_DIR="${PWD}" \
-DLLVM_TARGETS_TO_BUILD=host \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
externals/torch-mlir/externals/llvm-project/llvm
Run the following to ensure the MPACT compiler builds and runs correctly.
cmake --build build --target check-mpact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpact-20240607-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mpact-20240607-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 53.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805a05affb2e3c90e198bea36c767c865ac9c0a1a9bed8a85c6b1acaa3ebd4a1
|
|
| MD5 |
0574263129910a696bd8f1b2a7451f50
|
|
| BLAKE2b-256 |
5f9e6ce8b0f51b31b8dae568d52aa0ffb3f9e297250b0e25fa3990e7a537b48a
|