MCPcopy Index your code
hub / github.com/apache/tvm / verify_rpc

Function verify_rpc

tests/python/runtime/test_runtime_rpc.py:77–91  ·  view source on GitHub ↗
(remote, target, shape, dtype)

Source from the content-addressed store, hash-verified

75 return
76
77 def verify_rpc(remote, target, shape, dtype):
78 A = te.placeholder(shape, dtype=dtype)
79 B = te.compute(A.shape, lambda i: A[i] + tvm.tirx.const(1, A.dtype))
80 f = tvm.compile(te.create_prim_func([A, B]), target=target)
81
82 dev = remote.cpu(0)
83 a = tvm.runtime.tensor(np.random.randint(0, 256, size=shape).astype(A.dtype), device=dev)
84 b = tvm.runtime.tensor(np.zeros(shape).astype(A.dtype), device=dev)
85 temp = utils.tempdir()
86 path_dso = temp.relpath("dev_lib.o")
87 f.write_to_file(path_dso)
88 remote.upload(path_dso)
89 f = remote.load_module("dev_lib.o")
90 f(a, b)
91 tvm.testing.assert_allclose(a.numpy() + 1, b.numpy())
92
93 print("Test RPC connection to PowerPC...")
94 remote = rpc.connect(host, port)

Callers 1

test_bigendian_rpcFunction · 0.85

Calls 10

placeholderMethod · 0.80
relpathMethod · 0.80
numpyMethod · 0.80
fFunction · 0.50
compileMethod · 0.45
cpuMethod · 0.45
astypeMethod · 0.45
zerosMethod · 0.45
uploadMethod · 0.45
load_moduleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…