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

Dynamic Object-FIFO lowering not functional #1884

Closed
andrej opened this issue Oct 25, 2024 · 1 comment · Fixed by #1907
Closed

Dynamic Object-FIFO lowering not functional #1884

andrej opened this issue Oct 25, 2024 · 1 comment · Fixed by #1907
Assignees

Comments

@andrej
Copy link
Collaborator

andrej commented Oct 25, 2024

Hi @AndraBisca @hunhoffe, I hope you guys are well.

I'm looking at the new Object-FIFO tests. I believe none of these tests use the dynamic lowering, as the --dynamic-objFifos option is missing from the aiecc.py call. This is confirmed by looking at the lowered MLIR, which does not contain any of the scf.index_switches that the dynamic lowering is supposed to emit.

If I do try to enable the dynamic lowering by adding the command line option, compilation fails at the buffer address assignment stage (--aie-assign-buffer-addresses) with this error:

aie-opt: /project/llvm-project/mlir/lib/IR/Types.cpp:134: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' failed.
Backtrace
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: aie-opt "--pass-pipeline=builtin.module(lower-affine,aie-canonicalize-device,aie.device(aie-assign-lock-ids,aie-register-objectFifos,aie-objectFifo-stateful-transform{ dynamic-objFifos=1 },aie-assign-bd-ids,aie-lower-cascade-flows,aie-lower-broadcast-packet,aie-lower-multicast,aie-assign-tile-controller-ids,aie-generate-column-control-overlay{ route-shim-to-tile-ctrl=0 },aie-assign-buffer-addresses{ basic-alloc=0 }),convert-scf-to-cf)" ./aie2.mlir
 #0 0x00005642438bbf7b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
 #1 0x00005642438b947b llvm::sys::RunSignalHandlers() Signals.cpp:0:0
 #2 0x00005642438b95a5 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f071e442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f071e4969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f071e4969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007f071e4969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007f071e442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007f071e4287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007f071e42871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007f071e439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00005642437d875d mlir::Type::getIntOrFloatBitWidth() const Types.cpp:0:0
#12 0x0000564241763e3a xilinx::AIE::BufferOp::getAllocationSize() AIEDialect.cpp:0:0
#13 0x00005642417e8e1d void std::__insertion_sort>(xilinx::AIE::BufferOp*, xilinx::AIE::BufferOp*, __gnu_cxx::__ops::_Iter_comp_iter) AIEAssignBuffers.cpp:0:0
#14 0x00005642417f2135 simpleBankAwareAllocation(xilinx::AIE::TileOp) AIEAssignBuffers.cpp:0:0
#15 0x00005642417f28b3 AIEAssignBufferAddressesPass::runOnOperation() AIEAssignBuffers.cpp:0:0
#16 0x00005642435f15ae mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) Pass.cpp:0:0
#17 0x00005642435f1a78 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) Pass.cpp:0:0
#18 0x00005642435f2123 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#19 0x00005642435f0aed mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) Pass.cpp:0:0
#20 0x00005642435f13df mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) Pass.cpp:0:0
#21 0x00005642435f1a78 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) Pass.cpp:0:0
#22 0x00005642435f2a05 mlir::PassManager::run(mlir::Operation*) Pass.cpp:0:0
#23 0x0000564241fe6ac7 performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#24 0x0000564241fe72d3 processBuffer(llvm::raw_ostream&, std::unique_ptr>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#25 0x0000564241fe7409 llvm::LogicalResult llvm::function_ref>, llvm::raw_ostream&)>::callback_fn>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr>, llvm::raw_ostream&)>(long, std::unique_ptr>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#26 0x00005642437f912f mlir::splitAndProcessBuffer(std::unique_ptr>, llvm::function_ref>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) ToolUtilities.cpp:0:0
#27 0x0000564241fdf78c mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#28 0x0000564241fe7540 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) MlirOptMain.cpp:0:0
#29 0x0000564241fe7a2e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) MlirOptMain.cpp:0:0
#30 0x000056423f8a8709 main aie-opt.cpp:0:0
#31 0x00007f071e429d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#32 0x00007f071e429e40 call_init ./csu/../csu/libc-start.c:128:20
#33 0x00007f071e429e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#34 0x000056423f896625 _start (/home/andre/mlir-aie/install/bin/aie-opt+0x197c625)

Please let me know if this is something I'm doing wrong. I'd be very interested in using this feature for my run-time-parametrized matrix multiplication.

@andrej andrej changed the title Dynamic Object-FIFO lowering Dynamic Object-FIFO lowering not functional Oct 25, 2024
@AndraBisca AndraBisca self-assigned this Oct 29, 2024
@pvasireddy-amd pvasireddy-amd linked a pull request Dec 6, 2024 that will close this issue
@AndraBisca
Copy link
Collaborator

Fixed by PR above.

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

Successfully merging a pull request may close this issue.

2 participants