Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIR lowering pipeline failed for mmult with l2 tile size 64,64,64, l1 tile size 32,32,32 #277

Open
zzzDavid opened this issue Aug 18, 2023 · 0 comments

Comments

@zzzDavid
Copy link
Contributor

zzzDavid commented Aug 18, 2023

Description

This issue happens during calling aircc.py to lower air IR generated from linalg.

Tool commit points

  • MLIR-AIR @c3a9b505f06936a3e4c81c221ca9fac2a7d6dbad
  • MLIR-AIE @d21ca563e0c0fd100a4bbd98d194e770ce33bd79

Repeat the issue

Input: air.mlir

module {
  func.func @forward(%arg0: memref<128x128xi32>, %arg1: memref<128x128xi32>, %arg2: memref<128x128xi32>) {
    linalg.matmul ins(%arg0, %arg1 : memref<128x128xi32>, memref<128x128xi32>) outs(%arg2 : memref<128x128xi32>)
    return
  }
}

Compilation command:

air-opt air.mlir \
	-o air.opt.mlir \
	-buffer-results-to-out-params \
	-air-linalg-codegen='l2-tile-size=64,64,64 l2-promote=true l1-tile-size=32,32,32 l1-promote=true' \
	-air-par-to-herd \
	-air-copy-to-dma \
	-canonicalize -cse \

aircc.py \
    -row-offset=3 \
    -col-offset=5 \
    ./air.opt.mlir \
    -o air.mlir.a \
    --host-target=aarch64-linux-gnu \
    --sysroot=${SYSROOT}

Error message:

loc("-":28:11): error: block with no terminator, has 
"scf.for"(%1, %2, %3) ({
^bb0(%arg7: index):
  "scf.for"(%1, %3, %0) ({
  ^bb0(%arg8: index):
    "scf.for"(%1, %3, %0) ({
    ^bb0(%arg9: index):
      "scf.for"(%1, %3, %0) ({
      ^bb0(%arg10: index):
        %4 = "memref.load"(<<UNKNOWN SSA VALUE>>, %arg8, %arg10) : (memref<32x32xi32, 2>, index, index) -> i32
        %5 = "memref.load"(<<UNKNOWN SSA VALUE>>, %arg10, %arg9) : (memref<32x32xi32, 2>, index, index) -> i32
        %6 = "memref.load"(<<UNKNOWN SSA VALUE>>, %arg8, %arg9) : (memref<32x32xi32, 2>, index, index) -> i32
        %7 = "arith.muli"(%4, %5) : (i32, i32) -> i32
        %8 = "arith.addi"(%6, %7) : (i32, i32) -> i32
        "memref.store"(%8, <<UNKNOWN SSA VALUE>>, %arg8, %arg9) : (i32, memref<32x32xi32, 2>, index, index) -> ()
        "scf.yield"() : () -> ()
      }) : (index, index, index) -> ()
      "scf.yield"() : () -> ()
    }) : (index, index, index) -> ()
    "scf.yield"() : () -> ()
  }) : (index, index, index) -> ()
  "memref.dealloc"(<<UNKNOWN SSA VALUE>>) : (memref<32x32xi32, 2>) -> ()
  "memref.dealloc"(<<UNKNOWN SSA VALUE>>) : (memref<32x32xi32, 2>) -> ()
  "memref.dealloc"(<<UNKNOWN SSA VALUE>>) : (memref<32x32xi32, 2>) -> ()
  "scf.yield"() : () -> ()
}) : (index, index, index) -> ()
Traceback (most recent call last):
  File "/home/niansong/mlir-air/install/bin/aircc.py", line 13, in <module>
    main()
  File "/home/niansong/mlir-air/install/python/air/compiler/aircc/main.py", line 316, in main
    run(module)
  File "/home/niansong/mlir-air/install/python/air/compiler/aircc/main.py", line 138, in run
    run_passes('builtin.module('+pass_pipeline+')', air_to_aie_module, opts,
  File "/home/niansong/mlir-air/install/python/air/compiler/aircc/main.py", line 77, in run_passes
    PassManager.parse(pass_pipeline).run(mlir_module)
RuntimeError: Failure while executing pass pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant