Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG][Limitation][IR][AIE] Type mismatch in dynamic subview and static function interface for AIE backend #436

@Fangtangtang

Description

@Fangtangtang

Describe the bug
The background of this issue is the same as parent issue #435.

For the AIE backend, we currently choose to allocate new memref objects whose types match the expected static memref type and use them as arguments, rather than updating the interface types to dynamic.
This decision is mainly due to an issue in MLIR-AIE, which, as far as I remember, does not support dynamic memref types in function interfaces.

To Reproduce
top.zip

run aiecc.py --alloc-scheme=basic-sequential --aie-generate-xclbin --no-compile-host --xclbin-name=build/final.xclbin --no-xchesscc --no-xbridge --peano $PEANO_INSTALL_DIR --aie-generate-npu-insts --npu-insts-name=insts.txt top.mlir

Buggy output
error message:

 MLIR compilation: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% -:--:-- 0:00:00 0/1 1 Worker/top.prj/top.mlir.prj/input_with_addresses.mlir:388:7: error: 'llvm.call' op 'add_i16_vector' does not reference a valid LLVM function
      func.call @add_i16_vector(%fifo_4_buff_0, %subview, %_anonymous3) {lib = "add_i16_vector"} : (memref<16x16xi16>, memref<16x16xi16, strided<[16, 1], offset: ?>>, memref<16x16xi16>) -> ()
      ^
/top.prj/top.mlir.prj/input_with_addresses.mlir:388:7: note: see current operation: "llvm.call"(%795, %796, %797) <{CConv = #llvm.cconv<ccc>, TailCallKind = #llvm.tailcallkind<none>, callee = @add_i16_vector, fastmathFlags = #llvm.fastmath<none>, op_bundle_sizes = array<i32>, operandSegmentSizes = array<i32: 3, 0>}> {lib = "add_i16_vector"} : (!llvm.ptr, !llvm.ptr, !llvm.ptr) -> ()
Error encountered while running: aie-opt --pass-pipeline=builtin.module(aie.device(aie-localize-locks,aie-normalize-address-spaces),aie-standard-lowering,aiex-standard-lowering,canonicalize,cse,convert-vector-to-llvm,expand-strided-metadata,lower-affine,convert-math-to-llvm,convert-index-to-llvm,arith-expand,convert-arith-to-llvm,finalize-memref-to-llvm,convert-func-to-llvm{ use-bare-ptr-memref-call-conv=1 },convert-cf-to-llvm,canonicalize,cse) /top.prj/top.mlir.prj/input_with_addresses.mlir -o /top.prj/top.mlir.prj/input_opt_with_addresses.mlir

Additional context
Also discussed here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions