You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/13 06:45:19 UTC

[GitHub] [tvm] zhaiyi000 opened a new issue #9268: [Bug]

zhaiyi000 opened a new issue #9268:
URL: https://github.com/apache/tvm/issues/9268


   Environment: MacBook Pro (15-inch, 2017), iPhone 12
   
   I followed this tutorial, https://github.com/apache/tvm/tree/main/apps/ios_rpc, but an error was reported when the dynamic library was loaded on the iPhone.
   
   
   ```
   (py38) zy@diyideMacBook-Pro ios_rpc % python3 tests/ios_rpc_test.py --host '0.0.0.0' --port 9090 --mode "proxy"
   [14:18:44] /Users/zy/Desktop/tvm/src/target/opt/build_metal_off.cc:31: Warning: Metal runtime not enabled, return a source module...
   Traceback (most recent call last):
     File "tests/ios_rpc_test.py", line 115, in <module>
       test_rpc_module(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_test.py", line 78, in test_rpc_module
       f1 = remote.load_module("dev_lib.dylib")
     File "/Users/zy/Desktop/tvm/python/tvm/rpc/client.py", line 161, in load_module
       return _ffi_api.LoadRemoteModule(self._sess, path)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x000000011a8db511 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x000000011a8d3f4c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x000000011a8cc05d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x000000011a8ca92e tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x000000011a8cabce tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x000000011a8cec42 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x000000011a8d0bd5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x00000001194256c9 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x000000011a86a688 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   tvmrpc                              0x0000000100678c74 std::__1::__function::__alloc_func<tvm::runtime::$_2, std::__1::allocator<tvm::runtime::$_2>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (7) 8   tvmrpc                              0x0000000100678cc8 void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (6) 7   tvmrpc                              0x0000000100678d58 decltype(std::__1::forward<tvm::runtime::$_2&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (5) 6   tvmrpc                              0x0000000100678df4 tvm::runtime::$_2::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 124
     [bt] (4) 5   tvmrpc                              0x0000000100679028 tvm::runtime::UnsignedDSOLoader::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 312
     [bt] (3) 4   tvmrpc                              0x000000010065cfac tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   tvmrpc                              0x000000010065f6d8 tvm::runtime::detail::LogFatal::~LogFatal() + 64
     [bt] (1) 2   tvmrpc                              0x000000010066d6d4 tvm::runtime::detail::LogFatalImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 104
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000100c55740 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [14:18:44] /Users/zy/Desktop/tvm/apps/ios_rpc/tvmrpc/TVMRuntime.mm:98: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (lib_handle_ != nullptr) is false: Failed to load dynamic shared library /private/var/mobile/Containers/Data/Application/E1CAE739-58A5-4C1B-83A0-69725DB6BC7C/tmp/dev_lib.dylib Error happens during dlopen execution. Unimplemented
   ```
   
   
   
   I tried to change arch to `arm64e` in file `tests/ios_rpc_test.py`, but still the same error
   ```
   # Change target configuration, this is setting for iphone6s
   arch = "arm64"
   sdk = "iphoneos"
   target = "llvm -mtriple=%s-apple-darwin" % arch
   ```
   
   
   I tried to search this question, but I did not find any relevant discussion. If this issue has already been discussed, I am very sorry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-945719054


   @echuraev Thank you.
   What I am doing now is to use tvm tuning operator executed on iPhone. Why asked the above question is I just want to make `tests/ios_rpc_mobilenet.py` run through. If it doesn’t work, it’s not a big problem. I will solve it for later. 
   The two blogs you recommended are very useful to me, thank you again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943423144


   Hi @zhaiyi000!
   
   > @apeskov Encountered another error when executing the following code.
   It looks like you should compile your runtime with CoreML support. Please, use this parameter when you built runtime: `-DUSE_COREML=ON`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev edited a comment on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev edited a comment on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943452534


   @zhaiyi000, I tried to reproduce your issue connected to the Metal locally and I wasn't able to do that. Also, I have some doubts about this warning message in your log: `Warning: Metal runtime not enabled, return a source module...`. It looks like that first time you have compiled runtime w/o Metal support. 
   
   Steps how I tried to reproduce your problem:
   1. `cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_VERSION=14.0 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON -DUSE_IOS_RPC=ON -DUSE_METAL=ON -DUSE_COREML=ON`
   2. `cmake --build . --target custom_dso_loader tvm_runtime`
   3. Install ios_rpc on my iphone and run it in tracker mode.
   4. Run `python3 tests/ios_rpc_test.py --host 0.0.0.0 --port 9190 --mode=tracker`
   
   Also, I double-checked it in the proxy mode and it works fine for me. Please try one again and let me know if you still have this issue. Also, what XCode version do you use?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-944902602


   @echuraev Thank you. 
   `run(model, "metal")` works very well now.
   But execute `run(annotate(model, "coremlcompiler"), target_host)`, after the computer is compiled and uploaded, when executed on the iPhone, xcode throws an exception
   ```
   2021-10-16 19:30:00.082837+0800 tvmrpc[24033:5508426] [connection] nw_connection_copy_connected_path [C1] Client called nw_connection_copy_connected_path on unconnected nw_connection
   2021-10-16 19:30:00.082914+0800 tvmrpc[24033:5508426] [] tcp_connection_is_cellular No connected path
   2021-10-16 19:30:00.178449+0800 tvmrpc[24033:5508395] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1 192.168.123.171:56605 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for read_timeout failed
   2021-10-16 19:30:00.178629+0800 tvmrpc[24033:5508395] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1 192.168.123.171:56605 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for write_timeout failed
   2021-10-16 19:30:03.586896+0800 tvmrpc[24033:5508426] /Users/zy/Desktop/tvm/apps/ios_rpc_iphone12/tvmrpc/TVMRuntime.mm:82: Load module from /private/var/mobile/Containers/Data/Application/049E42F5-6672-4B0A-8D6E-95DE16CC4F9C/tmp/deploy.dylib ...
   2021-10-16 19:30:04.436543+0800 tvmrpc[24033:5508426] (null)
   2021-10-16 19:31:46.745035+0800 tvmrpc[24033:5508426] [connection] nw_connection_copy_connected_path [C2] Client called nw_connection_copy_connected_path on unconnected nw_connection
   2021-10-16 19:31:46.745188+0800 tvmrpc[24033:5508426] [] tcp_connection_is_cellular No connected path
   2021-10-16 19:31:46.746912+0800 tvmrpc[24033:5508395] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2 192.168.123.171:56703 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for read_timeout failed
   2021-10-16 19:31:46.747127+0800 tvmrpc[24033:5508395] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2 192.168.123.171:56703 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for write_timeout failed
   2021-10-16 19:31:51.136775+0800 tvmrpc[24033:5508426] Metal API Validation Enabled
   2021-10-16 19:31:51.189247+0800 tvmrpc[24033:5508426] /Users/zy/Desktop/tvm/apps/ios_rpc_iphone12/tvmrpc/TVMRuntime.mm:82: Load module from /private/var/mobile/Containers/Data/Application/049E42F5-6672-4B0A-8D6E-95DE16CC4F9C/tmp/deploy.dylib ...
   2021-10-16 19:31:55.656934+0800 tvmrpc[24033:5508426] (null)
   2021-10-16 19:33:08.756917+0800 tvmrpc[24033:5508426] [connection] nw_connection_copy_connected_path [C3] Client called nw_connection_copy_connected_path on unconnected nw_connection
   2021-10-16 19:33:08.757103+0800 tvmrpc[24033:5508426] [] tcp_connection_is_cellular No connected path
   2021-10-16 19:33:08.759399+0800 tvmrpc[24033:5509574] [connection] nw_endpoint_handler_set_adaptive_read_handler [C3 192.168.123.171:56751 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for read_timeout failed
   2021-10-16 19:33:08.759617+0800 tvmrpc[24033:5509574] [connection] nw_endpoint_handler_set_adaptive_write_handler [C3 192.168.123.171:56751 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, dns)] unregister notification for write_timeout failed
   2021-10-16 19:33:32.324731+0800 tvmrpc[24033:5508426] [espresso] [Espresso::handle_ex_plan] exception=ANECF error:
   2021-10-16 19:33:32.324791+0800 tvmrpc[24033:5508426] [coreml] Error plan build: -1.
   2021-10-16 19:33:32.365495+0800 tvmrpc[24033:5508426] /Users/zy/Desktop/tvm/apps/ios_rpc_iphone12/tvmrpc/TVMRuntime.mm:82: Load module from /private/var/mobile/Containers/Data/Application/049E42F5-6672-4B0A-8D6E-95DE16CC4F9C/tmp/deploy.dylib ...
   2021-10-16 19:33:32.688035+0800 tvmrpc[24033:5508426] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
   *** First throw call stack:
   (0x195c5e708 0x1aa7687a8 0x196ef96cc 0x105723928 0x105723858 0x1057237c8 0x105723774 0x105722314 0x104dc47f4 0x104dc4420 0x10533042c 0x1055d70d4 0x1055d7030 0x1055d6fe4 0x1055d6fbc 0x1055d5b0c 0x105533908 0x10553387c 0x1055aedd8 0x1055fbc98 0x1055fbc58 0x1055fbbc8 0x1055fbb74 0x1055fa704 0x104dc47f4 0x104dc4420 0x10533042c 0x1055640a8 0x10559fa64 0x1055363a4 0x105533358 0x10552d2b8 0x10552e2f0 0x10555fda8 0x10555fcf0 0x10555fc60 0x10555fc0c 0x10555e510 0x104dc47f4 0x104dc4420 0x104dbce7c 0x104dbcc94 0x104dbb090 0x104dbb33c 0x195bf580c 0x195bf2168 0x195bf1f58 0x19637321c 0x19637de8c 0x195be3a30 0x195bd8990 0x195bd888c 0x195bd7b90 0x195bd1b70 0x195bd1308 0x196ec0d8c 0x104dba778 0x19703230c 0x1e19e8bfc 0x1e19f1758)
   libc++abi: terminating with uncaught exception of type NSException
   *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
   terminating with uncaught exception of type NSException
   *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
   terminating with uncaught exception of type NSException
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 edited a comment on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 edited a comment on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-944902602






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev edited a comment on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev edited a comment on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943452534


   @zhaiyi000, I tried to reproduce your issue connected to the Metal locally and I wasn't able to do that.
   
   Steps how I tried to reproduce your problem:
   1. `cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_VERSION=14.0 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON -DUSE_IOS_RPC=ON -DUSE_METAL=ON -DUSE_COREML=ON`
   2. `cmake --build . --target custom_dso_loader tvm_runtime`
   3. Install ios_rpc on my iphone and run it in tracker mode.
   4. Run `python3 tests/ios_rpc_test.py --host 0.0.0.0 --port 9190 --mode=tracker`
   
   Also, I double-checked it in the proxy mode and it works fine for me. Please try one again and let me know if you still have this issue. Also, what XCode version do you use?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-945709889


   Hi @zhaiyi000!
   
   As far as I know, now tvm has poor coreml support. Maybe @kazum could provide more information about current status of CoreML in TVM. 
   If you are interested in offloading some primitives to different accelerators and tutorial about enabling TVM in Apple ecosystem, you can take a look at these articles: [BNNS integration](https://tvm.apache.org/docs/how_to/deploy/bnns.html) and [Develop ML apps for the apple ecosystem](https://octoml.ai/blog/using-swift-and-apache-tvm-to-develop-ml-apps-for-the-apple-ecosystem).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-944301444


   @zhaiyi000 the open PR should fix the issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943021024


   I still get an error when testing on the iOS sumulator, but it is not the same as the above error, prompting `unsupported case in deploy.dylib`
   
   ```
   (py38) zy@diyideMacBook-Pro ios_rpc_simulator % python3 tests/ios_rpc_mobilenet.py --host '222.195.65.74' --port '9090' --mode "standalone"
   WARNING:root:scikit-learn version 0.24.1 is not supported. Minimum required version: 0.17. Maximum required version: 0.19.2. Disabling scikit-learn conversion API.
   One or more operators have not been tuned. Please tune your model for better performance. Use DEBUG logging level to see more details.
   Traceback (most recent call last):
     File "tests/ios_rpc_mobilenet.py", line 182, in <module>
       test_mobilenet(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_mobilenet.py", line 159, in test_mobilenet
       run(model, target_host)
     File "tests/ios_rpc_mobilenet.py", line 111, in run
       lib = remote.load_module("deploy.dylib")
     File "/Users/zy/Desktop/tvm/python/tvm/rpc/client.py", line 161, in load_module
       return _ffi_api.LoadRemoteModule(self._sess, path)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x0000000110f88511 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x0000000110f80f4c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x0000000110f7905d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x0000000110f7792e tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x0000000110f77bce tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x0000000110f7bc42 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x0000000110f7dbd5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x000000010fad26c9 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x0000000110f17688 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   tvmrpc                              0x000000010dab9437 std::__1::__function::__alloc_func<tvm::runtime::$_2, std::__1::allocator<tvm::runtime::$_2>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 71
     [bt] (7) 8   tvmrpc                              0x000000010dab9487 void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 71
     [bt] (6) 7   tvmrpc                              0x000000010dab9523 decltype(std::__1::forward<tvm::runtime::$_2&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 115
     [bt] (5) 6   tvmrpc                              0x000000010dab95cc tvm::runtime::$_2::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 140
     [bt] (4) 5   tvmrpc                              0x000000010dab989f tvm::runtime::UnsignedDSOLoader::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 431
     [bt] (3) 4   tvmrpc                              0x000000010da9c3f5 tvm::runtime::detail::LogFatal::~LogFatal() + 21
     [bt] (2) 3   tvmrpc                              0x000000010da9f059 tvm::runtime::detail::LogFatal::~LogFatal() + 73
     [bt] (1) 2   tvmrpc                              0x000000010daadb76 tvm::runtime::detail::LogFatalImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 134
     [bt] (0) 1   libtvm_runtime.dylib                0x000000010f895825 tvm::runtime::Backtrace() + 37
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [14:17:11] /Users/zy/Desktop/tvm/apps/ios_rpc_simulator/tvmrpc/TVMRuntime.mm:98: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (lib_handle_ != nullptr) is false: Failed to load dynamic shared library /Users/zy/Library/Developer/CoreSimulator/Devices/79FE4818-5C80-47C2-A9DF-E3C1DED30077/data/Containers/Data/Application/B88F3A6C-2F69-436D-8236-34AA58396D02/tmp/deploy.dylib Error happens during dlopen execution. addDynamicReference: unsupported case in deploy.dylib
   
   ```
   
   
   
   The command used to compile tvm_runtime is
   ```
   cmake ..\
     -DCMAKE_BUILD_TYPE=Debug\
     -DCMAKE_SYSTEM_NAME=iOS\
     -DCMAKE_SYSTEM_VERSION=14.0\
     -DCMAKE_OSX_SYSROOT=iphonesimulator\
     -DCMAKE_OSX_ARCHITECTURES=x86_64\
     -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0\
     -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON\
     -DUSE_IOS_RPC=ON  \
     -DUSE_METAL=ON
   ```
   
   In the `tests/ios_rpc_mobilenet.py` file, the configuration used is
   ```
   # Change target configuration, this is setting for iphone6s
   arch = "x86_64"
   sdk = "iphonesimulator"
   # arch = "arm64"
   # sdk = "iphoneos"
   target_host = "llvm -mtriple=%s-apple-darwin" % arch
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943452534


   @zhaiyi000, I tried to reproduce your issue connected to the Metal locally and I wasn't able to do that. Also, I have some doubts about this warning message in your log: `Warning: Metal runtime not enabled, return a source module...`. It looks like that first time you have compiled runtime w/o Metal support. 
   
   Steps how I tried to reproduce your problem:
   1. `cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_VERSION=14.0 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON -DUSE_IOS_RPC=ON -DUSE_METAL=ON -DUSE_COREML=ON`
   2. `cmake --build . --target custom_dso_loader tvm_runtime`
   3. Install ios_rpc on my iphone and run it in tracker mode.
   4. Run `python3 tests/ios_rpc_test.py --host 0.0.0.0 --port 9190 --mode=tracker`
   
   Also, I double-checked it in the proxy mode. Please try one again and let me know if you still have this issue. Also, what XCode version do you use?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-942355025


   I tested it on iphone7 (ios13.7) and it still has the same problem
   When I compiled `tvm_runtime`, I specified `DCMAKE_SYSTEM_VERSION=13.0` and `DCMAKE_OSX_DEPLOYMENT_TARGET=13.0`
   
   
   ```
   (py38) zy@diyideMBP ios_rpc % python3 tests/ios_rpc_test.py --host '0.0.0.0' --port 9090 --mode "proxy"
   [22:14:11] /Users/zy/Desktop/tvm/src/target/opt/build_metal_off.cc:31: Warning: Metal runtime not enabled, return a source module...
   Traceback (most recent call last):
     File "tests/ios_rpc_test.py", line 115, in <module>
       test_rpc_module(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_test.py", line 78, in test_rpc_module
       f1 = remote.load_module("dev_lib.dylib")
     File "/Users/zy/Desktop/tvm/python/tvm/rpc/client.py", line 161, in load_module
       return _ffi_api.LoadRemoteModule(self._sess, path)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x00000001181fb511 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x00000001181f3f4c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x00000001181ec05d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x00000001181ea92e tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x00000001181eabce tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x00000001181eec42 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x00000001181f0bd5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x0000000116d456c9 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x000000011818a688 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   tvmrpc                              0x0000000100e14c74 std::__1::__function::__alloc_func<tvm::runtime::$_2, std::__1::allocator<tvm::runtime::$_2>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (7) 8   tvmrpc                              0x0000000100e14cc8 void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (6) 7   tvmrpc                              0x0000000100e14d58 decltype(std::__1::forward<tvm::runtime::$_2&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (5) 6   tvmrpc                              0x0000000100e14df4 tvm::runtime::$_2::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 124
     [bt] (4) 5   tvmrpc                              0x0000000100e15028 tvm::runtime::UnsignedDSOLoader::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 312
     [bt] (3) 4   tvmrpc                              0x0000000100df8fac tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   tvmrpc                              0x0000000100dfb6d8 tvm::runtime::detail::LogFatal::~LogFatal() + 64
     [bt] (1) 2   tvmrpc                              0x0000000100e096d4 tvm::runtime::detail::LogFatalImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 104
     [bt] (0) 1   libtvm_runtime.dylib                0x00000001013f9740 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [22:14:12] /Users/zy/Desktop/tvm/apps/ios_rpc/tvmrpc/TVMRuntime.mm:98: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (lib_handle_ != nullptr) is false: Failed to load dynamic shared library /private/var/mobile/Containers/Data/Application/7F1B64CD-9DBC-45DD-8A03-9F3D10CAA6B2/tmp/dev_lib.dylib Error happens during dlopen execution. Unimplemented
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] apeskov commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
apeskov commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943416403


   @echuraev could you please take a look on issue with shader language mismatch?
   Looks like `ios_rpc_test.py` script from main branch doesn't work with pointed device configuration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943507414


   @echuraev, I recompiled libtvm.dylib and libtvm_runtime.dylib, specifying `-DUSE_METAL=ON -DUSE_COREML=ON`. But still have the same error.
   My xcode version is `Version 13.0 (13A233)`
   
   ```
   (py38) zy@diyideMacBook-Pro ios_rpc_iphone12 % cd ~/Desktop/tvm
   (py38) zy@diyideMacBook-Pro tvm % rm -rf build_iphone12 
   (py38) zy@diyideMacBook-Pro tvm % mkdir build_iphone12
   (py38) zy@diyideMacBook-Pro tvm % cd build_iphone12
   (py38) zy@diyideMacBook-Pro build_iphone12 % cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_VERSION=14.0 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON -DUSE_IOS_RPC=ON -DUSE_METAL=ON -DUSE_COREML=ON
   -- The C compiler identification is AppleClang 13.0.0.13000029
   -- The CXX compiler identification is AppleClang 13.0.0.13000029
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
   -- Detecting C compile features
   -- Detecting C compile features - done
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Build in Debug mode
   -- Forbidding undefined symbols in shared library, using -Wl,-undefined,error on platform iOS
   -- Build with RPC support...
   -- Build with Graph Executor support...
   -- Build with profiler...
   -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
   -- VTA build with VTA_HW_PATH=/Users/zy/Desktop/tvm/3rdparty/vta-hw
   -- Build VTA runtime with target: sim
   -- Build with Metal support
   -- Build with contrib.random
   -- Build with contrib.sort
   -- Build with contrib.hybriddump
   -- Build with contrib.coreml
   -- Git found: /usr/bin/git
   -- Found TVM_GIT_COMMIT_HASH=c8cf4281576493b16893bc8375b176af9c2baa70
   -- Found TVM_GIT_COMMIT_TIME=2021-10-14 21:10:01 +0800
   -- Performing Test SUPPORT_CXX14
   -- Performing Test SUPPORT_CXX14 - Success
   -- Autoset: USE_LIBBACKTRACE=OFF in iOS
   -- Building with TVM Map...
   -- Build with thread support...
   -- Looking for pthread.h
   -- Looking for pthread.h - found
   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
   -- Found Threads: TRUE  
   -- Performing Test FILE_PREFIX_MAP_SUPPORTED
   -- Performing Test FILE_PREFIX_MAP_SUPPORTED - Success
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /Users/zy/Desktop/tvm/build_iphone12
   (py38) zy@diyideMacBook-Pro build_iphone12 % cmake --build . --target custom_dso_loader tvm_runtime
   [  0%] Creating directories for 'custom_dso_loader'
   [  0%] Performing download step (git clone) for 'custom_dso_loader'
   -- custom_dso_loader download command succeeded.  See also /Users/zy/Desktop/tvm/build_iphone12/apps/ios_rpc/custom_dso_loader/src/custom_dso_loader-stamp/custom_dso_loader-download-*.log
   [  0%] Performing update step for 'custom_dso_loader'
   [  0%] No patch step for 'custom_dso_loader'
   [  0%] Performing configure step for 'custom_dso_loader'
   -- custom_dso_loader configure command succeeded.  See also /Users/zy/Desktop/tvm/build_iphone12/apps/ios_rpc/custom_dso_loader/src/custom_dso_loader-stamp/custom_dso_loader-configure-*.log
   [  0%] Performing build step for 'custom_dso_loader'
   [ 14%] Building CXX object CMakeFiles/macho_dyld.dir/src/ImageLoader.cpp.o
   [ 28%] Building CXX object CMakeFiles/macho_dyld.dir/src/ImageLoaderMachO.cpp.o
   [ 42%] Building CXX object CMakeFiles/macho_dyld.dir/src/ImageLoaderMachOCompressed.cpp.o
   [ 57%] Building CXX object CMakeFiles/macho_dyld.dir/src/ImageLoaderProxy.cpp.o
   [ 71%] Building CXX object CMakeFiles/macho_dyld.dir/src/custom_dlfcn.cpp.o
   [ 85%] Building CXX object CMakeFiles/macho_dyld.dir/src/dyld_stubs.cpp.o
   [100%] Linking CXX static library libmacho_dyld.a
   [100%] Built target macho_dyld
   [100%] Performing install step for 'custom_dso_loader'
   Consolidate compiler generated dependencies of target macho_dyld
   [100%] Built target macho_dyld
   Install the project...
   -- Install configuration: ""
   -- Installing: /Users/zy/Desktop/tvm/build_iphone12/apps/ios_rpc/custom_dso_loader/lib/libmacho_dyld.a
   -- Installing: /Users/zy/Desktop/tvm/build_iphone12/apps/ios_rpc/custom_dso_loader/include/custom_dlfcn.h
   [100%] Completed 'custom_dso_loader'
   [100%] Built target custom_dso_loader
   [ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/builtin_fp16.cc.o
   [ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/c_runtime_api.cc.o
   [ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/container.cc.o
   [ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/cpu_device_api.cc.o
   [ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/dso_library.cc.o
   [ 20%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/file_utils.cc.o
   [ 20%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/library_module.cc.o
   [ 20%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/logging.cc.o
   [ 20%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/metadata_module.cc.o
   [ 20%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/module.cc.o
   [ 30%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/ndarray.cc.o
   [ 30%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/object.cc.o
   [ 30%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/profiling.cc.o
   [ 30%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/registry.cc.o
   [ 40%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/source_utils.cc.o
   [ 40%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/system_library.cc.o
   [ 40%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/thread_pool.cc.o
   [ 40%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/threading_backend.cc.o
   [ 40%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/bytecode.cc.o
   [ 50%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/executable.cc.o
   [ 50%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/memory_manager.cc.o
   [ 50%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/vm.cc.o
   [ 50%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/workspace_pool.cc.o
   [ 60%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_channel.cc.o
   [ 60%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_device_api.cc.o
   [ 60%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_endpoint.cc.o
   [ 60%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_event_impl.cc.o
   [ 60%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_local_session.cc.o
   [ 70%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_module.cc.o
   [ 70%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_pipe_impl.cc.o
   [ 70%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_server_env.cc.o
   [ 70%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_session.cc.o
   [ 80%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_socket_impl.cc.o
   [ 80%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/graph_executor.cc.o
   [ 80%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/graph_executor_factory.cc.o
   [ 80%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/debug/graph_executor_debug.cc.o
   [ 80%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/profiler/vm.cc.o
   [ 90%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/metal/metal_device_api.mm.o
   [ 90%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/metal/metal_module.mm.o
   [ 90%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/random/random.cc.o
   [ 90%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/sort/sort.cc.o
   [100%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/coreml/coreml_runtime.mm.o
   [100%] Built target tvm_runtime_objs
   [100%] Linking CXX shared library libtvm_runtime.dylib
   [100%] Built target tvm_runtime
   (py38) zy@diyideMacBook-Pro build_iphone12 % cd -
   ~/Desktop/tvm
   (py38) zy@diyideMacBook-Pro tvm % cd apps/ios_rpc_iphone12 
   (py38) zy@diyideMacBook-Pro ios_rpc_iphone12 % python3 tests/ios_rpc_mobilenet.py --host '192.168.123.16' --port 9090 --mode "standalone"
   WARNING:root:scikit-learn version 0.24.1 is not supported. Minimum required version: 0.17. Maximum required version: 0.19.2. Disabling scikit-learn conversion API.
   target_host
   metal
   开始编译
   One or more operators have not been tuned. Please tune your model for better performance. Use DEBUG logging level to see more details.
   [00:10:14] /Users/zy/Desktop/tvm/src/target/opt/build_metal_off.cc:31: Warning: Metal runtime not enabled, return a source module...
   开始导出
   开始连接
   开始上传
   上传完成
   Traceback (most recent call last):
     File "tests/ios_rpc_mobilenet.py", line 190, in <module>
       test_mobilenet(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_mobilenet.py", line 168, in test_mobilenet
       run(model, "metal")
     File "tests/ios_rpc_mobilenet.py", line 120, in run
       m.run()
     File "/Users/zy/Desktop/tvm/python/tvm/contrib/graph_executor.py", line 207, in run
       self._run()
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x000000011d532ee1 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x000000011d52b91c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x000000011d523a2d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x000000011d5222fe tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x000000011d52259e tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x000000011d526612 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x000000011d5285a5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x000000011c076289 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x000000011d4c2058 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   libtvm_runtime.dylib                0x0000000104f572f0 std::__1::__function::__func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (7) 8   libtvm_runtime.dylib                0x0000000104f58790 std::__1::__function::__alloc_func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (6) 7   libtvm_runtime.dylib                0x0000000104f5880c void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (5) 6   libtvm_runtime.dylib                0x0000000104f5889c decltype(std::__1::forward<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (4) 5   libtvm_runtime.dylib                0x0000000104f58a60 tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 420
     [bt] (3) 4   libtvm_runtime.dylib                0x0000000104ecbe48 tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   libtvm_runtime.dylib                0x0000000104ed21c8 tvm::runtime::detail::LogFatal::~LogFatal() + 40
     [bt] (1) 2   libtvm_runtime.dylib                0x0000000104ed2250 tvm::runtime::detail::LogFatal::Entry::Finalize() + 112
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000104f5f1d8 tvm::runtime::Backtrace() + 28
     [bt] (8) 9   libtvm_runtime.dylib                0x000000010522429c tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&) + 124
     [bt] (7) 8   libtvm_runtime.dylib                0x000000010522431c void tvm::runtime::metal::AutoReleasePoolWrapper::operator<<<tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>(tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0 const&) + 48
     [bt] (6) 7   libtvm_runtime.dylib                0x000000010522e5b4 tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0::operator()() const + 1116
     [bt] (5) 6   libtvm_runtime.dylib                0x000000010522ea34 tvm::runtime::MetalWrappedFunc::Init(tvm::runtime::MetalModuleNode*, tvm::runtime::ObjectPtr<tvm::runtime::Object>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, unsigned long, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) + 224
     [bt] (4) 5   libtvm_runtime.dylib                0x00000001052303e0 tvm::runtime::MetalModuleNode::GetPipelineState(unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 2628
     [bt] (3) 4   libtvm_runtime.dylib                0x0000000104ecbe48 tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   libtvm_runtime.dylib                0x0000000104ed21c8 tvm::runtime::detail::LogFatal::~LogFatal() + 40
     [bt] (1) 2   libtvm_runtime.dylib                0x0000000104ed2250 tvm::runtime::detail::LogFatal::Entry::Finalize() + 112
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000104f5f1d8 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/metal/metal_module.mm", line 133
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [00:10:19] /Users/zy/Desktop/tvm/src/runtime/library_module.cc:78: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
   
     Check failed: ret == 0 (-1 vs. 0) : TVMError: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (state != nil) is false: cannot get state: for function tvmgen_default_fused_nn_conv2d_add_clip_18_kernel0Function tvmgen_default_fused_nn_conv2d_add_clip_18_kernel0 is using language version 2.4 which is incompatible with this OS.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] vinx13 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
vinx13 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-942693061


   cc @apeskov 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-942355025


   I tested it on iphone7 (ios13.7) and it still has the same problem
   When I compiled `tvm_runtime`, I specified `DCMAKE_SYSTEM_VERSION=13.0` and `DCMAKE_OSX_DEPLOYMENT_TARGET=13.0`
   
   
   ```
   (py38) zy@diyideMBP ios_rpc % python3 tests/ios_rpc_test.py --host '0.0.0.0' --port 9090 --mode "proxy"
   [22:14:11] /Users/zy/Desktop/tvm/src/target/opt/build_metal_off.cc:31: Warning: Metal runtime not enabled, return a source module...
   Traceback (most recent call last):
     File "tests/ios_rpc_test.py", line 115, in <module>
       test_rpc_module(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_test.py", line 78, in test_rpc_module
       f1 = remote.load_module("dev_lib.dylib")
     File "/Users/zy/Desktop/tvm/python/tvm/rpc/client.py", line 161, in load_module
       return _ffi_api.LoadRemoteModule(self._sess, path)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x00000001181fb511 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x00000001181f3f4c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x00000001181ec05d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x00000001181ea92e tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x00000001181eabce tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x00000001181eec42 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x00000001181f0bd5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x0000000116d456c9 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x000000011818a688 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   tvmrpc                              0x0000000100e14c74 std::__1::__function::__alloc_func<tvm::runtime::$_2, std::__1::allocator<tvm::runtime::$_2>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (7) 8   tvmrpc                              0x0000000100e14cc8 void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (6) 7   tvmrpc                              0x0000000100e14d58 decltype(std::__1::forward<tvm::runtime::$_2&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (5) 6   tvmrpc                              0x0000000100e14df4 tvm::runtime::$_2::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 124
     [bt] (4) 5   tvmrpc                              0x0000000100e15028 tvm::runtime::UnsignedDSOLoader::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 312
     [bt] (3) 4   tvmrpc                              0x0000000100df8fac tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   tvmrpc                              0x0000000100dfb6d8 tvm::runtime::detail::LogFatal::~LogFatal() + 64
     [bt] (1) 2   tvmrpc                              0x0000000100e096d4 tvm::runtime::detail::LogFatalImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 104
     [bt] (0) 1   libtvm_runtime.dylib                0x00000001013f9740 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [22:14:12] /Users/zy/Desktop/tvm/apps/ios_rpc/tvmrpc/TVMRuntime.mm:98: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (lib_handle_ != nullptr) is false: Failed to load dynamic shared library /private/var/mobile/Containers/Data/Application/7F1B64CD-9DBC-45DD-8A03-9F3D10CAA6B2/tmp/dev_lib.dylib Error happens during dlopen execution. Unimplemented
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943397933


   Thank you for your reply. I need both CPU and GPU. I will write the code for the CPU part first. 
   Thank you once again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943420373


   @apeskov Encountered another error when executing the following code.
   ```
   run(annotate(model, "coremlcompiler"), target_host)
   ```
   
   ```
   (py38) zy@diyideMacBook-Pro ios_rpc_iphone12 % python3 tests/ios_rpc_mobilenet.py --host '114.214.209.9' --port 9091 --mode "standalone"
   WARNING:root:scikit-learn version 0.24.1 is not supported. Minimum required version: 0.17. Maximum required version: 0.19.2. Disabling scikit-learn conversion API.
   coremlcompiler
   开始编译
   开始导出
   开始连接
   开始上传
   上传完成
   Traceback (most recent call last):
     File "tests/ios_rpc_mobilenet.py", line 188, in <module>
       test_mobilenet(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_mobilenet.py", line 169, in test_mobilenet
       run(annotate(model, "coremlcompiler"), target_host)
     File "tests/ios_rpc_mobilenet.py", line 116, in run
       lib = remote.load_module("deploy.dylib")
     File "/Users/zy/Desktop/tvm/python/tvm/rpc/client.py", line 161, in load_module
       return _ffi_api.LoadRemoteModule(self._sess, path)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x000000011362aee1 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x000000011362391c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x000000011361ba2d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x000000011361a2fe tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x000000011361a59e tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x000000011361e612 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x00000001136205a5 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x000000011216e289 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x00000001135ba058 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   tvmrpc                              0x00000001028ccd3c decltype(std::__1::forward<tvm::runtime::$_2&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::$_2&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::$_2&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (7) 8   tvmrpc                              0x00000001028ccdf8 tvm::runtime::$_2::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 156
     [bt] (6) 7   libtvm_runtime.dylib                0x0000000102eed690 tvm::runtime::CreateModuleFromLibrary(tvm::runtime::ObjectPtr<tvm::runtime::Library>) + 232
     [bt] (5) 6   libtvm_runtime.dylib                0x0000000102eec9e0 tvm::runtime::ProcessModuleBlob(char const*, tvm::runtime::ObjectPtr<tvm::runtime::Library>, tvm::runtime::Module*, tvm::runtime::ModuleNode**) + 1956
     [bt] (4) 5   libtvm_runtime.dylib                0x0000000102eebcf0 tvm::runtime::LoadModuleFromBinary(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, dmlc::Stream*) + 604
     [bt] (3) 4   libtvm_runtime.dylib                0x0000000102e663b0 tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   libtvm_runtime.dylib                0x0000000102e6c730 tvm::runtime::detail::LogFatal::~LogFatal() + 40
     [bt] (1) 2   libtvm_runtime.dylib                0x0000000102e6c7b8 tvm::runtime::detail::LogFatal::Entry::Finalize() + 112
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000102ef9740 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [22:30:06] /Users/zy/Desktop/tvm/src/runtime/library_module.cc:116: Binary was created using coreml but a loader of that name is not registered. Available loaders are metal, GraphRuntimeFactory, GraphExecutorFactory, metadata, VMExecutable. Perhaps you need to recompile with this runtime enabled.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943351479


   I tried the following code but it didn’t work
   
   ```
   cmd += ["-target", "arm64-apple-ios14.7.1"]  # any iOS version <15
   ```
   ```
   cmake ..\
     -DCMAKE_BUILD_TYPE=Debug\
     -DCMAKE_SYSTEM_NAME=iOS\
     -DCMAKE_SYSTEM_VERSION=14.7.1\
     -DCMAKE_OSX_SYSROOT=iphoneos\
     -DCMAKE_OSX_ARCHITECTURES=arm64\
     -DCMAKE_OSX_DEPLOYMENT_TARGET=14.7.1\
     -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON\
     -DUSE_IOS_RPC=ON\
     -DUSE_METAL=ON
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943346320


   @apeskov Thank you very much for your reply. I followed your suggestion and modified the following code, but I got a new error.
   ```
       clang = xcrun(["-sdk", sdk, "-find", "clang"])
       sdk_path = xcrun(["-sdk", sdk, "--show-sdk-path"])
       cmd = [clang]
       cmd += ["-dynamiclib"]
       cmd += ["-arch", arch]
       cmd += ["-isysroot", sdk_path]
       cmd += ["-target", "arm64-apple-ios13.0"]  # any iOS version <15
       cmd += ["-o", output]
   ```
   
   ```
   (py38) zy@diyideMacBook-Pro ios_rpc_iphone12 % python3 tests/ios_rpc_test.py --host '114.214.209.9' --port 9090 --mode "standalone"
   [21:11:57] /Users/zy/Desktop/tvm/src/target/opt/build_metal_off.cc:31: Warning: Metal runtime not enabled, return a source module...
   Traceback (most recent call last):
     File "tests/ios_rpc_test.py", line 115, in <module>
       test_rpc_module(args.host, args.port, args.key, args.mode)
     File "tests/ios_rpc_test.py", line 83, in test_rpc_module
       cost = time_f(a, b).mean
     File "/Users/zy/Desktop/tvm/python/tvm/runtime/module.py", line 292, in evaluator
       blob = feval(*args)
     File "/Users/zy/Desktop/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
       raise get_last_ffi_error()
   tvm.error.RPCError: Traceback (most recent call last):
     [bt] (8) 9   libtvm.dylib                        0x00000001139b4a41 tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 1521
     [bt] (7) 8   libtvm.dylib                        0x00000001139ad47c tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)> const&) + 124
     [bt] (6) 7   libtvm.dylib                        0x00000001139a558d tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::__1::function<void (tvm::runtime::TVMArgs)>) + 333
     [bt] (5) 6   libtvm.dylib                        0x00000001139a3e5e tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 622
     [bt] (4) 5   libtvm.dylib                        0x00000001139a40fe tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::__1::function<void (tvm::runtime::TVMArgs)>) + 494
     [bt] (3) 4   libtvm.dylib                        0x00000001139a8172 tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::__1::function<void (tvm::runtime::TVMArgs)>) + 386
     [bt] (2) 3   libtvm.dylib                        0x00000001139aa105 tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::__1::function<void (tvm::runtime::TVMArgs)>) + 213
     [bt] (1) 2   libtvm.dylib                        0x00000001124f7de9 tvm::runtime::detail::LogFatal::Entry::Finalize() + 89
     [bt] (0) 1   libtvm.dylib                        0x0000000113943bb8 tvm::runtime::Backtrace() + 24
     [bt] (8) 9   libtvm_runtime.dylib                0x0000000104d61858 std::__1::__function::__func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (7) 8   libtvm_runtime.dylib                0x0000000104d62cf8 std::__1::__function::__alloc_func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (6) 7   libtvm_runtime.dylib                0x0000000104d62d74 void std::__1::__invoke_void_return_wrapper<void, true>::__call<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 72
     [bt] (5) 6   libtvm_runtime.dylib                0x0000000104d62e04 decltype(std::__1::forward<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&>(fp)(std::__1::forward<tvm::runtime::TVMArgs>(fp0), std::__1::forward<tvm::runtime::TVMRetValue*>(fp0))) std::__1::__invoke<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*>(tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 96
     [bt] (4) 5   libtvm_runtime.dylib                0x0000000104d62fc8 tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, int*, int, TVMValue*, int*, void*), tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 420
     [bt] (3) 4   libtvm_runtime.dylib                0x0000000104cd63b0 tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   libtvm_runtime.dylib                0x0000000104cdc730 tvm::runtime::detail::LogFatal::~LogFatal() + 40
     [bt] (1) 2   libtvm_runtime.dylib                0x0000000104cdc7b8 tvm::runtime::detail::LogFatal::Entry::Finalize() + 112
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000104d69740 tvm::runtime::Backtrace() + 28
     [bt] (8) 9   libtvm_runtime.dylib                0x000000010502e804 tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&) + 124
     [bt] (7) 8   libtvm_runtime.dylib                0x000000010502e884 void tvm::runtime::metal::AutoReleasePoolWrapper::operator<<<tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>(tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0 const&) + 48
     [bt] (6) 7   libtvm_runtime.dylib                0x0000000105038b1c tvm::runtime::MetalModuleNode::GetFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0::operator()() const + 1116
     [bt] (5) 6   libtvm_runtime.dylib                0x0000000105038f9c tvm::runtime::MetalWrappedFunc::Init(tvm::runtime::MetalModuleNode*, tvm::runtime::ObjectPtr<tvm::runtime::Object>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, unsigned long, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) + 224
     [bt] (4) 5   libtvm_runtime.dylib                0x000000010503a948 tvm::runtime::MetalModuleNode::GetPipelineState(unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 2628
     [bt] (3) 4   libtvm_runtime.dylib                0x0000000104cd63b0 tvm::runtime::detail::LogFatal::~LogFatal() + 28
     [bt] (2) 3   libtvm_runtime.dylib                0x0000000104cdc730 tvm::runtime::detail::LogFatal::~LogFatal() + 40
     [bt] (1) 2   libtvm_runtime.dylib                0x0000000104cdc7b8 tvm::runtime::detail::LogFatal::Entry::Finalize() + 112
     [bt] (0) 1   libtvm_runtime.dylib                0x0000000104d69740 tvm::runtime::Backtrace() + 28
     File "/Users/zy/Desktop/tvm/src/runtime/metal/metal_module.mm", line 133
     File "/Users/zy/Desktop/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
   RPCError: Error caught from RPC call:
   [21:11:58] /Users/zy/Desktop/tvm/src/runtime/library_module.cc:78: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
   
     Check failed: ret == 0 (-1 vs. 0) : TVMError: 
   ---------------------------------------------------------------
   An error occurred during the execution of TVM.
   For more information, please see: https://tvm.apache.org/docs/errors.html
   ---------------------------------------------------------------
     Check failed: (state != nil) is false: cannot get state: for function myadd_kernel0Function myadd_kernel0 is using language version 2.4 which is incompatible with this OS.
   ```
   
   
   I tried the following two methods to compile tvm_runtime, but both got the above error. My mobile phone is iPhone12 and the system is iOS14.7.1
   
   ```
   cmake ..\
     -DCMAKE_BUILD_TYPE=Debug\
     -DCMAKE_SYSTEM_NAME=iOS\
     -DCMAKE_SYSTEM_VERSION=14.7\
     -DCMAKE_OSX_SYSROOT=iphoneos\
     -DCMAKE_OSX_ARCHITECTURES=arm64\
     -DCMAKE_OSX_DEPLOYMENT_TARGET=14.7\
     -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON\
     -DUSE_IOS_RPC=ON\
     -DUSE_METAL=ON
   ```
   ```
   cmake ..\
     -DCMAKE_BUILD_TYPE=Debug\
     -DCMAKE_SYSTEM_NAME=iOS\
     -DCMAKE_SYSTEM_VERSION=14.0\
     -DCMAKE_OSX_SYSROOT=iphoneos\
     -DCMAKE_OSX_ARCHITECTURES=arm64\
     -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0\
     -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON\
     -DUSE_IOS_RPC=ON\
     -DUSE_METAL=ON
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zhaiyi000 closed issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
zhaiyi000 closed issue #9268:
URL: https://github.com/apache/tvm/issues/9268


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] apeskov commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
apeskov commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943393716


   Looks like some mismatch between requested metal shader language(2.3) and generated kernel code. We will also take a look on it.
   
   If you are not interested in iOS GPU/Metal code generation you may just skip this error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] apeskov commented on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
apeskov commented on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943299463


   Hi, @zhaiyi000 thank you
   This is a known issue related with latest update to Xcode 13. We are working on fix for main. I hope it will be available soon.
   
   Meanwhile I can suggest you to apply minimal workaround patch which will allow you to continue experiments with iOS.
   ```diff
   diff --git a/python/tvm/contrib/xcode.py b/python/tvm/contrib/xcode.py
   index c44a2fe4a..bb6eb8367 100644
   --- a/python/tvm/contrib/xcode.py
   +++ b/python/tvm/contrib/xcode.py
   @@ -71,6 +71,7 @@ def create_dylib(output, objects, arch, sdk="macosx"):
        cmd += ["-dynamiclib"]
        cmd += ["-arch", arch]
        cmd += ["-isysroot", sdk_path]
   +    cmd += ["-target", "arm64-apple-ios13.0"]  # any iOS version <15
        cmd += ["-o", output]
        if isinstance(objects, str):
            cmd += [objects]
   ```
   
   
   **Slightly more details about reason leading to that issue**
   
   Just FYI. TVM uses a custom DSO loader for iOS platform(because of JIT limitation of apple platform). This loader is a stripped version of original dyld loader with dropping a lot of functionality which is out of TVM needs. Particularly it supports only one format of storing export symbols inside a mach-o binary (via DYLD_INFO section). Before iOS 15 it was a default variant of binaries used for iOS. But recently default behaviour was changed in Xcode 13. Now linker uses CHAINED_FIXUPS format if you are targeting on iOS 15 and later. The patch above specifies target version to iOS 13 and forces linker to go old way with DYLD_INFO.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] echuraev edited a comment on issue #9268: [Bug] [ios_rpc] Error happens during dlopen execution. Unimplemented

Posted by GitBox <gi...@apache.org>.
echuraev edited a comment on issue #9268:
URL: https://github.com/apache/tvm/issues/9268#issuecomment-943423144


   Hi @zhaiyi000!
   
   > @apeskov Encountered another error when executing the following code.
   
   It looks like you should compile your runtime with CoreML support. Please, use this parameter when you built runtime: `-DUSE_COREML=ON`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org