Rust bindings for:
- XLA PJRT C API
- MLIR HLO C API
- StableHLO C API
./src/tool/setup.sh
source .env.build
cargo checkGenerate only 1 or 2 binding sets:
# PJRT only
./src/tool/setup.sh --bindings pjrt
# PJRT + MLIR (skip StableHLO)
./src/tool/setup.sh --bindings pjrt,mlirThe build script (build.rs) generates:
pjrt_c_api.rsmlir_hlo_c_api.rsstablehlo_c_api.rs
in Cargo OUT_DIR.
- LLVM => LLVM 21
- PJRT version is tied to the XLA checkout you point to with
XLA_SRC_DIR. - StableHLO source is read from
STABLEHLO_SRC_DIR(or auto-detected fromXLA_SRC_DIR/bazel-xla/external/stablehlo). - Binding selection is controlled by
RRAD_BINDINGS(all,pjrt,mlir,stablehlo, or comma-separated mix). - In this checkout,
xla/pjrt/c/pjrt_c_api.hreports:PJRT_API_MAJOR = 0PJRT_API_MINOR = 96