-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This issue keeps track of the problem I met when I tried to do all the dataflow transformations in Python.
If we create separate contexts for different modules, this issue will occur.
#0 0x00007f356ba64d58 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x185cd58)
#1 0x00007f356ba625dc SignalHandler(int) Signals.cpp:0:0
#2 0x00007f35e6598630 __restore_rt sigaction.c:0:0
#3 0x00007f356b7885f4 mlir::TypeID::operator==(mlir::TypeID const&) const /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/Support/TypeID.h:116:12
#4 0x00007f356b7ca0cf mlir::TypeID::operator!=(mlir::TypeID const&) const /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/Support/TypeID.h:119:28
#5 0x00007f356b7cb1e2 mlir::OperationName::Impl::isRegistered() const /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/IR/OperationSupport.h:158:71
#6 0x00007f356b7cb24c mlir::OperationName::isRegistered() const /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/IR/OperationSupport.h:230:65
#7 0x00007f356b7cb424 mlir::OperationName::getRegisteredInfo() const /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/IR/OperationSupport.h:693:66
#8 0x00007f356b7cbc42 mlir::Operation::getRegisteredInfo() /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/IR/Operation.h:124:40
#9 0x00007f356b7ff24c mlir::Op<mlir::func::FuncOp, mlir::OpTrait::OneRegion, mlir::OpTrait::ZeroResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::ZeroOperands, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpTrait::AffineScope, mlir::OpTrait::AutomaticAllocationScope, mlir::CallableOpInterface::Trait, mlir::SymbolOpInterface::Trait, mlir::FunctionOpInterface::Trait, mlir::OpTrait::IsIsolatedFromAbove, mlir::OpAsmOpInterface::Trait>::classof(mlir::Operation*) /work/shared/users/common/llvm-project-18.x/mlir/include/mlir/IR/OpDefinition.h:1706:42
#10 0x00007f356c22ab4c mlir::detail::FunctionOpInterfaceInterfaceTraits::Model<mlir::func::FuncOp>::getArgAttrsAttr(mlir::detail::FunctionOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*) (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x2022b4c)
#11 0x00007f356b95ccf4 (anonymous namespace)::OperationVerifier::verifyOperation(mlir::Operation&) Verifier.cpp:0:0
#12 0x00007f356b95f436 mlir::verify(mlir::Operation*, bool) (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x1757436)
#13 0x00007f356b852021 verifyOpAndAdjustFlags(mlir::Operation*, mlir::OpPrintingFlags) AsmPrinter.cpp:0:0
#14 0x00007f356b865a7d mlir::AsmState::AsmState(mlir::Operation*, mlir::OpPrintingFlags const&, llvm::DenseMap<mlir::Operation*, std::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, std::pair<unsigned int, unsigned int>>>*, mlir::FallbackAsmResourceMap*) (.constprop.0) AsmPrinter.cpp:0:0
#15 0x00007f356b86ebfe mlir::Operation::print(llvm::raw_ostream&, mlir::OpPrintingFlags const&) (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x1666bfe)
#16 0x00007f356b7821e9 mlirOperationPrintWithFlags (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x157a1e9)
#17 0x00007f3572b6401a mlir::python::PyOperationBase::print(pybind11::object, bool, std::optional<long>, bool, bool, bool, bool, bool) /work/shared/users/common/llvm-project-18.x/mlir/lib/Bindings/Python/IRCore.cpp:1166:29
Otherwise, if the modules are created under the same context, just like what has been implemented in #195 (see this line). The program randomly fails when we try to compose a large systolic array.
python3: /work/shared/users/common/llvm-project-18.x/mlir/lib/Bindings/Python/IRCore.cpp:1112: static mlir::python::PyOperationRef mlir::python::PyOperation::createDetached(mlir::python::PyMlirContextRef, MlirOperation, pybind11::object): Assertion `liveOperations.count(operation.ptr) == 0 && "cannot create detached operation that already exists"' failed.
#0 0x00007f260db6cd58 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/work/shared/users/common/hcl-dialect-18.x/build-py312/tools/hcl/python_packages/hcl_core/hcl_mlir/_mlir_libs/libHCLMLIRAggregateCAPI.so.18git+0x185cd58)
#1 0x00007f260db6a5dc SignalHandler(int) Signals.cpp:0:0
#2 0x00007f26886a1630 __restore_rt sigaction.c:0:0
#3 0x00007f2687bf1387 raise (/lib64/libc.so.6+0x36387)
#4 0x00007f2687bf2a78 abort (/lib64/libc.so.6+0x37a78)
#5 0x00007f2687bea1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#6 0x00007f2687bea252 (/lib64/libc.so.6+0x2f252)
#7 0x00007f2614c6ba5b mlir::python::PyOperation::createDetached(mlir::python::PyObjectRef<mlir::python::PyMlirContext>, MlirOperation, pybind11::object) /work/shared/users/common/llvm-project-18.x/mlir/lib/Bindings/Python/IRCore.cpp:1112:3
#8 0x00007f2614c6d815 mlir::python::PyOperation::create(std::string const&, std::optional<std::vector<mlir::python::PyType*, std::allocator<mlir::python::PyType*>>>, std::optional<std::vector<mlir::python::PyValue*, std::allocator<mlir::python::PyValue*>>>, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, int, mlir::python::DefaultingPyLocation, pybind11::object const&, bool) /work/shared/users/common/llvm-project-18.x/mlir/lib/Bindings/Python/IRCore.cpp:1406:68
#9 0x00007f2614c70473 mlir::python::PyOpView::buildGeneric(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&) /work/shared/users/common/llvm-project-18.x/mlir/lib/Bindings/Python/IRCore.cpp:1711:45
#10 0x00007f2614d32059 pybind11::object pybind11::detail::argument_loader<pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&>::call_impl<pybind11::object, pybind11::object (*&)(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&), 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, pybind11::detail::void_type>(pybind11::object (*&)(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&), std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul>, pybind11::detail::void_type&&) && /work/shared/users/phd/hc676/envs/allo312/lib/python3.12/site-packages/pybind11/include/pybind11/cast.h:1480:91
#11 0x00007f2614d209a2 _ZNO8pybind116detail15argument_loaderIJRKNS_6objectESt8optionalINS_4listEES6_S5_INS_4dictEES5_ISt6vectorIPN4mlir6python7PyBlockESaISE_EEES5_IiENSC_20DefaultingPyLocationES4_EE4callIS2_NS0_9void_typeERPFS2_S4_S7_S6_S9_SH_SI_SJ_S4_EEENSt9enable_ifIXntsrSt7is_voidIT_E5valueESS_E4typeEOT1_ /work/shared/users/phd/hc676/envs/allo312/lib/python3.12/site-packages/pybind11/include/pybind11/cast.h:1450:5
#12 0x00007f2614d097ec void pybind11::cpp_function::initialize<pybind11::object (*&)(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&), pybind11::object, pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&, pybind11::arg, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, char const*>(pybind11::object (*&)(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&), pybind11::object (*)(pybind11::object const&, std::optional<pybind11::list>, pybind11::list, std::optional<pybind11::dict>, std::optional<std::vector<mlir::python::PyBlock*, std::allocator<mlir::python::PyBlock*>>>, std::optional<int>, mlir::python::DefaultingPyLocation, pybind11::object const&), pybind11::arg const&, pybind11::arg_v const&, pybind11::arg_v const&, pybind11::arg_v const&, pybind11::arg_v const&, pybind11::arg_v const&, pybind11::arg_v const&, pybind11::arg_v const&, char const* const&)::'lambda1'(pybind11::detail::function_call&)::operator()(pybind11::detail::function_call&) const /work/shared/users/phd/hc676/envs/allo312/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:253:40
We also encountered this issue before when we built HeteroCL (see cornell-zhang/hcl-dialect#68).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working