Skip to content

spacemit-com/spine-triton

spine-triton

spine-triton is forked from microsoft/triton-shared, which is a Shared Middle-Layer for Triton Compilation.

QuickStart

  1. env setup
pip install PyYAML sympy torch opencv-python pybind11 --index-url https://git.spacemit.com/api/v4/projects/33/packages/pypi/simple
  1. prebuild whl
pip install triton --index-url https://git.spacemit.com/api/v4/projects/33/packages/pypi/simple
  1. mm demo
# python/examples/test_smt_mm.py
# export SPINE_TRITON_DUMP_PATH=./ir_dumps # for ir dump
python3 python/examples/test_smt_mm.py

Build

  1. llvm
# at spine-triton
# pull llvm-project
# llvm-project hash-tag at spine-triton/triton/cmake/llvm-hash.txt
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout a992f29451b9e140424f35ac5e20177db4afbdc0

mkdir -p build-llvm-riscv64
pushd build-llvm-riscv64
cmake -G Ninja ../llvm-project/llvm \
   -DLLVM_ENABLE_PROJECTS="mlir;llvm" \
   -DLLVM_TARGETS_TO_BUILD="RISCV" \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DCMAKE_BUILD_TYPE=Release \
   -DLLVM_ENABLE_RTTI=ON \
   -DLLVM_BUILD_UTILS=ON \
   -DLLVM_ENABLE_LIBEDIT=OFF \
   -DLLVM_INSTALL_UTILS=ON \
   -DLLVM_INCLUDE_TESTS=OFF \
   -DLLVM_BUILD_TESTS=OFF \
   -DLLVM_ENABLE_LLD=OFF \
   -DCMAKE_INSTALL_PREFIX=installed \
   -DCMAKE_TOOLCHAIN_FILE=../cmake/linux_riscv64.toolchain.cmake

cmake --build . --target install --parallel 40
popd
  1. download spine-mlir
https://archive.spacemit.com/spacemit-ai/spine-mlir/spine-mlir-riscv64-0.5.2.tar.gz
  1. install triton
git submodule update --init --recursive
bash scripts/build.sh ${LLVM_INSTALL_DIR} {arch/x86_64/riscv64} {spine-mlir-install-dir}

License

spine-triton is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 35