kognat-docs opened a new issue #5242: [Metal] Traceback macOS 10.13 on AMD 
Radeon Pro 560 using 
https://docs-assets.developer.apple.com/coreml/models/MobileNet.mlmodel
URL: https://github.com/apache/incubator-tvm/issues/5242
 
 
   ```
   Traceback (most recent call last):
   
     File "/Users/sam/dev/tvm_test/from_coreml.py", line 94, in <module>
       m.run()
   
     File 
"/Users/sam/dev/github/tvm/build-runtime/python-tvm/venv/lib/python3.7/site-packages/tvm-0.7.dev1-py3.7-macosx-10.13-x86_64.egg/tvm/contrib/graph_runtime.py",
 line 176, in run
       self._run()
   
     File 
"/Users/sam/dev/github/tvm/build-runtime/python-tvm/venv/lib/python3.7/site-packages/tvm-0.7.dev1-py3.7-macosx-10.13-x86_64.egg/tvm/_ffi/_ctypes/packed_func.py",
 line 213, in __call__
       raise get_last_ffi_error()
   
   tvm._ffi.base.TVMError: Traceback (most recent call last):
     [bt] (6) 7   ???                                 0x00007ffeedd86410 0x0 + 
140732888802320
     [bt] (5) 6   _ctypes.cpython-37m-darwin.so       0x000000010294a36f 
ffi_call_unix64 + 79
     [bt] (4) 5   libtvm.dylib                        0x000000010e317bd6 
TVMFuncCall + 70
     [bt] (3) 4   libtvm.dylib                        0x000000010e3727af 
std::__1::__function::__func<tvm::runtime::GraphRuntime::GetFunction(std::__1::basic_string<char,
 std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_9, 
std::__1::allocator<tvm::runtime::GraphRuntime::GetFunction(std::__1::basic_string<char,
 std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_9>, void 
(tvm::runtime::TVMArgs, 
tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, 
tvm::runtime::TVMRetValue*&&) + 79
     [bt] (2) 3   libtvm.dylib                        0x000000010e36fc91 
std::__1::__function::__func<tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam
 const&, std::__1::vector<DLTensor, std::__1::allocator<DLTensor> > const&, 
unsigned long)::$_2, 
std::__1::allocator<tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam
 const&, std::__1::vector<DLTensor, std::__1::allocator<DLTensor> > const&, 
unsigned long)::$_2>, void ()>::operator()() + 81
     [bt] (1) 2   libtvm.dylib                        0x000000010e3219d9 
std::__1::__function::__func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, 
int*, int, TVMValue*, int*), tvm::runtime::ObjectPtr<tvm::runtime::Object> 
const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int 
(*)(TVMValue*, int*, int, TVMValue*, int*), 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void 
(tvm::runtime::TVMArgs, 
tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, 
tvm::runtime::TVMRetValue*&&) + 313
     [bt] (0) 1   libtvm.dylib                        0x000000010d8b2829 
dmlc::LogMessageFatal::~LogMessageFatal() + 57
     File "/Users/sam/dev/github/tvm/src/runtime/library_module.cc", line 89
   TVMError: Check failed: ret == 0 (-1 vs. 0) : Assert fail: (dev_type == 1), 
device_type need to be 1
   ```
   
   From the following input `python ~/dev/tvm_test/from_coreml.py`
   
   Where `~/dev/tvm_test/from_coreml.py` reads as follows
   
   ```
   # Licensed to the Apache Software Foundation (ASF) under one
   # or more contributor license agreements.  See the NOTICE file
   # distributed with this work for additional information
   # regarding copyright ownership.  The ASF licenses this file
   # to you under the Apache License, Version 2.0 (the
   # "License"); you may not use this file except in compliance
   # with the License.  You may obtain a copy of the License at
   #
   #   http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing,
   # software distributed under the License is distributed on an
   # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   # KIND, either express or implied.  See the License for the
   # specific language governing permissions and limitations
   # under the License.
   """
   Compile CoreML Models
   =====================
   **Author**: `Joshua Z. Zhang <https://zhreshold.github.io/>`_, \
               `Kazutaka Morita <https://github.com/kazum>`_, \
               `Zhao Wu <https://github.com/FrozenGene>`_
   
   This article is an introductory tutorial to deploy CoreML models with Relay.
   
   For us to begin with, coremltools module is required to be installed.
   
   A quick solution is to install via pip
   
   .. code-block:: bash
   
       pip install -U coremltools --user
   
   or please refer to official site
   https://github.com/apple/coremltools
   """
   import tvm
   from tvm import te
   import tvm.relay as relay
   from tvm.contrib.download import download_testdata
   import coremltools as cm
   import numpy as np
   from PIL import Image
   
   ######################################################################
   # Load pretrained CoreML model
   # ----------------------------
   # We will download and load a pretrained mobilenet classification network
   # provided by apple in this example
   model_url = 
'https://docs-assets.developer.apple.com/coreml/models/MobileNet.mlmodel'
   model_file = 'mobilenet.mlmodel'
   model_path = download_testdata(model_url, model_file, module='coreml')
   # Now you have mobilenet.mlmodel on disk
   mlmodel = cm.models.MLModel(model_path)
   
   ######################################################################
   # Load a test image
   # ------------------
   # A single cat dominates the examples!
   img_url = 
'https://github.com/dmlc/mxnet.js/blob/master/data/cat.png?raw=true'
   img_path = download_testdata(img_url, 'cat.png', module='data')
   img = Image.open(img_path).resize((224, 224))
   # Mobilenet.mlmodel's input is BGR format
   img_bgr = np.array(img)[:,:,::-1]
   x = np.transpose(img_bgr, (2, 0, 1))[np.newaxis, :]
   
   ######################################################################
   # Compile the model on Relay
   # ---------------------------
   # We should be familiar with the process right now.
   target = 'llvm'
   shape_dict = {'image': x.shape}
   
   # Parse CoreML model and convert into Relay computation graph
   mod, params = relay.frontend.from_coreml(mlmodel, shape_dict)
   
   with relay.build_config(opt_level=3):
       graph, lib, params = relay.build(mod,
                                        target,
                                        params=params)
   
   ######################################################################
   # Execute on TVM
   # -------------------
   # The process is no different from other example
   from tvm.contrib import graph_runtime
   ctx = tvm.metal(1)
   dtype = 'float32'
   m = graph_runtime.create(graph, lib, ctx)
   # set inputs
   m.set_input('image', tvm.nd.array(x.astype(dtype)))
   m.set_input(**params)
   # execute
   m.run()
   # get outputs
   tvm_output = m.get_output(0)
   top1 = np.argmax(tvm_output.asnumpy()[0])
   
   #####################################################################
   # Look up synset name
   # -------------------
   # Look up prediction top 1 index in 1000 class synset.
   synset_url = ''.join(['https://gist.githubusercontent.com/zhreshold/',
                         '4d0b62f3d01426887599d4f7ede23ee5/raw/',
                         '596b27d23537e5a1b5751d2b0481ef172f58b539/',
                         'imagenet1000_clsid_to_human.txt'])
   synset_name = 'imagenet1000_clsid_to_human.txt'
   synset_path = download_testdata(synset_url, synset_name, module='data')
   with open(synset_path) as f:
       synset = eval(f.read())
   # You should see the following result: Top-1 id 282 class name tiger cat
   print('Top-1 id', top1, 'class name', synset[top1])
   ```
   
   based on
   
   https://docs.tvm.ai/tutorials/tensor_expr_get_started.html
   
   With the single line edit
   
   `ctx=tvm.cpu(0)` becomes `ctx=tvm.metal(1)`
   
   The output is as follows
   
   ```
   WARNING:root:TensorFlow version 2.1.0 detected. Last version known to be 
fully compatible is 1.14.0 .
   File /Users/sam/.tvm_test_data/coreml/mobilenet.mlmodel exists, skip.
   File /Users/sam/.tvm_test_data/data/cat.png exists, skip.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 3, 226, 226), 'float32'), 
('TENSOR', (32, 3, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 32, 114, 114), 
'float32'), ('TENSOR', (32, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 32, 112, 112), 'float32'), 
('TENSOR', (64, 32, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 64, 114, 114), 
'float32'), ('TENSOR', (64, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 64, 56, 56), 'float32'), 
('TENSOR', (128, 64, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 128, 58, 58), 
'float32'), ('TENSOR', (128, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 128, 56, 56), 'float32'), 
('TENSOR', (128, 128, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 128, 58, 58), 
'float32'), ('TENSOR', (128, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 128, 28, 28), 'float32'), 
('TENSOR', (256, 128, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 256, 30, 30), 
'float32'), ('TENSOR', (256, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 256, 28, 28), 'float32'), 
('TENSOR', (256, 256, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 256, 30, 30), 
'float32'), ('TENSOR', (256, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 256, 14, 14), 'float32'), 
('TENSOR', (512, 256, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 512, 16, 16), 
'float32'), ('TENSOR', (512, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 512, 14, 14), 'float32'), 
('TENSOR', (512, 512, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 512, 16, 16), 
'float32'), ('TENSOR', (512, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 512, 7, 7), 'float32'), ('TENSOR', 
(1024, 512, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 'NCHW', 
'float32'). A fallback configuration is used, which may bring great performance 
regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 9, 9), 'float32'), 
('TENSOR', (1024, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 7, 7), 'float32'), 
('TENSOR', (1024, 1024, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 1, 1), 'float32'), 
('TENSOR', (1000, 1024, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   Input name(s) and shape(s): 
   image : (C,H,W) = (3, 224, 224) 
   Neural Network compiler 0: 100 , name = conv1, output shape : (C,H,W) = (32, 
112, 112) 
   Neural Network compiler 1: 160 , name = conv1/bn, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 2: 245 , name = conv1/scale, output shape : (C,H,W) 
= (32, 112, 112) 
   Neural Network compiler 3: 130 , name = relu1, output shape : (C,H,W) = (32, 
112, 112) 
   Neural Network compiler 4: 100 , name = conv2_1/dw, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 5: 160 , name = conv2_1/dw/bn, output shape : 
(C,H,W) = (32, 112, 112) 
   Neural Network compiler 6: 245 , name = conv2_1/dw/scale, output shape : 
(C,H,W) = (32, 112, 112) 
   Neural Network compiler 7: 130 , name = relu2_1/dw, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 8: 100 , name = conv2_1/sep, output shape : (C,H,W) 
= (64, 112, 112) 
   Neural Network compiler 9: 160 , name = conv2_1/sep/bn, output shape : 
(C,H,W) = (64, 112, 112) 
   Neural Network compiler 10: 245 , name = conv2_1/sep/scale, output shape : 
(C,H,W) = (64, 112, 112) 
   Neural Network compiler 11: 130 , name = relu2_1/sep, output shape : (C,H,W) 
= (64, 112, 112) 
   Neural Network compiler 12: 100 , name = conv2_2/dw, output shape : (C,H,W) 
= (64, 56, 56) 
   Neural Network compiler 13: 160 , name = conv2_2/dw/bn, output shape : 
(C,H,W) = (64, 56, 56) 
   Neural Network compiler 14: 245 , name = conv2_2/dw/scale, output shape : 
(C,H,W) = (64, 56, 56) 
   Neural Network compiler 15: 130 , name = relu2_2/dw, output shape : (C,H,W) 
= (64, 56, 56) 
   Neural Network compiler 16: 100 , name = conv2_2/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 17: 160 , name = conv2_2/sep/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 18: 245 , name = conv2_2/sep/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 19: 130 , name = relu2_2/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 20: 100 , name = conv3_1/dw, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 21: 160 , name = conv3_1/dw/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 22: 245 , name = conv3_1/dw/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 23: 130 , name = relu3_1/dw, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 24: 100 , name = conv3_1/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 25: 160 , name = conv3_1/sep/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 26: 245 , name = conv3_1/sep/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 27: 130 , name = relu3_1/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 28: 100 , name = conv3_2/dw, output shape : (C,H,W) 
= (128, 28, 28) 
   Neural Network compiler 29: 160 , name = conv3_2/dw/bn, output shape : 
(C,H,W) = (128, 28, 28) 
   Neural Network compiler 30: 245 , name = conv3_2/dw/scale, output shape : 
(C,H,W) = (128, 28, 28) 
   Neural Network compiler 31: 130 , name = relu3_2/dw, output shape : (C,H,W) 
= (128, 28, 28) 
   Neural Network compiler 32: 100 , name = conv3_2/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 33: 160 , name = conv3_2/sep/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 34: 245 , name = conv3_2/sep/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 35: 130 , name = relu3_2/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 36: 100 , name = conv4_1/dw, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 37: 160 , name = conv4_1/dw/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 38: 245 , name = conv4_1/dw/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 39: 130 , name = relu4_1/dw, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 40: 100 , name = conv4_1/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 41: 160 , name = conv4_1/sep/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 42: 245 , name = conv4_1/sep/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 43: 130 , name = relu4_1/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 44: 100 , name = conv4_2/dw, output shape : (C,H,W) 
= (256, 14, 14) 
   Neural Network compiler 45: 160 , name = conv4_2/dw/bn, output shape : 
(C,H,W) = (256, 14, 14) 
   Neural Network compiler 46: 245 , name = conv4_2/dw/scale, output shape : 
(C,H,W) = (256, 14, 14) 
   Neural Network compiler 47: 130 , name = relu4_2/dw, output shape : (C,H,W) 
= (256, 14, 14) 
   Neural Network compiler 48: 100 , name = conv4_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 49: 160 , name = conv4_2/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 50: 245 , name = conv4_2/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 51: 130 , name = relu4_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 52: 100 , name = conv5_1/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 53: 160 , name = conv5_1/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 54: 245 , name = conv5_1/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 55: 130 , name = relu5_1/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 56: 100 , name = conv5_1/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 57: 160 , name = conv5_1/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 58: 245 , name = conv5_1/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 59: 130 , name = relu5_1/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 60: 100 , name = conv5_2/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 61: 160 , name = conv5_2/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 62: 245 , name = conv5_2/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 63: 130 , name = relu5_2/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 64: 100 , name = conv5_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 65: 160 , name = conv5_2/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 66: 245 , name = conv5_2/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 67: 130 , name = relu5_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 68: 100 , name = conv5_3/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 69: 160 , name = conv5_3/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 70: 245 , name = conv5_3/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 71: 130 , name = relu5_3/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 72: 100 , name = conv5_3/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 73: 160 , name = conv5_3/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 74: 245 , name = conv5_3/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 75: 130 , name = relu5_3/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 76: 100 , name = conv5_4/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 77: 160 , name = conv5_4/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 78: 245 , name = conv5_4/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 79: 130 , name = relu5_4/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 80: 100 , name = conv5_4/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 81: 160 , name = conv5_4/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 82: 245 , name = conv5_4/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 83: 130 , name = relu5_4/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 84: 100 , name = conv5_5/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 85: 160 , name = conv5_5/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 86: 245 , name = conv5_5/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 87: 130 , name = relu5_5/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 88: 100 , name = conv5_5/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 89: 160 , name = conv5_5/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 90: 245 , name = conv5_5/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 91: 130 , name = relu5_5/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 92: 100 , name = conv5_6/dw, output shape : (C,H,W) 
= (512, 7, 7) 
   Neural Network compiler 93: 160 , name = conv5_6/dw/bn, output shape : 
(C,H,W) = (512, 7, 7) 
   Neural Network compiler 94: 245 , name = conv5_6/dw/scale, output shape : 
(C,H,W) = (512, 7, 7) 
   Neural Network compiler 95: 130 , name = relu5_6/dw, output shape : (C,H,W) 
= (512, 7, 7) 
   Neural Network compiler 96: 100 , name = conv5_6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 97: 160 , name = conv5_6/sep/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 98: 245 , name = conv5_6/sep/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 99: 130 , name = relu5_6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 100: 100 , name = conv6/dw, output shape : (C,H,W) = 
(1024, 7, 7) 
   Neural Network compiler 101: 160 , name = conv6/dw/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 102: 245 , name = conv6/dw/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 103: 130 , name = relu6/dw, output shape : (C,H,W) = 
(1024, 7, 7) 
   Neural Network compiler 104: 100 , name = conv6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 105: 160 , name = conv6/sep/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 106: 245 , name = conv6/sep/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 107: 130 , name = relu6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 108: 120 , name = pool6, output shape : (C,H,W) = 
(1024, 1, 1) 
   Neural Network compiler 109: 100 , name = fc7, output shape : (C,H,W) = 
(1000, 1, 1) 
   Neural Network compiler 110: 175 , name = prob, output shape : (C,H,W) = 
(1000, 1, 1) 
   [08:01:18] 
/Users/sam/dev/github/tvm/src/runtime/metal/metal_device_api.mm:136: 
Intializing Metal device 0, name=Intel(R) HD Graphics Unknown
   [08:01:18] 
/Users/sam/dev/github/tvm/src/runtime/metal/metal_device_api.mm:136: 
Intializing Metal device 1, name=AMD Radeon Pro 560
   Traceback (most recent call last):
   
     File "/Users/sam/dev/tvm_test/from_coreml.py", line 94, in <module>
       m.run()
   
     File 
"/Users/sam/dev/github/tvm/build-runtime/python-tvm/venv/lib/python3.7/site-packages/tvm-0.7.dev1-py3.7-macosx-10.13-x86_64.egg/tvm/contrib/graph_runtime.py",
 line 176, in run
       self._run()
   
     File 
"/Users/sam/dev/github/tvm/build-runtime/python-tvm/venv/lib/python3.7/site-packages/tvm-0.7.dev1-py3.7-macosx-10.13-x86_64.egg/tvm/_ffi/_ctypes/packed_func.py",
 line 213, in __call__
       raise get_last_ffi_error()
   
   tvm._ffi.base.TVMError: Traceback (most recent call last):
     [bt] (6) 7   ???                                 0x00007ffeedd86410 0x0 + 
140732888802320
     [bt] (5) 6   _ctypes.cpython-37m-darwin.so       0x000000010294a36f 
ffi_call_unix64 + 79
     [bt] (4) 5   libtvm.dylib                        0x000000010e317bd6 
TVMFuncCall + 70
     [bt] (3) 4   libtvm.dylib                        0x000000010e3727af 
std::__1::__function::__func<tvm::runtime::GraphRuntime::GetFunction(std::__1::basic_string<char,
 std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_9, 
std::__1::allocator<tvm::runtime::GraphRuntime::GetFunction(std::__1::basic_string<char,
 std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_9>, void 
(tvm::runtime::TVMArgs, 
tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, 
tvm::runtime::TVMRetValue*&&) + 79
     [bt] (2) 3   libtvm.dylib                        0x000000010e36fc91 
std::__1::__function::__func<tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam
 const&, std::__1::vector<DLTensor, std::__1::allocator<DLTensor> > const&, 
unsigned long)::$_2, 
std::__1::allocator<tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam
 const&, std::__1::vector<DLTensor, std::__1::allocator<DLTensor> > const&, 
unsigned long)::$_2>, void ()>::operator()() + 81
     [bt] (1) 2   libtvm.dylib                        0x000000010e3219d9 
std::__1::__function::__func<tvm::runtime::WrapPackedFunc(int (*)(TVMValue*, 
int*, int, TVMValue*, int*), tvm::runtime::ObjectPtr<tvm::runtime::Object> 
const&)::$_0, std::__1::allocator<tvm::runtime::WrapPackedFunc(int 
(*)(TVMValue*, int*, int, TVMValue*, int*), 
tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::$_0>, void 
(tvm::runtime::TVMArgs, 
tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, 
tvm::runtime::TVMRetValue*&&) + 313
     [bt] (0) 1   libtvm.dylib                        0x000000010d8b2829 
dmlc::LogMessageFatal::~LogMessageFatal() + 57
     File "/Users/sam/dev/github/tvm/src/runtime/library_module.cc", line 89
   TVMError: Check failed: ret == 0 (-1 vs. 0) : Assert fail: (dev_type == 1), 
device_type need to be 1
   ```
   
   note `TVMError: Check failed: ret == 0 (-1 vs. 0) : Assert fail: (dev_type 
== 1), device_type need to be 1`
   
   When reverting the single line edit back to`ctx=tvm.cpu(0)`
   
   The following is the output
   
   ```
   (venv) kaosnew:build sam$ python ~/dev/tvm_test/from_coreml.py 
   WARNING:root:TensorFlow version 2.1.0 detected. Last version known to be 
fully compatible is 1.14.0 .
   File /Users/sam/.tvm_test_data/coreml/mobilenet.mlmodel exists, skip.
   File /Users/sam/.tvm_test_data/data/cat.png exists, skip.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 3, 226, 226), 'float32'), 
('TENSOR', (32, 3, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 32, 114, 114), 
'float32'), ('TENSOR', (32, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 32, 112, 112), 'float32'), 
('TENSOR', (64, 32, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 64, 114, 114), 
'float32'), ('TENSOR', (64, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 64, 56, 56), 'float32'), 
('TENSOR', (128, 64, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 128, 58, 58), 
'float32'), ('TENSOR', (128, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 128, 56, 56), 'float32'), 
('TENSOR', (128, 128, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 128, 58, 58), 
'float32'), ('TENSOR', (128, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 128, 28, 28), 'float32'), 
('TENSOR', (256, 128, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 256, 30, 30), 
'float32'), ('TENSOR', (256, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 256, 28, 28), 'float32'), 
('TENSOR', (256, 256, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 256, 30, 30), 
'float32'), ('TENSOR', (256, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 256, 14, 14), 'float32'), 
('TENSOR', (512, 256, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 512, 16, 16), 
'float32'), ('TENSOR', (512, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 512, 14, 14), 'float32'), 
('TENSOR', (512, 512, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 512, 16, 16), 
'float32'), ('TENSOR', (512, 1, 3, 3), 'float32'), (2, 2), (0, 0, 0, 0), (1, 
1), 'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may 
bring great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 512, 7, 7), 'float32'), ('TENSOR', 
(1024, 512, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 'NCHW', 
'float32'). A fallback configuration is used, which may bring great performance 
regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('depthwise_conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 9, 9), 'float32'), 
('TENSOR', (1024, 1, 3, 3), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 'NCHW', 
'NCHW', 'float32'). A fallback configuration is used, which may bring great 
performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 7, 7), 'float32'), 
('TENSOR', (1024, 1024, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   WARNING:autotvm:Cannot find config for target=llvm, 
workload=('conv2d_NCHWc.x86', ('TENSOR', (1, 1024, 1, 1), 'float32'), 
('TENSOR', (1000, 1024, 1, 1), 'float32'), (1, 1), (0, 0, 0, 0), (1, 1), 
'NCHW', 'NCHW', 'float32'). A fallback configuration is used, which may bring 
great performance regression.
   File /Users/sam/.tvm_test_data/data/imagenet1000_clsid_to_human.txt exists, 
skip.
   Top-1 id 282 class name tiger cat
   Input name(s) and shape(s): 
   image : (C,H,W) = (3, 224, 224) 
   Neural Network compiler 0: 100 , name = conv1, output shape : (C,H,W) = (32, 
112, 112) 
   Neural Network compiler 1: 160 , name = conv1/bn, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 2: 245 , name = conv1/scale, output shape : (C,H,W) 
= (32, 112, 112) 
   Neural Network compiler 3: 130 , name = relu1, output shape : (C,H,W) = (32, 
112, 112) 
   Neural Network compiler 4: 100 , name = conv2_1/dw, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 5: 160 , name = conv2_1/dw/bn, output shape : 
(C,H,W) = (32, 112, 112) 
   Neural Network compiler 6: 245 , name = conv2_1/dw/scale, output shape : 
(C,H,W) = (32, 112, 112) 
   Neural Network compiler 7: 130 , name = relu2_1/dw, output shape : (C,H,W) = 
(32, 112, 112) 
   Neural Network compiler 8: 100 , name = conv2_1/sep, output shape : (C,H,W) 
= (64, 112, 112) 
   Neural Network compiler 9: 160 , name = conv2_1/sep/bn, output shape : 
(C,H,W) = (64, 112, 112) 
   Neural Network compiler 10: 245 , name = conv2_1/sep/scale, output shape : 
(C,H,W) = (64, 112, 112) 
   Neural Network compiler 11: 130 , name = relu2_1/sep, output shape : (C,H,W) 
= (64, 112, 112) 
   Neural Network compiler 12: 100 , name = conv2_2/dw, output shape : (C,H,W) 
= (64, 56, 56) 
   Neural Network compiler 13: 160 , name = conv2_2/dw/bn, output shape : 
(C,H,W) = (64, 56, 56) 
   Neural Network compiler 14: 245 , name = conv2_2/dw/scale, output shape : 
(C,H,W) = (64, 56, 56) 
   Neural Network compiler 15: 130 , name = relu2_2/dw, output shape : (C,H,W) 
= (64, 56, 56) 
   Neural Network compiler 16: 100 , name = conv2_2/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 17: 160 , name = conv2_2/sep/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 18: 245 , name = conv2_2/sep/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 19: 130 , name = relu2_2/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 20: 100 , name = conv3_1/dw, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 21: 160 , name = conv3_1/dw/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 22: 245 , name = conv3_1/dw/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 23: 130 , name = relu3_1/dw, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 24: 100 , name = conv3_1/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 25: 160 , name = conv3_1/sep/bn, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 26: 245 , name = conv3_1/sep/scale, output shape : 
(C,H,W) = (128, 56, 56) 
   Neural Network compiler 27: 130 , name = relu3_1/sep, output shape : (C,H,W) 
= (128, 56, 56) 
   Neural Network compiler 28: 100 , name = conv3_2/dw, output shape : (C,H,W) 
= (128, 28, 28) 
   Neural Network compiler 29: 160 , name = conv3_2/dw/bn, output shape : 
(C,H,W) = (128, 28, 28) 
   Neural Network compiler 30: 245 , name = conv3_2/dw/scale, output shape : 
(C,H,W) = (128, 28, 28) 
   Neural Network compiler 31: 130 , name = relu3_2/dw, output shape : (C,H,W) 
= (128, 28, 28) 
   Neural Network compiler 32: 100 , name = conv3_2/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 33: 160 , name = conv3_2/sep/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 34: 245 , name = conv3_2/sep/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 35: 130 , name = relu3_2/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 36: 100 , name = conv4_1/dw, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 37: 160 , name = conv4_1/dw/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 38: 245 , name = conv4_1/dw/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 39: 130 , name = relu4_1/dw, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 40: 100 , name = conv4_1/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 41: 160 , name = conv4_1/sep/bn, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 42: 245 , name = conv4_1/sep/scale, output shape : 
(C,H,W) = (256, 28, 28) 
   Neural Network compiler 43: 130 , name = relu4_1/sep, output shape : (C,H,W) 
= (256, 28, 28) 
   Neural Network compiler 44: 100 , name = conv4_2/dw, output shape : (C,H,W) 
= (256, 14, 14) 
   Neural Network compiler 45: 160 , name = conv4_2/dw/bn, output shape : 
(C,H,W) = (256, 14, 14) 
   Neural Network compiler 46: 245 , name = conv4_2/dw/scale, output shape : 
(C,H,W) = (256, 14, 14) 
   Neural Network compiler 47: 130 , name = relu4_2/dw, output shape : (C,H,W) 
= (256, 14, 14) 
   Neural Network compiler 48: 100 , name = conv4_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 49: 160 , name = conv4_2/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 50: 245 , name = conv4_2/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 51: 130 , name = relu4_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 52: 100 , name = conv5_1/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 53: 160 , name = conv5_1/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 54: 245 , name = conv5_1/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 55: 130 , name = relu5_1/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 56: 100 , name = conv5_1/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 57: 160 , name = conv5_1/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 58: 245 , name = conv5_1/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 59: 130 , name = relu5_1/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 60: 100 , name = conv5_2/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 61: 160 , name = conv5_2/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 62: 245 , name = conv5_2/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 63: 130 , name = relu5_2/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 64: 100 , name = conv5_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 65: 160 , name = conv5_2/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 66: 245 , name = conv5_2/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 67: 130 , name = relu5_2/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 68: 100 , name = conv5_3/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 69: 160 , name = conv5_3/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 70: 245 , name = conv5_3/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 71: 130 , name = relu5_3/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 72: 100 , name = conv5_3/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 73: 160 , name = conv5_3/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 74: 245 , name = conv5_3/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 75: 130 , name = relu5_3/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 76: 100 , name = conv5_4/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 77: 160 , name = conv5_4/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 78: 245 , name = conv5_4/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 79: 130 , name = relu5_4/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 80: 100 , name = conv5_4/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 81: 160 , name = conv5_4/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 82: 245 , name = conv5_4/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 83: 130 , name = relu5_4/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 84: 100 , name = conv5_5/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 85: 160 , name = conv5_5/dw/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 86: 245 , name = conv5_5/dw/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 87: 130 , name = relu5_5/dw, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 88: 100 , name = conv5_5/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 89: 160 , name = conv5_5/sep/bn, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 90: 245 , name = conv5_5/sep/scale, output shape : 
(C,H,W) = (512, 14, 14) 
   Neural Network compiler 91: 130 , name = relu5_5/sep, output shape : (C,H,W) 
= (512, 14, 14) 
   Neural Network compiler 92: 100 , name = conv5_6/dw, output shape : (C,H,W) 
= (512, 7, 7) 
   Neural Network compiler 93: 160 , name = conv5_6/dw/bn, output shape : 
(C,H,W) = (512, 7, 7) 
   Neural Network compiler 94: 245 , name = conv5_6/dw/scale, output shape : 
(C,H,W) = (512, 7, 7) 
   Neural Network compiler 95: 130 , name = relu5_6/dw, output shape : (C,H,W) 
= (512, 7, 7) 
   Neural Network compiler 96: 100 , name = conv5_6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 97: 160 , name = conv5_6/sep/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 98: 245 , name = conv5_6/sep/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 99: 130 , name = relu5_6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 100: 100 , name = conv6/dw, output shape : (C,H,W) = 
(1024, 7, 7) 
   Neural Network compiler 101: 160 , name = conv6/dw/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 102: 245 , name = conv6/dw/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 103: 130 , name = relu6/dw, output shape : (C,H,W) = 
(1024, 7, 7) 
   Neural Network compiler 104: 100 , name = conv6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 105: 160 , name = conv6/sep/bn, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 106: 245 , name = conv6/sep/scale, output shape : 
(C,H,W) = (1024, 7, 7) 
   Neural Network compiler 107: 130 , name = relu6/sep, output shape : (C,H,W) 
= (1024, 7, 7) 
   Neural Network compiler 108: 120 , name = pool6, output shape : (C,H,W) = 
(1024, 1, 1) 
   Neural Network compiler 109: 100 , name = fc7, output shape : (C,H,W) = 
(1000, 1, 1) 
   Neural Network compiler 110: 175 , name = prob, output shape : (C,H,W) = 
(1000, 1, 1) 
   ```
   
   my `config.cmake` is as follows
   
   ```
   # Licensed to the Apache Software Foundation (ASF) under one
   # or more contributor license agreements.  See the NOTICE file
   # distributed with this work for additional information
   # regarding copyright ownership.  The ASF licenses this file
   # to you under the Apache License, Version 2.0 (the
   # "License"); you may not use this file except in compliance
   # with the License.  You may obtain a copy of the License at
   #
   #   http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing,
   # software distributed under the License is distributed on an
   # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   # KIND, either express or implied.  See the License for the
   # specific language governing permissions and limitations
   # under the License.
   
   #--------------------------------------------------------------------
   #  Template custom cmake configuration for compiling
   #
   #  This file is used to override the build options in build.
   #  If you want to change the configuration, please use the following
   #  steps. Assume you are on the root directory. First copy the this
   #  file so that any local changes will be ignored by git
   #
   #  $ mkdir build
   #  $ cp cmake/config.cmake build
   #
   #  Next modify the according entries, and then compile by
   #
   #  $ cd build
   #  $ cmake ..
   #
   #  Then build in parallel with 8 threads
   #
   #  $ make -j8
   #--------------------------------------------------------------------
   
   #---------------------------------------------
   # Backend runtimes.
   #---------------------------------------------
   
   # Whether enable CUDA during compile,
   #
   # Possible values:
   # - ON: enable CUDA with cmake's auto search
   # - OFF: disable CUDA
   # - /path/to/cuda: use specific path to cuda toolkit
   set(USE_CUDA OFF)
   
   # Whether enable ROCM runtime
   #
   # Possible values:
   # - ON: enable ROCM with cmake's auto search
   # - OFF: disable ROCM
   # - /path/to/rocm: use specific path to rocm
   set(USE_ROCM OFF)
   
   # Whether enable SDAccel runtime
   set(USE_SDACCEL OFF)
   
   # Whether enable Intel FPGA SDK for OpenCL (AOCL) runtime
   set(USE_AOCL OFF)
   
   # Whether enable OpenCL runtime
   set(USE_OPENCL OFF)
   
   # Whether enable Metal runtime
   set(USE_METAL ON)
   
   # Whether enable Vulkan runtime
   #
   # Possible values:
   # - ON: enable Vulkan with cmake's auto search
   # - OFF: disable vulkan
   # - /path/to/vulkan-sdk: use specific path to vulkan-sdk
   set(USE_VULKAN OFF)
   
   # Whether enable OpenGL runtime
   set(USE_OPENGL OFF)
   
   # Whether enable MicroTVM runtime
   set(USE_MICRO OFF)
   
   # Whether to enable SGX runtime
   #
   # Possible values for USE_SGX:
   # - /path/to/sgxsdk: path to Intel SGX SDK
   # - OFF: disable SGX
   #
   # SGX_MODE := HW|SIM
   set(USE_SGX OFF)
   set(SGX_MODE "SIM")
   set(RUST_SGX_SDK "/path/to/rust-sgx-sdk")
   
   # Whether enable RPC runtime
   set(USE_RPC ON)
   
   # Whether embed stackvm into the runtime
   set(USE_STACKVM_RUNTIME OFF)
   
   # Whether enable tiny embedded graph runtime.
   set(USE_GRAPH_RUNTIME ON)
   
   # Whether enable additional graph debug functions
   set(USE_GRAPH_RUNTIME_DEBUG OFF)
   
   # Whether enable additional vm profiler functions
   set(USE_VM_PROFILER OFF)
   
   # Whether enable uTVM standalone runtime
   set(USE_MICRO_STANDALONE_RUNTIME OFF)
   
   # Whether build with LLVM support
   # Requires LLVM version >= 4.0
   #
   # Possible values:
   # - ON: enable llvm with cmake's find search
   # - OFF: disable llvm
   # - /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is 
available.
   set(USE_LLVM ON)
   
   #---------------------------------------------
   # Contrib libraries
   #---------------------------------------------
   # Whether use BLAS, choices: openblas, mkl, atlas, apple
   set(USE_BLAS none)
   
   # /path/to/mkl: mkl root path when use mkl blas library
   # set(USE_MKL_PATH /opt/intel/mkl) for UNIX
   # set(USE_MKL_PATH ../IntelSWTools/compilers_and_libraries_2018/windows/mkl) 
for WIN32
   # set(USE_MKL_PATH <path to venv or site-packages directory>) if using `pip 
install mkl`
   set(USE_MKL_PATH none)
   
   # Whether use MKLDNN library, choices: ON, OFF, path to mkldnn library
   set(USE_MKLDNN OFF)
   
   # Whether use OpenMP thread pool, choices: gnu, intel
   # Note: "gnu" uses gomp library, "intel" uses iomp5 library
   set(USE_OPENMP none)
   
   # Whether use contrib.random in runtime
   set(USE_RANDOM OFF)
   
   # Whether use NNPack
   set(USE_NNPACK OFF)
   
   # Possible values:
   # - ON: enable tflite with cmake's find search
   # - OFF: disable tflite
   # - /path/to/libtensorflow-lite.a: use specific path to tensorflow lite 
library
   set(USE_TFLITE OFF)
   
   # /path/to/tensorflow: tensorflow root path when use tflite library
   set(USE_TENSORFLOW_PATH none)
   
   # Possible values:
   # - OFF: disable tflite support for edgetpu
   # - /path/to/edgetpu: use specific path to edgetpu library
   set(USE_EDGETPU OFF)
   
   # Whether use CuDNN
   set(USE_CUDNN OFF)
   
   # Whether use cuBLAS
   set(USE_CUBLAS OFF)
   
   # Whether use MIOpen
   set(USE_MIOPEN OFF)
   
   # Whether use MPS
   set(USE_MPS OFF)
   
   # Whether use rocBlas
   set(USE_ROCBLAS OFF)
   
   # Whether use contrib sort
   set(USE_SORT ON)
   
   # Whether use MKL-DNN (DNNL) codegen
   set(USE_DNNL_CODEGEN OFF)
   
   # Build ANTLR parser for Relay text format
   # Possible values:
   # - ON: enable ANTLR by searching default locations (cmake find_program for 
antlr4 and /usr/local for jar)
   # - OFF: disable ANTLR
   # - /path/to/antlr-*-complete.jar: path to specific ANTLR jar file
   set(USE_ANTLR OFF)
   
   # Whether use Relay debug mode
   set(USE_RELAY_DEBUG OFF)
   
   # Whether to build fast VTA simulator driver
   set(USE_VTA_FSIM OFF)
   
   # Whether to build cycle-accurate VTA simulator driver
   set(USE_VTA_TSIM OFF)
   
   # Whether to build VTA FPGA driver (device side only)
   set(USE_VTA_FPGA OFF)
   
   # Whether to build the example external runtime module
   set(USE_EXAMPLE_EXT_RUNTIME OFF)
   
   # Whether use Thrust
   set(USE_THRUST OFF)
   ```
   
   which results in
   
   ```
   (venv) kaosnew:build sam$ cmake ..
   -- Build with RPC support...
   -- Build with Graph runtime support...
   -- VTA build with VTA_HW_PATH=/Users/sam/dev/github/tvm/3rdparty/vta-hw
   -- Build VTA runtime with target: sim
   -- Build with Metal support
   -- Link with dynamic LLVM library
   -- Found LLVM_INCLUDE_DIRS=/usr/local/opt/llvm/include
   -- Found LLVM_DEFINITIONS=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS
   -- Found TVM_LLVM_VERSION=90
   -- Build with LLVM 9.0.1
   -- Set TVM_LLVM_VERSION=90
   -- Build with contrib.sort
   -- Build with contrib.hybriddump
   -- Build with c++14
   -- Build with thread support...
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /Users/sam/dev/github/tvm/build
   ```
   
   In case this is relevant
   
   ```
   (venv) kaosnew:build sam$ g++ -v
   Configured with: 
--prefix=/Applications/Xcode9.4.1.app/Contents/Developer/usr 
--with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
   Apple LLVM version 9.1.0 (clang-902.0.39.2)
   Target: x86_64-apple-darwin17.7.0
   Thread model: posix
   InstalledDir: 
/Applications/Xcode9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
   Found CUDA installation: /usr/local/cuda, version unknown
   ```
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to