Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Created March 1, 2024 07:30
Show Gist options
  • Save AmosLewis/0b58eb2360b88450bfb478e4f58f4633 to your computer and use it in GitHub Desktop.
Save AmosLewis/0b58eb2360b88450bfb478e4f58f4633 to your computer and use it in GitHub Desktop.
(mlir_venv) ➜ torch-mlir git:(reduceprodfix) ✗ gdb --arg python -m e2e_testing.main --config=onnx --filter BernoulliModule_basic -v
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(No debugging symbols found in python)
(gdb) run
Starting program: /home/chi/src/torch-mlir/mlir_venv/bin/python -m e2e_testing.main --config=onnx --filter BernoulliModule_basic -v
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdafff640 (LWP 194085)]
[New Thread 0x7fffda7fe640 (LWP 194086)]
[New Thread 0x7fffd7ffd640 (LWP 194087)]
[New Thread 0x7fffd57fc640 (LWP 194088)]
[New Thread 0x7fffd2ffb640 (LWP 194089)]
[New Thread 0x7fffd07fa640 (LWP 194090)]
[New Thread 0x7fffcdff9640 (LWP 194091)]
[New Thread 0x7fffcb7f8640 (LWP 194092)]
[New Thread 0x7fffc8ff7640 (LWP 194093)]
[New Thread 0x7fffc67f6640 (LWP 194094)]
[New Thread 0x7fffc3ff5640 (LWP 194095)]
[New Thread 0x7fffc17f4640 (LWP 194096)]
[New Thread 0x7fffbeff3640 (LWP 194097)]
[New Thread 0x7fffbc7f2640 (LWP 194098)]
[New Thread 0x7fffb7ff1640 (LWP 194099)]
[New Thread 0x7fffb77f0640 (LWP 194100)]
[New Thread 0x7fffb4fef640 (LWP 194101)]
[New Thread 0x7fffb27ee640 (LWP 194102)]
[New Thread 0x7fffadfed640 (LWP 194103)]
[New Thread 0x7fffad7ec640 (LWP 194104)]
[New Thread 0x7fffaafeb640 (LWP 194105)]
[New Thread 0x7fffa87ea640 (LWP 194106)]
[New Thread 0x7fffa5fe9640 (LWP 194107)]
[New Thread 0x7fffa37e8640 (LWP 194108)]
[New Thread 0x7fff9efe7640 (LWP 194109)]
[New Thread 0x7fff9e7e6640 (LWP 194110)]
[New Thread 0x7fff99fe5640 (LWP 194111)]
[New Thread 0x7fff997e4640 (LWP 194112)]
[New Thread 0x7fff96fe3640 (LWP 194113)]
[New Thread 0x7fff947e2640 (LWP 194114)]
[New Thread 0x7fff8ffe1640 (LWP 194115)]
TORCH_VERSION_FOR_COMPARISON = 2.3.0.dev20240207
[New Thread 0x7fff6f3fd640 (LWP 194220)]
[New Thread 0x7fff6ebfc640 (LWP 194221)]
[New Thread 0x7fff6e3fb640 (LWP 194222)]
[New Thread 0x7fff6dbfa640 (LWP 194223)]
[New Thread 0x7fff6d3f9640 (LWP 194224)]
[New Thread 0x7fff6cbf8640 (LWP 194225)]
[New Thread 0x7fff6c3f7640 (LWP 194226)]
[New Thread 0x7fff6bbf6640 (LWP 194227)]
[New Thread 0x7fff6b3f5640 (LWP 194228)]
[New Thread 0x7fff6abf4640 (LWP 194229)]
[New Thread 0x7fff6a3f3640 (LWP 194230)]
[New Thread 0x7fff69bf2640 (LWP 194231)]
[New Thread 0x7fff693f1640 (LWP 194232)]
[New Thread 0x7fff68bf0640 (LWP 194233)]
[New Thread 0x7fff683ef640 (LWP 194234)]
Compiling BernoulliModule_basic...
/home/chi/src/torch-mlir/build/tools/torch-mlir/python_packages/torch_mlir/torch_mlir_e2e_test/test_suite/rng.py:195: UserWarning: std(): degrees of freedom is <= 0. Correction should be strictly less than the reduction factor (input numel divided by output numel). (Triggered internally at ../aten/src/ATen/native/ReduceOps.cpp:1776.)
std = torch.std(a)
python: /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/UseDefLists.h:198: mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList() [OperandType = mlir::OpOperand]: Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
Thread 1 "python" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352548352) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352548352)
at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140737352548352)
at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140737352548352, signo=signo@entry=6)
at ./nptl/pthread_kill.c:89
#3 0x00007ffff7c42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007ffff7c287f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007ffff7c2871b in __assert_fail_base (
fmt=0x7ffff7ddd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=0x7fff854fa7b1 "use_empty() && \"Cannot destroy a value that still has uses!\"",
file=0x7fff8546088c "/home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/UseDefLists.h", line=198, function=<optimized out>) at ./assert/assert.c:92
#6 0x00007ffff7c39e96 in __GI___assert_fail (
assertion=0x7fff854fa7b1 "use_empty() && \"Cannot destroy a value that still has uses!\"",
file=0x7fff8546088c "/home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/UseDefLists.h", line=198,
function=0x7fff854fa7ee "mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList() [OperandType = mlir::OpOperand]") at ./assert/assert.c:101
#7 0x00007fff7b82b7f8 in mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList
(this=0x776d080)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/UseDefLists.h:198
#8 0x00007fff7b82b785 in mlir::detail::ValueImpl::~ValueImpl (this=0x776d080)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/Value.h:40
#9 0x00007fff7b82b765 in mlir::detail::BlockArgumentImpl::~BlockArgumentImpl (
this=0x776d080)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/Value.h:289
#10 0x00007fff7b82a55c in mlir::BlockArgument::destroy (this=0x7fffffffb108)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/Value.h:341
#11 0x00007fff7b828789 in mlir::Block::~Block (this=0x776d030)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/IR/Block.cpp:23
#12 0x00007fff842c5bf8 in (anonymous namespace)::CreateBlockRewrite::rollback (
this=0x776d0e0)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:281
#13 0x00007fff842a7fb8 in mlir::detail::ConversionPatternRewriterImpl::undoRewrites (
this=0x77ccc30, numRewritesToKeep=0)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:1182
#14 0x00007fff842acdff in mlir::OperationConverter::convertOperations (
this=0x7fffffffb328, ops=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2513
#15 0x00007fff842b19e9 in mlir::applyPartialConversion (ops=..., target=...,
patterns=..., config=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3501
#16 0x00007fff842b1b1a in mlir::applyPartialConversion (op=0x754f380, target=...,
patterns=..., config=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3507
#17 0x00007fff82f124d6 in (anonymous namespace)::ConvertTorchToLinalg::runOnOperation (
this=0x773ae80)
--Type <RET> for more, q to quit, c to continue without paging--
at /home/chi/src/torch-mlir/lib/Conversion/TorchToLinalg/TorchToLinalg.cpp:87
#18 0x00007fff7b5b2b8b in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const (
this=0x7fffffffba98)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:519
#19 0x00007fff7b5b2b25 in llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) (callable=140737488337560)
at /home/chi/src/torch-mlir/externals/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45
#20 0x00007fff7b5bff39 in llvm::function_ref<void ()>::operator()() const (
this=0x7fffffffba20)
at /home/chi/src/torch-mlir/externals/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68
#21 0x00007fff7b5b5c45 in mlir::MLIRContext::executeAction<mlir::PassExecutionAction, mlir::Pass&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pass&) (
this=0x7455790, actionFn=..., irUnits=..., args=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/MLIRContext.h:275
#22 0x00007fff7b5ae2e3 in mlir::detail::OpToOpPassAdaptor::run (pass=0x773ae80,
op=0x754f380, am=..., verifyPasses=true, parentInitGeneration=1)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:513
#23 0x00007fff7b5ae864 in mlir::detail::OpToOpPassAdaptor::runPipeline (pm=...,
op=0x754f380, am=..., verifyPasses=true, parentInitGeneration=1, instrumentor=0x0,
parentInfo=0x7fffffffbfe8)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:585
#24 0x00007fff7b5af6be in mlir::detail::OpToOpPassAdaptor::runOnOperationImpl (
this=0x7645000, verifyPasses=true)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:726
#25 0x00007fff7b5aef6d in mlir::detail::OpToOpPassAdaptor::runOnOperation (
this=0x7645000, verifyPasses=true)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:708
#26 0x00007fff7b5b2b76 in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const (
this=0x7fffffffc188)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:517
#27 0x00007fff7b5b2b25 in llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) (callable=140737488339336)
at /home/chi/src/torch-mlir/externals/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45
#28 0x00007fff7b5bff39 in llvm::function_ref<void ()>::operator()() const (
this=0x7fffffffc110)
at /home/chi/src/torch-mlir/externals/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68
#29 0x00007fff7b5b5c45 in mlir::MLIRContext::executeAction<mlir::PassExecutionAction, mlir::Pass&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pass&) (
this=0x7455790, actionFn=..., irUnits=..., args=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/include/mlir/IR/MLIRContext.h:275
#30 0x00007fff7b5ae2e3 in mlir::detail::OpToOpPassAdaptor::run (pass=0x7645000,
op=0x75c94f0, am=..., verifyPasses=true, parentInitGeneration=1)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:513
#31 0x00007fff7b5ae864 in mlir::detail::OpToOpPassAdaptor::runPipeline (pm=...,
op=0x75c94f0, am=..., verifyPasses=true, parentInitGeneration=1, instrumentor=0x0,
parentInfo=0x0)
--Type <RET> for more, q to quit, c to continue without paging--
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:585
#32 0x00007fff7b5b02a8 in mlir::PassManager::runPasses (this=0x797db00, op=0x75c94f0,
am=...) at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:896
#33 0x00007fff7b5b01d2 in mlir::PassManager::run (this=0x797db00, op=0x75c94f0)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Pass/Pass.cpp:876
#34 0x00007fff7b410662 in mlirPassManagerRunOnOp (passManager=..., op=...)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/CAPI/IR/Pass.cpp:44
#35 0x00007fff8b14b322 in mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5::operator()((anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool) const (this=0x4f5ec08, passManager=..., op=..., invalidateOps=true)
at /home/chi/src/torch-mlir/externals/llvm-project/mlir/lib/Bindings/Python/Pass.cpp:127
#36 0x00007fff8b14b223 in pybind11::detail::argument_loader<(anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool>::call_impl<void, mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&, 0ul, 1ul, 2ul, pybind11::detail::void_type>(mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, pybind11::detail::void_type&&) && (this=0x7fffffffcb90, f=...)
at /home/chi/src/torch-mlir/mlir_venv/lib/python3.11/site-packages/pybind11/include/pybind11/detail/../cast.h:1480
#37 0x00007fff8b14af21 in pybind11::detail::argument_loader<(anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool>::call<void, pybind11::detail::void_type, mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&>(mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&) && (this=0x7fffffffcb90, f=...)
at /home/chi/src/torch-mlir/mlir_venv/lib/python3.11/site-packages/pybind11/include/pybind11/detail/../cast.h:1454
#38 0x00007fff8b14ae3d in pybind11::cpp_function::initialize<mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5, void, (anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool, pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::arg, pybind11::arg_v, char [81]>(mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&&, void (*)((anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, pybind11::arg const&, pybind11::arg_v const&, char const (&) [81])::{lambda(pybind11::detail::function_call&)#1}::operator()(pybind11::detail::function_call&) const (
this=0x7fffffffcbff, call=...)
at /home/chi/src/torch-mlir/mlir_venv/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:254
#39 0x00007fff8b14ad09 in pybind11::cpp_function::initialize<mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5, void, (anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool, pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::arg, pybind11::arg_v, char [81]>(mlir::python::populatePassManagerSubmodule(pybind11::module_&)::$_5&&, void (*)((anonymous namespace)::PyPassManager&, mlir::python::PyOperationBase&, bool), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, pybind11::arg const&, pybind11::arg_v const&, char const (&) [81])::{lambda(pybind11::detail::function_call&)#1}::__invoke(pybind11::detail::function_call&) (call=...)
at /home/chi/src/torch-mlir/mlir_venv/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:224
#40 0x00007fff8ae46703 in pybind11::cpp_function::dispatcher (self=0x7fff8ad29b90,
args_in=0x7fff7248f280, kwargs_in=0x0)
at /home/chi/src/torch-mlir/mlir_venv/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:946
#41 0x0000000000554cbb in ?? ()
#42 0x000000000052edac in _PyObject_MakeTpCall ()
#43 0x000000000053cf5d in _PyEval_EvalFrameDefault ()
#44 0x00000000006129b4 in ?? ()
#45 0x0000000000612017 in PyEval_EvalCode ()
#46 0x000000000062bdb3 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
#47 0x000000000054aa5b in ?? ()
#48 0x000000000054a945 in PyObject_Vectorcall ()
#49 0x000000000053cf5d in _PyEval_EvalFrameDefault ()
#50 0x0000000000565b53 in _PyFunction_Vectorcall ()
#51 0x000000000063dbe0 in ?? ()
#52 0x000000000063d53c in Py_RunMain ()
#53 0x000000000060339d in Py_BytesMain ()
#54 0x00007ffff7c29d90 in __libc_start_call_main (main=main@entry=0x6032f0,
argc=argc@entry=7, argv=argv@entry=0x7fffffffdc98)
at ../sysdeps/nptl/libc_start_call_main.h:58
#55 0x00007ffff7c29e40 in __libc_start_main_impl (main=0x6032f0, argc=7,
argv=0x7fffffffdc98, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdc88) at ../csu/libc-start.c:392
#56 0x0000000000603225 in _start ()
(gdb)
@AmosLewis
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment