🚧 Work in progress
Dyno is an MLIR-based prototype compiler framework designed for dynamic sized vector architectures.
- Clone and initialize the repository:
git clone <repo-url> dyno-mlir
cd dyno-mlir
git submodule update --init --recursive- Install dependencies:
sudo apt install build-essential cmake ninja-build clang lldOptional: to build the RISC-V GNU Toolchain, first apply the workaround patch:
./scripts/workaround-gnutoolchain.shThen check the README in third_party/riscv-gnu-toolchain to install dependencies.
Note that the GNU Toolchain is by default enabled in the script, and it also enables an LLVM build to support OpenMP header and libraries, so it will take longer to build.
- Compile LLVM & MLIR
./scripts/build-llvm.sh- Compile Dyno
./scripts/build-dyno.shFor normal host-side development, the existing LLVM and Dyno build flow is unchanged:
./scripts/build-llvm.sh
./scripts/build-dyno.shTo build the benchmarks for RISC-V platforms, cross-compile the project.
source ./scripts/build-env.sh
./scripts/build-riscv-llvm.sh
./scripts/setup-triton.sh build-riscv
./scripts/build-riscv-dyno.shSet ENABLE_TRITON_BENCHMARKS=OFF before ./scripts/build-riscv-dyno.sh if you
want to skip the Triton benchmarks entirely.
The Triton setup is split on purpose:
third_party/tritonis pinned to the commit required bythird_party/triton_sharedthird_party/triton_sharedprovides the shared lowering and Python backendthird_party/triton-cpuis kept on its own head and is only used fortriton-opt
This avoids having to patch any Triton source tree locally just to make the benchmarks compile.
Run the compiler IR regression suite from the host build:
cmake --build build --target check-dynoor use ninja
ninja -C build check-dynoRun the runtime regression suite from the RISC-V build:
ctest --test-dir build-riscv -L runtime-regression --output-on-failureOr use the convenience target:
cmake --build build-riscv --target check-dyno-runtime-regressionsBenchmarks are built as executables under build-riscv/benchmarks/.... Run
them directly, for example:
build-riscv/benchmarks/linalg/matmul/linalg-matmul-benchmark
build-riscv/benchmarks/dyno/matmul/dyno-matmul-benchmark
build-riscv/benchmarks/triton/matmul/triton-matmul-benchmarkqemu-riscv64 may be required to run these benchmarks on a non-RISC-V machine.