Skip to content

Commit c3c665a

Browse files
authored
Merge pull request #30 from amd/update-mlir-air-aie-versions
Update mlir-air and mlir-aie to latest wheels (LLVM 278dba37)
2 parents 5b0a70b + 0b870f2 commit c3c665a

9 files changed

Lines changed: 28 additions & 13 deletions

File tree

amd_triton_npu/backend/driver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,10 @@ def launch(
12931293
# multiply, with f32 accumulation.
12941294
if os.getenv("AMD_TRITON_NPU_BF16_EMULATION", "0") == "1":
12951295
aircc_cmd.insert(-1, "--bf16-emulation")
1296+
# Explicitly set runtime loop tiling sizes to [4,4] (aircc
1297+
# default changed from [4,4] to [] in mlir-air #1470).
1298+
aircc_cmd.insert(-1, "--air-runtime-loop-tiling-sizes=4")
1299+
aircc_cmd.insert(-1, "--air-runtime-loop-tiling-sizes=4")
12961300
subprocess.check_call(aircc_cmd)
12971301

12981302
# Cache format-specific artifacts first, then the .so last.

amd_triton_npu/backend/transform_library/vectorization.mlir

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ transform.named_sequence @vectorize_generics_at_32(
2727

2828
// Post-vectorization cleanup for reduction kernels (softmax, layernorm,
2929
// rms_norm): convert size-1 vectors to scalars (downstream compiler
30-
// cannot handle them), then lower multi_reduction and cast away
31-
// leading-one vector dims.
30+
// cannot handle them), cast away leading-one vector dims, then lower
31+
// multi_reduction ops.
3232
transform.named_sequence @post_vectorize_reduce_cleanup(
3333
%module: !transform.any_op {transform.readonly}) {
3434
%func = transform.structured.match ops{["func.func"]} in %module
@@ -40,8 +40,9 @@ transform.named_sequence @post_vectorize_reduce_cleanup(
4040
transform.apply_patterns.scf.for_loop_canonicalization
4141
transform.apply_patterns.canonicalization
4242
transform.apply_patterns.vector.cast_away_vector_leading_one_dim
43-
transform.apply_patterns.vector.lower_multi_reduction
44-
lowering_strategy = "innerreduction"
43+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
44+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
45+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
4546
} : !transform.any_op
4647
transform.apply_cse to %func_done : !transform.any_op
4748
transform.yield

examples/average_pool/transform_aie2.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ module attributes {transform.with_named_sequence} {
9494
// Lower vector reductions
9595
%func_final = transform.structured.match ops{["func.func"]} in %arg1 : (!transform.any_op) -> !transform.any_op
9696
transform.apply_patterns to %func_final {
97-
transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction"
97+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
98+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
99+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
98100
transform.apply_patterns.vector.lower_contraction
99101
transform.apply_patterns.vector.lower_transfer
100102
} : !transform.any_op

examples/average_pool/transform_aie2p.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ module attributes {transform.with_named_sequence} {
9494
// Lower vector reductions
9595
%func_final = transform.structured.match ops{["func.func"]} in %arg1 : (!transform.any_op) -> !transform.any_op
9696
transform.apply_patterns to %func_final {
97-
transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction"
97+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
98+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
99+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
98100
transform.apply_patterns.vector.lower_contraction
99101
transform.apply_patterns.vector.lower_transfer
100102
} : !transform.any_op

examples/rms_norm/transform_aie2p.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ module attributes {transform.with_named_sequence} {
9292
// Lower vector reductions FIRST (creates arith.mulf/addf from vector.multi_reduction)
9393
%func_final = transform.structured.match ops{["func.func"]} in %arg1 : (!transform.any_op) -> !transform.any_op
9494
transform.apply_patterns to %func_final {
95-
transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction"
95+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
96+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
97+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
9698
transform.apply_patterns.vector.lower_contraction
9799
transform.apply_patterns.vector.lower_transfer
98100
} : !transform.any_op

examples/test_layernorm/transform_aie2.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ module attributes {transform.with_named_sequence} {
268268
transform.apply_patterns.linalg.tiling_canonicalization
269269
transform.apply_patterns.scf.for_loop_canonicalization
270270
transform.apply_patterns.canonicalization
271-
transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction"
271+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
272+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
273+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
272274
} : !transform.any_op
273275
transform.apply_cse to %func7_transformed : !transform.any_op
274276
transform.yield

examples/test_layernorm/transform_aie2p.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ module attributes {transform.with_named_sequence} {
270270
transform.apply_patterns.linalg.tiling_canonicalization
271271
transform.apply_patterns.scf.for_loop_canonicalization
272272
transform.apply_patterns.canonicalization
273-
transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction"
273+
transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerreduction"
274+
transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerreduction"
275+
transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerreduction"
274276
} : !transform.any_op
275277
transform.apply_cse to %func7_transformed : !transform.any_op
276278
transform.yield

utils/mlir-aie-hash.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Commit: df5c9a4bf43a32f4aee5504969d09f4a882b1407
2-
Timestamp: 2026032204
1+
Commit: 3a1aba217920bc4475b5d705c165e7b678a2646a
2+
Timestamp: 2026032704
33
Version: 0.0.1

utils/mlir-air-hash.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Commit: b312418780efeb566fb6e5b7e9e36f5b41989c26
2-
Timestamp: 2026032504
1+
Commit: 5798472da6a85e2e023d347602d051b2a85fbc75
2+
Timestamp: 2026032704
33
Version: 0.0.1

0 commit comments

Comments
 (0)