ayeganov opened a new issue #9939:
URL: https://github.com/apache/tvm/issues/9939
I was following along the tutorial for converting the resnet 50 network
using `tvmc`, but hit a hard stop with the following message:
libc++abi: terminating with uncaught exception of type
tvm::runtime::InternalError
### Expected behavior
A tar file to be generated for running the network
### Actual behavior
Process gets aborted
### Environment
OS: MacOS Monterey 12.1, Darwin AY-M-D6ZQ 21.2.0 Darwin Kernel Version
21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64
TVM: 0.9.dev0
Graphics card: Intel(R) UHD Graphics 630, AMD Radeon Pro 555X
### Steps to reproduce
import numpy as np
import math
import os
import tvm
from tvm import relay, auto_scheduler
from tvm import testing
from tvm.contrib import utils, xcode, coreml_runtime, graph_runtime
target = "metal"
target_host = "llvm -mtriple=arm64-apple-darwin20.5.0"
def _get_model(shape, dtype, var_names):
"""Return a model and any parameters it may have."""
a = relay.var(next(var_names), shape=shape, dtype=dtype)
out = relay.op.reduce.mean(a, 0)
params = {}
return out, params
def converter(shape):
print("Shape: {}".format(shape))
dtype = "float32"
# b, data
inputs = {"data": tvm.nd.array(np.random.uniform(-128, 127,
shape).astype(dtype))}
mod, params = _get_model(shape, dtype, iter(inputs))
if isinstance(mod, tvm.relay.expr.Call):
mod = tvm.IRModule.from_expr(mod)
print('mod: ', mod)
with tvm.transform.PassContext(opt_level=3):
graph_module = relay.build(mod['main'], target=target,
target_host=target_host, params=params)
#with auto_scheduler.ApplyHistoryBest("my_mean_model_metal"):
# with tvm.transform.PassContext(opt_level=3,
config={"relay.backend.use_auto_scheduler": True}):
# graph_module = relay.build(mod['main'], target=target,
target_host=target_host, params=params)
return graph_module
def run(graph_module):
ctx = tvm.metal(0)
m =
graph_runtime.graph_executor.GraphModule(graph_module["default"](ctx))
m.run()
if __name__ == "__main__":
shape = (2, 1)
gm = converter(shape)
run(gm)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]