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

[CMake] Expose backtrace symbols in Debug mode #3001

Merged
merged 1 commit into from
Apr 10, 2019

Conversation

hcho3
Copy link
Contributor

@hcho3 hcho3 commented Apr 10, 2019

Remove -fvisibility=hidden flag when the build mode is set to Debug, to expose more symbols in the backtrace.

BEFORE:

tvm._ffi.base.TVMError: Traceback (most recent call last):
  [bt] (8) /home/ubuntu/tvm/build/libtvm.so(+0xc0497b) [0x7f51fdc3e97b]
  [bt] (7) /home/ubuntu/tvm/build/libtvm.so(+0xc0227c) [0x7f51fdc3c27c]
  [bt] (6) /home/ubuntu/tvm/build/libtvm.so(+0xc03a0d) [0x7f51fdc3da0d]
  [bt] (5) /home/ubuntu/tvm/build/libtvm.so(+0xc048a4) [0x7f51fdc3e8a4]
  [bt] (4) /home/ubuntu/tvm/build/libtvm.so(+0xc059ca) [0x7f51fdc3f9ca]
  [bt] (3) /home/ubuntu/tvm/build/libtvm.so(+0xc062c9) [0x7f51fdc402c9]
  [bt] (2) /home/ubuntu/tvm/build/libtvm.so(+0xc0688f) [0x7f51fdc4088f]
  [bt] (1) /home/ubuntu/tvm/build/libtvm.so(+0xcb2ea1) [0x7f51fdcecea1]
  [bt] (0) /home/ubuntu/tvm/build/libtvm.so(+0x47ee32) [0x7f51fd4b8e32]
  File "/home/ubuntu/tvm/src/relay/pass/quantize.cc", line 315
TVMError: Check failed: lhs->dtype == dtype (int8 vs. int32)

AFTER:

tvm._ffi.base.TVMError: Traceback (most recent call last):
  [bt] (8) /home/ubuntu/tvm/build/libtvm.so(std::_Function_handler<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*), tvm::runtime::TypedPackedFunc<tvm::relay::Expr
 (tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>::AssignTypedLambda<tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Array<tvm
::relay::Expr, void> const&, tvm::NodeRef const&)>(tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&))::{lambda(
tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}>::_M_invoke(std::_Any_data const&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&)+0x4f) [0x7fdec2652b5
5]
  [bt] (7) /home/ubuntu/tvm/build/libtvm.so(tvm::runtime::TypedPackedFunc<tvm::relay::Expr (tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRe
f const&)>::AssignTypedLambda<tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>(tvm::relay::Expr (*)(tvm::rela
y::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&))::{lambda(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}::operator()(tvm::run
time::TVMArgs const&, tvm::runtime::TVMRetValue*) const+0x3a) [0x7fdec265044e]
  [bt] (6) /home/ubuntu/tvm/build/libtvm.so(void tvm::runtime::detail::unpack_call<tvm::relay::Expr, 3, tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Array<tvm::relay
::Expr, void> const&, tvm::NodeRef const&)>(tvm::relay::Expr (* const&)(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&), tvm::runt
ime::TVMArgs const&, tvm::runtime::TVMRetValue*)+0x2b) [0x7fdec2651be7]
  [bt] (5) /home/ubuntu/tvm/build/libtvm.so(void tvm::runtime::detail::unpack_call_dispatcher<tvm::relay::Expr, 3, 0, tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Ar
ray<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>::run<>(tvm::relay::Expr (* const&)(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeR
ef const&), tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)+0x5a) [0x7fdec2652a7e]
  [bt] (4) /home/ubuntu/tvm/build/libtvm.so(void tvm::runtime::detail::unpack_call_dispatcher<tvm::relay::Expr, 2, 1, tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Ar
ray<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>::run<tvm::runtime::TVMArgValue>(tvm::relay::Expr (* const&)(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr,
 void> const&, tvm::NodeRef const&), tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*, tvm::runtime::TVMArgValue&&)+0x73) [0x7fdec2653ba4]
  [bt] (3) /home/ubuntu/tvm/build/libtvm.so(void tvm::runtime::detail::unpack_call_dispatcher<tvm::relay::Expr, 1, 2, tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Ar
ray<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>::run<tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue>(tvm::relay::Expr (* const&)(tvm::relay::Call const&, t
vm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&), tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*, tvm::runtime::TVMArgValue&&, tvm::runtime::TVMArg
Value&&)+0x8a) [0x7fdec26544a3]
  [bt] (2) /home/ubuntu/tvm/build/libtvm.so(void tvm::runtime::detail::unpack_call_dispatcher<tvm::relay::Expr, 0, 3, tvm::relay::Expr (*)(tvm::relay::Call const&, tvm::Ar
ray<tvm::relay::Expr, void> const&, tvm::NodeRef const&)>::run<tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue>(tvm::relay::Expr (* const&)
(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&), tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*, tvm::runtime::TVMArgVa
lue&&, tvm::runtime::TVMArgValue&&, tvm::runtime::TVMArgValue&&)+0xa6) [0x7fdec2654a69]
  [bt] (1) /home/ubuntu/tvm/build/libtvm.so(tvm::relay::quantize::MulRealize(tvm::relay::Call const&, tvm::Array<tvm::relay::Expr, void> const&, tvm::NodeRef const&)+0x431
) [0x7fdec270177b]
  [bt] (0) /home/ubuntu/tvm/build/libtvm.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x4a) [0x7fdec1ec9786]
  File "/home/ubuntu/tvm/src/relay/pass/quantize.cc", line 315
TVMError: Check failed: lhs->dtype == dtype (int8 vs. int32)

@tqchen
Copy link
Member

tqchen commented Apr 10, 2019

Looks good. One thing that I noticed is that maybe we need to add force inline macro(like those in mshadow) to many of the unpack call dispatcher so they are properly inlined

@tqchen tqchen merged commit 9cf622b into apache:master Apr 10, 2019
@hcho3 hcho3 deleted the debug_symbols branch April 10, 2019 05:19
wweic pushed a commit to wweic/tvm that referenced this pull request Apr 10, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Apr 11, 2019
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 this pull request may close these issues.

2 participants