You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ubuntu 22.04 LTS as my local machine and Raspberry Pi 4 as my target remote device with an IP address : 192.168.91.173 and port: 9090
Steps to reproduce
build runtime on Raspberry Pi as shown in the tutorial
Set Up RPC Server on Raspberry Pi using the command : python -m tvm.exec.rpc_server --host 0.0.0.0 --port=9090
save the following code in local machine with LLVM enabled as rpc cross compilation.py and run :
import numpy as np
import tvm
from tvm import te
from tvm import rpc
from tvm.contrib import utils
n = tvm.runtime.convert(1024)
A = te.placeholder((n,), name="A")
B = te.compute((n,), lambda i: A[i] + 1.0, name="B")
s = te.create_schedule(B.op)
local_demo = False
if local_demo:
target = "llvm"
else:
target = "llvm -mtriple=aarch64-linux-gnu"
func = tvm.build(s, [A, B], target=target, name="add_one")
# save the lib at a local temp folder
temp = utils.tempdir()
path = temp.relpath("lib.tar")
func.export_library(path)
if local_demo:
remote = rpc.LocalSession()
else:
# The following is my environment, change this to the IP address of your target device
host = "192.168.91.173" #host IP address of my Raspberry Pi
port = 9090
remote = rpc.connect(host, port)
remote.upload(path)
func = remote.load_module("lib.tar")
# create arrays on the remote device
dev = remote.cpu()
a = tvm.nd.array(np.random.uniform(size=1024).astype(A.dtype), dev)
b = tvm.nd.array(np.zeros(1024, dtype=A.dtype), dev)
# the function will run on the remote device
func(a, b)
np.testing.assert_equal(b.numpy(), a.numpy() + 1)
time_f = func.time_evaluator(func.entry_name, dev, number=10)
cost = time_f(a, b).mean
print("%g secs/op" % cost)
The text was updated successfully, but these errors were encountered:
I remember seeing this error, it was fixed by updating and recompiling the runtime code on the device. Have you updated the runtime on the device recently?
masahi
changed the title
[Bug]
[Bug] RPCTimeEvaluator signature error
Oct 4, 2022
Expected behavior
The output should be something as follows that is shown in the user tutorial https://tvm.apache.org/docs/tutorial/cross_compilation_and_rpc.html#sphx-glr-tutorial-cross-compilation-and-rpc-py
1.389e-07 secs/op
Actual behavior
I got an error as shown below.
Environment
I am using ubuntu 22.04 LTS as my local machine and Raspberry Pi 4 as my target remote device with an IP address :
192.168.91.173
and port:9090
Steps to reproduce
python -m tvm.exec.rpc_server --host 0.0.0.0 --port=9090
The text was updated successfully, but these errors were encountered: