Skip to content

feat: prove Rust to IREE FFI on aarch64 via the prebuilt dist (#449 Phase 3 M2)#459

Merged
inureyes merged 1 commit into
mainfrom
feat/openxla-iree-ffi-gate-449
Jun 27, 2026
Merged

feat: prove Rust to IREE FFI on aarch64 via the prebuilt dist (#449 Phase 3 M2)#459
inureyes merged 1 commit into
mainfrom
feat/openxla-iree-ffi-gate-449

Conversation

@inureyes

Copy link
Copy Markdown
Member

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-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 M2 architecture). Result: a + b = [11, 22, 33, 44], FFI GATE: PASS.
  • The prebuilt iree-dist-<ver>-linux-aarch64.tar.xz (85 MB) ships the runtime static libs (libiree_runtime_unified.a), the C API headers, and iree-compile. The pip iree-base-runtime (Python .abi3.so only, no linkable C lib/headers) is not the path.
  • Two non-obvious requirements 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 (so the local-task HAL driver registration survives) plus a --start-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. Next: wire this shim into mlxcel-xla to load the #451-emitted prefill/decode vmfbs and weights and run the token loop.

Refs #449.

…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.
@inureyes inureyes merged commit 6f51686 into main Jun 27, 2026
@inureyes inureyes deleted the feat/openxla-iree-ffi-gate-449 branch June 27, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant