[PYTHON][RPC] Make rpc proxy jupyter friendly via PopenWorker.#7757
Merged
Conversation
Member
Author
tkonolige
reviewed
Mar 29, 2021
tkonolige
left a comment
Contributor
There was a problem hiding this comment.
I'm trying to run tests/python/contrib/test_rpc_proxy.py with this PR on my Mac, but its failing. The error is
INFO:root:RPCProxy: client port bind to localhost:9092
INFO:root:RPCProxy: Websock port bind to 8888
Traceback (most recent call last):
File "tests/python/contrib/test_rpc_proxy.py", line 75, in <module>
rpc_proxy_check()
File "tests/python/contrib/test_rpc_proxy.py", line 68, in rpc_proxy_check
check()
File "tests/python/contrib/test_rpc_proxy.py", line 62, in check
client = rpc.connect(prox.host, prox.port, key="x1")
File "/Users/tristan/octoml/tvm/python/tvm/rpc/client.py", line 501, in connect
sess = _ffi_api.Connect(url, port, key, *session_constructor_args)
File "/Users/tristan/octoml/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
[bt] (7) 8 ??? 0x00007ffeee90cf00 0x0 + 140732900888320
[bt] (6) 7 _ctypes.cpython-38-darwin.so 0x000000010199f177 ffi_call_unix64 + 79
[bt] (5) 6 libtvm.dylib 0x0000000127bd9526 TVMFuncCall + 70
[bt] (4) 5 libtvm.dylib 0x0000000127c4ebfb std::__1::__function::__func<tvm::runtime::$_0, std::__1::allocator<tvm::runtime::$_0>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 315
[bt] (3) 4 libtvm.dylib 0x0000000127c4dd73 tvm::runtime::RPCClientConnect(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tvm::runtime::TVMArgs) + 99
[bt] (2) 3 libtvm.dylib 0x0000000127c4c00a tvm::runtime::RPCConnect(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tvm::runtime::TVMArgs) + 570
[bt] (1) 2 libtvm.dylib 0x0000000126aba42c tvm::runtime::detail::LogFatal::~LogFatal() + 92
[bt] (0) 1 libtvm.dylib 0x0000000127bec748 tvm::runtime::Backtrace() + 24
File "/Users/tristan/octoml/tvm/src/runtime/rpc/rpc_socket_impl.cc", line 73
TVMError: ---------------------------------------------------------------
An internal invariant was violated during the execution of TVM.
Please read TVM's error reporting guidelines.
More details can be found here: https://discuss.tvm.ai/t/error-reporting/7793.
---------------------------------------------------------------
Check failed: sock.Connect(addr) == false: Connect to ::1:9092 failed
INFO:root:Terminating Proxy Server...
Is this expected?
| self.port = my_port | ||
| break | ||
| except socket.error as sock_err: | ||
| if sock_err.errno in [98, 48]: |
Member
Author
|
Thanks @tkonolige The particular error seems to also be the legacy issue of previous code of IPv6 and IPv4 mix. i have updated the test so it now works |
tkonolige
approved these changes
Mar 29, 2021
tkonolige
left a comment
Contributor
There was a problem hiding this comment.
Looks good! I tested it on my Mac with python 3.9.
junrushao
reviewed
Mar 31, 2021
Member
|
CC @zxybazh |
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…e#7757) * [PYTHON][RPC] Make rpc proxy jupyter friendly via PopenWorker. * Rework the contrib tests that was previous broken.
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…e#7757) * [PYTHON][RPC] Make rpc proxy jupyter friendly via PopenWorker. * Rework the contrib tests that was previous broken.
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…e#7757) * [PYTHON][RPC] Make rpc proxy jupyter friendly via PopenWorker. * Rework the contrib tests that was previous broken.
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
…e#7757) * [PYTHON][RPC] Make rpc proxy jupyter friendly via PopenWorker. * Rework the contrib tests that was previous broken.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the proxy relies multiprocessing to start a new process and does not work under jupyter. In the case of proxy however, we still need the tornado to help handle the web assembly wehpage hosting, so still need python in this particular case.
This PR switches that to use PopenWorker instead of multiprocessing.Process. We will send a worker function that: