You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MLIR Opt] Hardware-exact register tiling and micro-kernel synthesis #666
Synthesize hardware-exact micro-kernels via vector outer-product lowering and silicon targets.
Problem & Goal
Inner-product dot products incur high memory traffic and redundant vector transpositions.
We want to lower matrix and tensor contractions to vector.outerproduct and target silicon matrix engines directly (Intel AMX, ARM SME/SME2, NVIDIA Tensor Cores via TMA and WGMMA).
Key Deliverables
Implement vector.outerproduct lowering for 2D/3D register tiles.
Add register pressure budget analysis to avoid stack spilling across AVX-512 / ARM Neon register files.
Wire lowerings for matrix accelerator intrinsics (AMX / SME / NVVM TMA).
Benchmark GEMM micro-kernels against reference BLAS.
Merged PR #1189 delivers the first register-tile slice: nested vector result types, opt-in vector.outerproduct lowering, and FLOWC_MLIR_REGISTER_TILE_MAX_LANES pressure control. The remaining issue scope is target-specific AMX/SME/NVVM intrinsic lowering and GEMM micro-kernel benchmarking.
PR #1220 is merged at d905c48. The register-tile suite now covers nested vector.outerproduct lowering and the FLOWC_MLIR_REGISTER_TILE_MAX_LANES refusal path under native tools.
Implementation update (2026-10-06): draft PR #1402. MLIR register-tile vector width parsing, nested scalar lane multiplication and budget checks now fail closed on i32 overflow/nonpositive lanes. Hardware-specific microkernel performance work remains open. The PR is draft because full local Flow/build validation has not been performed; #1402 additionally requires regenerated bootstrap C. No issue is being closed merely because a patch exists.
2026-10-07: Extended draft PR #1402. FLOWC_MLIR_REGISTER_TILES now requires exact 1 instead of accepting prefix values like 10; malformed/non-positive operand lane counts fail before the nested result vector type is registered. Existing recursive lane-product overflow and max-lane parser guards remain. Added a prefix-enable regression. Combined #665/#666 branch checks are 9/9 source invariants. Native MLIR execution/bootstrap regeneration still required.
Audit, 2026-10-08, against main 55dc81b7. Stays open.
Deliverable
Status
Delivered by
vector.outerproduct lowering for 2D/3D register tiles
done (opt-in FLOWC_MLIR_REGISTER_TILES=1)
#1189, #1220, nested lanes #1260, 3D fixture register_tile_3d.flow
Register pressure budget to avoid spills on AVX-512 / Neon
partial: a user lane cap (FLOWC_MLIR_REGISTER_TILE_MAX_LANES, default 256) and pressure metadata exist; no per-ISA register-file model (32 x 512-bit zmm, 32 x 128-bit Neon) chooses or rejects a tile
partial: FLOWC_MLIR_REGISTER_TILE_INTRINSICS=1 writes "amx.tile_mulf", "arm_sme.outerproduct" or "nvvm.wgmma" as generic ops over plain vector types. Those are not the dialects' real signatures (AMX tiles, SME vector<[4]x[4]xf32> with masks, WGMMA descriptors), so mlir-opt cannot verify or lower them
GEMM micro-kernel benchmark against reference BLAS
missing
Verified on macOS arm64 with Homebrew LLVM/MLIR 22.1.7: ./flow tool tests/scripts/mlir_register_tiles.flow 11 passed. The intrinsic checks are text matches only.
Remaining for this issue:
Emit the AMX, SME and NVVM operations with their real operand types, and a test that runs mlir-opt over each (skips without the target).
A per-target register budget that picks or refuses a tile shape.
A GEMM micro-kernel benchmark against Accelerate or OpenBLAS (benchmarks/blas_vs_naive.flow is the starting point).
Delivered by #1476. Implemented register tile capacity budgets for AMX, SME and NVVM in compiler/src/mlirgen.flow. Added hardware-exact register-tiled GEMM micro-kernel benchmark in benchmarks/micro/gemm_micro_kernel.flow and tests in tests/scripts/mlir_register_tiles.flow.
Activity
godofecht commentedon Oct 2, 2026
Merged PR #1189 delivers the first register-tile slice: nested vector result types, opt-in
vector.outerproductlowering, andFLOWC_MLIR_REGISTER_TILE_MAX_LANESpressure control. The remaining issue scope is target-specific AMX/SME/NVVM intrinsic lowering and GEMM micro-kernel benchmarking.godofecht commentedon Oct 2, 2026
Opened #1220 with Flow-native coverage for nested vector.outerproduct lowering and the register-tile lane budget refusal path. Local suite passes 2/2.
godofecht commentedon Oct 2, 2026
PR #1220 is merged at d905c48. The register-tile suite now covers nested
vector.outerproductlowering and theFLOWC_MLIR_REGISTER_TILE_MAX_LANESrefusal path under native tools.fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
godofecht commentedon Oct 6, 2026
Implementation update (2026-10-06): draft PR #1402. MLIR register-tile vector width parsing, nested scalar lane multiplication and budget checks now fail closed on i32 overflow/nonpositive lanes. Hardware-specific microkernel performance work remains open. The PR is draft because full local Flow/build validation has not been performed; #1402 additionally requires regenerated bootstrap C. No issue is being closed merely because a patch exists.
fix(mlir): make register-tile enable exact and fail before invalid ty…
test(mlir): register-tile feature flag cannot be prefix-enabled (#666)
godofecht commentedon Oct 7, 2026
2026-10-07: Extended draft PR #1402.
FLOWC_MLIR_REGISTER_TILESnow requires exact1instead of accepting prefix values like10; malformed/non-positive operand lane counts fail before the nested result vector type is registered. Existing recursive lane-product overflow and max-lane parser guards remain. Added a prefix-enable regression. Combined #665/#666 branch checks are 9/9 source invariants. Native MLIR execution/bootstrap regeneration still required.godofecht commentedon Oct 8, 2026
Audit, 2026-10-08, against main
55dc81b7. Stays open.vector.outerproductlowering for 2D/3D register tilesFLOWC_MLIR_REGISTER_TILES=1)register_tile_3d.flowFLOWC_MLIR_REGISTER_TILE_MAX_LANES, default 256) and pressure metadata exist; no per-ISA register-file model (32 x 512-bit zmm, 32 x 128-bit Neon) chooses or rejects a tileFLOWC_MLIR_REGISTER_TILE_INTRINSICS=1writes"amx.tile_mulf","arm_sme.outerproduct"or"nvvm.wgmma"as generic ops over plain vector types. Those are not the dialects' real signatures (AMX tiles, SMEvector<[4]x[4]xf32>with masks, WGMMA descriptors), somlir-optcannot verify or lower themVerified on macOS arm64 with Homebrew LLVM/MLIR 22.1.7:
./flow tool tests/scripts/mlir_register_tiles.flow11 passed. The intrinsic checks are text matches only.Remaining for this issue:
mlir-optover each (skips without the target).benchmarks/blas_vs_naive.flowis the starting point).fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
fix(mlir): make register-tile enable exact and fail before invalid ty…
test(mlir): register-tile feature flag cannot be prefix-enabled (#666)
fix: regenerate bootstrap C after the #736 cache bounds and #665/#666 …
fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
fix(mlir): make register-tile enable exact and fail before invalid ty…
test(mlir): register-tile feature flag cannot be prefix-enabled (#666)
fix: regenerate bootstrap C after the #736 cache checks and #665/#666 …
fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
fix(mlir): make register-tile enable exact and fail before invalid ty…
test(mlir): register-tile feature flag cannot be prefix-enabled (#666)
godofecht commentedon Oct 12, 2026
Delivered by #1476. Implemented register tile capacity budgets for AMX, SME and NVVM in compiler/src/mlirgen.flow. Added hardware-exact register-tiled GEMM micro-kernel benchmark in benchmarks/micro/gemm_micro_kernel.flow and tests in tests/scripts/mlir_register_tiles.flow.