Skip to content

feat(xla): execute LLaVA vision through IREE - #913

Merged
inureyes merged 7 commits into
mainfrom
feature/issue-863-iree-vision-projector
Jul 24, 2026
Merged

inureyes merged 7 commits into
mainfrom
feature/issue-863-iree-vision-projector

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

  • emit the qualified LLaVA SigLIP/ViT vision tower and projector as a static StableHLO vision.main module
  • load, validate, cache, and execute the resident-weight module through IREE with explicit host/auto/iree backend selection
  • route production CLI/server prepared prefill through the IREE projection while preserving the language-model ABI
  • bind processor metadata, ordered weight schema, compiler binary digest, flags, MLIR, and VMFB bytes into cache identity
  • harden cache publication for concurrent loaders and crashed owners, and fail closed on non-finite weights or outputs
  • add host/oracle/IREE intermediate comparison, token-exact generation, transfer, latency, throughput, and RSS evidence

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • cargo check --tests --features xla-iree
  • cargo clippy -p mlxcel-xla --features iree --tests -- -D warnings
  • cargo clippy --features xla-iree --tests -- -D warnings
  • cargo test -p mlxcel-xla --features diagnostics aux_manifest::tests (5 passed)
  • targeted Rust vision/runtime tests (13 passed)
  • independent Python oracle tests (16 passed)
  • CUDA production gate against the current binary: 3/3 cases passed, no first divergence, no non-finite values, prepared max-abs parity 0.0, and host/IREE greedy-token parity
  • CPU IREE compilation and module validation passed; the existing aarch64 static IREE test-link __stack_chk_guard limitation remains outside this change

Runtime evidence

  • one-image host vs production-IREE end to end: 2.281 s vs 2.743 s
  • two-image host vs production-IREE end to end: 2.149 s vs 3.876 s
  • prefill stayed near parity: 1.020 s vs 0.997 s for one image
  • explicit pixel-upload and projected-feature transfer byte counts are recorded per request
  • Linux RSS snapshots and MLX peak memory are recorded; dedicated IREE CUDA bytes are reported as unavailable on GB10 unified memory instead of fabricated

Closes #863

inureyes added 7 commits July 24, 2026 14:16
Add a typed resident-weight module lifecycle for vision and audio front-ends without changing the language-model ABI.

Bind VMFB bytes, config, ordered weight schema, entry point, and compiler generation identity in a fail-closed manifest. Cover real CPU F32/I32/bool8 multi-I/O execution plus output count, dtype, and shape rejection.
Parse and fingerprint the qualified SigLIP/CLIP vision contract, enforce the ordered weight schema, and emit patch embedding, transformer attention/MLP layers, and projector math as StableHLO.

Keep normalized pixels as the only invocation input and return canonical unbatched projected tokens.
@inureyes inureyes added status:review Under review type:enhancement New features, capabilities, or significant additions priority:medium Medium priority area:models Model architectures, weights, loading, metadata area:architecture Architecture and code structure changes labels Jul 24, 2026
@inureyes
inureyes merged commit e3f9bc3 into main Jul 24, 2026
4 checks passed
@inureyes
inureyes deleted the feature/issue-863-iree-vision-projector branch July 24, 2026 07:26
@inureyes inureyes added status:done Completed and removed status:review Under review labels Jul 24, 2026
@inureyes inureyes self-assigned this Aug 31, 2026
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
* feat(xla): add verified auxiliary IREE runtime

Add a typed resident-weight module lifecycle for vision and audio front-ends without changing the language-model ABI.

Bind VMFB bytes, config, ordered weight schema, entry point, and compiler generation identity in a fail-closed manifest. Cover real CPU F32/I32/bool8 multi-I/O execution plus output count, dtype, and shape rejection.

* feat(xla): emit static LLaVA vision graph

Parse and fingerprint the qualified SigLIP/CLIP vision contract, enforce the ordered weight schema, and emit patch embedding, transformer attention/MLP layers, and projector math as StableHLO.

Keep normalized pixels as the only invocation input and return canonical unbatched projected tokens.

* fix(xla): publish qualified auxiliary cache once

* feat(xla): execute LLaVA vision with IREE

* feat(xla): route LLaVA prepared prefill through IREE

* fix(xla): harden qualified vision execution

* fix(xla): recover cache locks from crashed owners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:architecture Architecture and code structure changes area:models Model architectures, weights, loading, metadata priority:medium Medium priority status:done Completed type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(xla): emit SigLIP/ViT encoders and projectors through IREE

1 participant