-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Enable python debug runtime for exported network libraries #8793
Conversation
fa58a4d
to
6103335
Compare
docs/dev/debugger.rst
Outdated
|
||
:: | ||
|
||
# Whether enable additional graph debug functions | ||
set(USE_GRAPH_EXECUTOR_DEBUG ON) | ||
set(USE_GRAPH_RUNTIME_DEBUG ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USE_GRAPH_EXECUTOR_DEBUG
and USE_GRAPH_RUNTIME_DEBUG
are deprecated. You should use USE_PROFILER
instead.
docs/dev/debugger.rst
Outdated
m = graph_executor.GraphModuleDebug(lib["debug_create"]("default", dev), | ||
[dev], lib["get_json"](), dump_root="/tmp/tvmdbg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does graph_executor.create
not work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please share how to pass lib to the second param of graph_executor.create? If I pass lib been created through tvm.runtime.load_module directly, it does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
graph_executor.create(lib["get_json"](), lib, dev, dump_root="/tmp/tvmdbg")
seems to work for me locally. Maybe I am testing it wrong though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, interesting. I tried the same code and it did not work, but when I tried your code snippet, everything started to work well. Will update the doc. I might not be required, but still there is a difference how to get the json between just compiled lib and loaded from the external dynamic library -lib["get_json"]()
Could you rename |
33517c9
to
146fe80
Compare
@tkonolige addressed comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, except for a little change on the tests.
def test_cpu_get_graph_json(): | ||
if not tvm.testing.device_enabled("llvm"): | ||
print("Skip because llvm is not enabled") | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_cpu_get_graph_json(): | |
if not tvm.testing.device_enabled("llvm"): | |
print("Skip because llvm is not enabled") | |
return | |
@tvm.testing.requires_llvm | |
def test_cpu_get_graph_json(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed together with other tests in this script
f86d00b
to
92ba85b
Compare
Signed-off-by: Alexander Peskov <peskovnn@gmail.com>
92ba85b
to
7b1f3f6
Compare
Thanks @elvin-n and @tkonolige. This is now merged. |
* main: [UnitTests][Contrib] Enable contrib tensorrt/coreml unit tests (apache#8902) [BUG] DataType Bug In SplitRel (apache#8899) Enable python debug runtime for exported network libraries (apache#8793) Set default value of p in LpPool as 2 (apache#8866) [Community] @Hzfengsy -> Committer (apache#8908) Trivial uTVM -> microTVM "spelling" fix to align with branding. (apache#8905) [Vulkan][Topi] Parametrizing additional topi tests, marking vulkan failures (apache#8904) Move to new style issue template system (apache#8898) [Onnx] Support Negative Log Loss (apache#8872) [ROCm][TVMC] Add ROCm to the TVMC driver (apache#8896) fix error report on Store (apache#8895) [Docker] Re-enabled automatic --tty flag when running bash. (apache#8861)
* Add get_json method to graph_eceutor factory Signed-off-by: Alexander Peskov <peskovnn@gmail.com> * Update Debugger runtime documentation for exported libraries * Fix cpplint * Change module get_json to get_graph_json, add test * Fix get_graph_json test * Change verificatino of llvm support in tet to decorator * Fix sphinx warning in debugger.rst Co-authored-by: Alexander Peskov <peskovnn@gmail.com>
* Add get_json method to graph_eceutor factory Signed-off-by: Alexander Peskov <peskovnn@gmail.com> * Update Debugger runtime documentation for exported libraries * Fix cpplint * Change module get_json to get_graph_json, add test * Fix get_graph_json test * Change verificatino of llvm support in tet to decorator * Fix sphinx warning in debugger.rst Co-authored-by: Alexander Peskov <peskovnn@gmail.com>
Python debug runtime object require json for its initialization, but in case of previously exported library, json is not accessible outside of the compiled module. Added PAcked func "get_json" to module and updated documentation how to init python debug_executor for this case