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-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org