This website requires JavaScript.
About
Status
₊˚⊹Discord
Explore
Register
Sign in
Reference in a new issue
Blame
Copy permalink
Reference in a new issue
Copy permalink
DKB
/
zml
Star
0
Fork
You've already forked zml
0
mirror of
https://github.com/zml/zml.git
synced
2026-11-16 19:11:09 +00:00
Code
Issues
23
Releases
1
Packages
Activity
raphael/decoder-buffer
zml
/
mlir
/
dialects
/
air
/
AIROps.cpp
64 lines
2.7 KiB
Raw
Permalink
Normal View
History
mlir/dialects: add AIR dialect (#988) Adds Apple's AIR dialect, for writing Metal kernels in MLIR. - `mlir/dialects/air`: the AIR that Apple's Metal compiler emits for MSL. Each op is named after its `air.*` intrinsic without the type suffix (`fast_exp`, `max.u`, `simd_shuffle_xor`, `wg.barrier`, `simdgroup_matrix_8x8_load`, ...), with fastmath flags on float ops. Kernel arguments are described the way that compiler describes them: builtins, buffers with access/noalias, and `air.arg_name`. - `llvm`, `arith`: bind array and named struct types, linkage, loop annotations, and integer overflow flags.
2026-10-26 11:41:06 +01:00
dsl/metal: add the Metal DSL (#989) Adds a Zig DSL for Metal kernels over the AIR dialect, and moves the Metal paged attention kernels onto it. - `mlir/dialects/air`: a `thread` address space. Each op has an `llvmBuilder` that calls its `air.*` builtin with Apple's attributes, and the dialect's translation interface builds the `!air.kernel` metadata, so lowering to LLVM IR is MLIR's own translation. The verifier rejects what Apple's compiler can't take: bool, scalable and n-D vectors, buffers of non-Metal scalars, scalar f32 converts, and `air.kernel` on a declaration. - `dsl/metal`: an MSL-shaped builder. It emits `air` plus the `arith`/`cf`/`vector`/`llvm` IR that clang produces for MSL, and covers MSL's math, SIMD-group, barrier and `simdgroup_matrix` functions. - `zml.kernel.metal` / `ops.metal`: wrap a kernel into a `__gpu$xla.gpu.air` custom call. XLA lowers it, compiles it to a metallib and launches it.
2026-10-29 12:52:20 +01:00
mlir/dialects: add AIR dialect (#988) Adds Apple's AIR dialect, for writing Metal kernels in MLIR. - `mlir/dialects/air`: the AIR that Apple's Metal compiler emits for MSL. Each op is named after its `air.*` intrinsic without the type suffix (`fast_exp`, `max.u`, `simd_shuffle_xor`, `wg.barrier`, `simdgroup_matrix_8x8_load`, ...), with fastmath flags on float ops. Kernel arguments are described the way that compiler describes them: builtins, buffers with access/noalias, and `air.arg_name`. - `llvm`, `arith`: bind array and named struct types, linkage, loop annotations, and integer overflow flags.
2026-10-26 11:41:06 +01:00