[Codegen][CPU] End-to-end-through-codegen lit test for ukernel framework. (#24571)
Closes the loop on the new C-bitcode ukernel framework with an
`iree-opt` lit test that drives the full LLVMCPU codegen pipeline on an
`inner_tiled` rooted dispatch wrapped in the standard
`hal.executable.variant` + binding-subspan structure, and asserts the
whole chain end-to-end:
- Bitcode reaches the dispatch's `hal.executable.variant` as a
first-class `objects(...)` attribute (the long-lived home).
- `llvm.func @iree_uk_mma_…` is declared with `hal.import.bitcode =
true`, the flag that tells `RewriteExternCallOpToDynamicImportCallOp` to
skip the runtime-import-table indirection.
- A direct `llvm.call @iree_uk_mma_…` replaces the original
`inner_tiled` — no `__import_ordinal_iree_uk_mma_…` (which would mean we
accidentally re-used the legacy runtime-resolved path), no leftover
`inner_tiled`, no leftover `ukernel.generic`.
To make that chain work, two pieces had to land alongside the test:
* `UKernelProviderAttr::createAndReplaceWithUkernelOp` now actually
builds the `UKernelGenericOp` (returning `success`, not `nullopt`),
setting `fn_def_attrs = {hal.import.bitcode = true}` on it. That flag
propagates onto the `func.func` declaration that
`LowerUKernelOpsToCalls` synthesizes, and through it onto the
`llvm.func` that `ConvertToLLVM` produces. Without this, the
"self-contained bitcode" property of the new framework would not hold —
every external call would be routed through the runtime import table
just like the legacy mmt4d ukernels.
* Bitcode lookup-and-attach is factored into a public helper
`IREE::CPU::attachUKernelBitcodeOnOp`, called both from
`LLVMCPUSelectUKernels` (at kernel-config time, mirroring GPU's
`ensureUKernelBitcodeAndFinalizeConfig`) and from the provider itself
(as a backstop for the BYO / hand-written-IR paths). It attaches the
bitcode both as a `hal.executable.objects` discardable attribute on the
op (the GPU-aligned shape) *and* directly on the enclosing
`hal.executable.variant`'s `objects` operand attribute (the durable
home, sidestepping passes that strip discardable attrs through
`ConvertToLLVM`).
Progress towards https://github.com/iree-org/iree/issues/24574.
Signed-off-by: Benoit Jacob <jacob.benoit.1@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
Releases notes are published on GitHub releases.
| Package | Release status |
|---|---|
| GitHub release (stable) | |
| GitHub release (nightly) | |
iree-base-compiler | |
iree-base-runtime |
For more details on the release process, see https://iree.dev/developers/general/release-management/.
| Operating system | Build status |
|---|---|
| Linux | |
| macOS | |
| macOS |
For the full list of workflows see https://iree.dev/developers/general/github-actions/.
See our website for more information.
Community meeting recordings: IREE YouTube channel
| Date | Title | Recording | Slides |
|---|---|---|---|
| 2025-06-10 | Data-Tiling in IREE: Achieving High Performance Through Compiler Design (AsiaLLVM) | recording | slides |
| 2025-05-17 | Introduction to GPU architecture and IREE's GPU CodeGen Pipeline | recording | slides |
| 2025-02-12 | The Long Tail of AI: SPIR-V in IREE and MLIR (Vulkanised) | recording | slides |
| 2024-10-01 | Unveiling the Inner Workings of IREE: An MLIR-Based Compiler for Diverse Hardware | recording | |
| 2021-06-09 | IREE Runtime Design Tech Talk | recording | slides |
| 2020-08-20 | IREE CodeGen (MLIR Open Design Meeting) | recording | slides |
| 2020-03-18 | Interactive HAL IR Walkthrough | recording | |
| 2020-01-31 | End-to-end MLIR Workflow in IREE (MLIR Open Design Meeting) | recording | slides |
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.