Repository navigation
build: reproducible IREE runtime toolchain via make targets (#571) - #576
Merged
Merged
Conversation
Wrap scripts/iree/setup-{cuda,macos}.sh in idempotent `make iree`,
`iree-cuda`, `iree-metal`, and `iree-env` targets so the OpenXLA
measurement environment builds reproducibly from a fresh checkout
instead of a local uncommitted artifact.
Fix a reproducibility bug in both setup scripts: a runtime-only IREE
configure at the pinned revision needs the benchmark and printf
submodules (pulled in by the threading / runtime CMake gates, not the
IREE_BUILD_* flags), so the previous flatcc-only init failed a fresh
build at the configure/generate step. Initialize every submodule except
the heavy compiler-only ones (llvm-project, stablehlo, torch-mlir),
which a runtime-only build (IREE_BUILD_COMPILER=OFF) never configures.
The benchmark sentinel also self-heals an older flatcc-only clone.
Add a read-only `--info` mode to each script (resolved paths, pinned
version, HAL drivers) surfaced by `make iree-env`, and point the
mlxcel-xla README CUDA / macOS build sections at `make iree`.
Validated on GB10 (CUDA): a clean src re-clone plus `make iree-cuda`
rebuilds libiree_runtime_unified.a, `cargo build --release --features
xla-iree` links it, and greedy generation is token-exact between f16 and
f32 (48/48). The Metal targets follow the same CMake gates but are not
validatable on this Linux host.
Part of #570
4 of 5 tasks
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
Wrap scripts/iree/setup-{cuda,macos}.sh in idempotent `make iree`,
`iree-cuda`, `iree-metal`, and `iree-env` targets so the OpenXLA
measurement environment builds reproducibly from a fresh checkout
instead of a local uncommitted artifact.
Fix a reproducibility bug in both setup scripts: a runtime-only IREE
configure at the pinned revision needs the benchmark and printf
submodules (pulled in by the threading / runtime CMake gates, not the
IREE_BUILD_* flags), so the previous flatcc-only init failed a fresh
build at the configure/generate step. Initialize every submodule except
the heavy compiler-only ones (llvm-project, stablehlo, torch-mlir),
which a runtime-only build (IREE_BUILD_COMPILER=OFF) never configures.
The benchmark sentinel also self-heals an older flatcc-only clone.
Add a read-only `--info` mode to each script (resolved paths, pinned
version, HAL drivers) surfaced by `make iree-env`, and point the
mlxcel-xla README CUDA / macOS build sections at `make iree`.
Validated on GB10 (CUDA): a clean src re-clone plus `make iree-cuda`
rebuilds libiree_runtime_unified.a, `cargo build --release --features
xla-iree` links it, and greedy generation is token-exact between f16 and
f32 (48/48). The Metal targets follow the same CMake gates but are not
validatable on this Linux host.
Part of lablup#570
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of the OpenXLA low-precision performance epic (#570). Wraps the source-built IREE runtime setup (
scripts/iree/setup-cuda.sh,scripts/iree/setup-macos.sh) in idempotentmaketargets so the measurement environment for the rest of the epic is reproducible from a fresh checkout rather than a local uncommitted artifact.What changed
make ireeauto-detects the host (CUDA on Linux, Metal on macOS) and dispatches tomake iree-cuda/make iree-metal, which run the validated setup scripts.make iree-envprints the resolved paths, pinned IREE version, and HAL drivers. All are idempotent: the scripts reuse an existing clone / build / venv, so re-running does not rebuild when the pinned artifact is present. A dedicated "IREE Backend Targets" group is added tomake help.e4a3b04) needs thebenchmarkandprintfsubmodules: the top-level CMake pullsthird_party/benchmarkin underIREE_ENABLE_THREADING(on for the local-task driver) andthird_party/printfunder the runtime gates, neither gated byIREE_BUILD_*. The previous flatcc-only init therefore failed a fresh build at the configure/generate step. Both scripts now initialize every submodule except the heavy compiler-only ones (llvm-project,stablehlo,torch-mlir), which a runtime-only build (IREE_BUILD_COMPILER=OFF) never configures. Thebenchmarksentinel also self-heals an older flatcc-only clone.--infomode. Each script gains a read-only--infothat prints the resolved paths, pinned version, and HAL drivers (surfaced bymake iree-env); the eval-safe--envoutput is unchanged.mlxcel-xlaCUDA and macOS build sections now referencemake ireeinstead of the ad-hoc clone / cmake / script invocation.Validation (GB10, CUDA)
make iree-envprints backend, home, iree-compile, CUDA root, pinned version, and HAL drivers.src/+build/and runningmake iree-cudare-clones, initializesflatcc+benchmark+printf, configures, and rebuildslibiree_runtime_unified.a(exit 0).cargo build --release --features xla-ireelinks the freshly built runtime.cudaf16 (default) andcudaf32 (48/48 tokens); f16 6.8 tok/s vs f32 4.85 tok/s.Notes
make iree-metal) follow the same CMake gates and passbash -n, but are not validatable on this Linux host; Metal validation belongs to a macOS session (tracked under feat: extend the fused low-precision path to the Metal target #575).MLXCEL_XLA_DEVICE=local-taskreports "no driver 'local-task' registered" even though the driver is compiled in (libiree_hal_drivers_local_task_task_driver.a). This is a shim/runtime-registration behavior independent of this change and may warrant a follow-up.Closes #571
Part of #570