目录

triton-spacemit-backend

triton-spacemit-backend is a standalone backend/runtime split extracted from spine-mlir-0527 without modifying the original source tree.

Included components:

  • Backend compiler libraries under include/ and lib/
  • Backend tool tools/spine-opt
  • Runtime libraries under runtime/
  • Build helpers under cmake/
  • Local third-party sources required by the original build: third_party/tracy, mimalloc-src, spine-arch-info-src
  • A Triton backend plugin package under backend/
  • Standalone wheel packaging via setup.py / pyproject.toml

Intentionally excluded from the default build:

  • Top-level test/
  • Runtime tests unless -DTRITON_SPACEMIT_BACKEND_ENABLE_RUNTIME_TESTS=ON
  • Frontend or Triton Python packaging content

Typical RISC-V build flow:

cd triton-spacemit-backend

export RISCV_ROOT_PATH=/home/cjl/0604/spacemit-toolchain

bash scripts/build_triton_spacemit_backend_riscv64.sh \
  /home/cjl/0604/llvm-release-cross \
  speir \
  Release

Build output:

build/riscv64/speir/Release

Install output when install is run:

build/riscv64/speir/Release/installed

Backend Plugin Wheel

This project can build a standalone Triton backend plugin wheel that installs resources into triton.backends.spine_triton.

Example:

cd triton-spacemit-backend

python3 setup.py bdist_wheel --plat-name linux-riscv64

Recommended invocation with explicit artifact/tool paths:

bash scripts/build_triton_spacemit_backend_wheel.sh \
  build/riscv64/speir/Release \
  linux-riscv64 \
  /home/cjl/0604/llvm-release-cross \
  /path/to/spine-triton-opt

Wheel build behavior:

  • Bundles spine-opt, llc, opt, mlir-translate when LLVM tools are available
  • Bundles libSpeIRRuntimeLibs.so and builds libSpineTritonRuntime.so
  • Reuses backend artifacts from either a build directory or an install prefix
  • Optionally bundles spine-triton-opt when SPINE_TRITON_OPT_PATH is provided

Important runtime note:

  • test_smt_mm.py still needs spine-triton-opt for the frontend TTIR->Linalg lowering step. If the frontend wheel does not expose this binary itself, set SPINE_TRITON_OPT_PATH at runtime.
关于
428.2 MB
邀请码