feat: prove Rust to IREE FFI on aarch64 via the prebuilt dist (#449 Phase 3 M2)#459
Merged
Merged
Conversation
…hase 3 M2) The FFI-gate spike for the OpenXLA backend: a Rust program drives IREE execution of a compiled vmfb on this aarch64 box using only the prebuilt iree-dist (no IREE source build), getting the correct result. This confirms the substrate mlxcel-xla needs and de-risks M2. A thin C shim (iree_gate.c) calls the IREE runtime C API and exposes a flat C ABI; Rust FFIs to it. The dist (iree-dist-<ver>-linux-aarch64.tar.xz, 85 MB) ships the runtime static libs, the C API headers, and iree-compile. Two non-obvious requirements are recorded in FINDINGS.md: the dist leaves the system allocator to the application (the shim provides a libc control function), and the static link needs --whole-archive on the unified runtime (HAL driver registration) plus a group of flatcc, libgcc (aarch64 outline atomics), and libm (CPU-kernel math). Standalone under spike/iree-ffi/ (own empty [workspace]); no effect on mlxcel crates or builds. Refs #449.
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.
FFI-gate spike (#449 Phase 3 M2): proves Rust can drive IREE execution of a compiled vmfb on this aarch64 box using only the prebuilt IREE distribution, with no IREE source build. This confirms the substrate
mlxcel-xlaneeds and de-risks M2.iree_gate.c) calls the IREE runtime C API and exposes a flat C ABI; Rust FFIs to it (the M2 architecture). Result:a + b = [11, 22, 33, 44],FFI GATE: PASS.iree-dist-<ver>-linux-aarch64.tar.xz(85 MB) ships the runtime static libs (libiree_runtime_unified.a), the C API headers, andiree-compile. The pipiree-base-runtime(Python.abi3.soonly, no linkable C lib/headers) is not the path.FINDINGS.md: the dist leaves the system allocator to the application (the shim provides a libc control function), and the static link needs--whole-archiveon the unified runtime (so thelocal-taskHAL driver registration survives) plus a--start-groupof flatcc,libgcc(aarch64 outline atomics), andlibm(CPU-kernel math).Standalone under
spike/iree-ffi/(own empty[workspace]); no effect on mlxcel crates or builds. Next: wire this shim intomlxcel-xlato load the #451-emitted prefill/decode vmfbs and weights and run the token loop.Refs #449.