Skip to content

Commit

Permalink
[TEST] use rpc.LocalSession for simple tests (apache#6294)
Browse files Browse the repository at this point in the history
To avoid flaky due to networking.
  • Loading branch information
tqchen authored and Trevor Morris committed Aug 26, 2020
1 parent 78b8a66 commit 5bc05f9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/python/unittest/test_runtime_module_based_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ def verify_rpc_cpu_export(obj_format):
complied_graph_lib.export_library(path_lib)

from tvm import rpc
server = rpc.Server("localhost", use_popen=True, port=9093)
remote = rpc.connect(server.host, server.port)
remote = rpc.LocalSession()
remote.upload(path_lib)
loaded_lib = remote.load_module(path_lib)
data = np.random.uniform(-1, 1, size=input_shape(mod)).astype("float32")
Expand Down Expand Up @@ -395,8 +394,7 @@ def verify_rpc_cpu_remove_package_params(obj_format):
fo.write(relay.save_param_dict(complied_graph_lib.get_params()))

from tvm import rpc
server = rpc.Server("localhost", use_popen=True, port=9095)
remote = rpc.connect(server.host, server.port)
remote = rpc.LocalSession()
remote.upload(path_lib)
loaded_lib = remote.load_module(path_lib)
data = np.random.uniform(-1, 1, size=input_shape(mod)).astype("float32")
Expand Down Expand Up @@ -447,8 +445,7 @@ def verify_rpc_gpu_remove_package_params(obj_format):
fo.write(relay.save_param_dict(complied_graph_lib.get_params()))

from tvm import rpc
server = rpc.Server("localhost", use_popen=True, port=9092)
remote = rpc.connect(server.host, server.port)
remote = rpc.LocalSession()
remote.upload(path_lib)
loaded_lib = remote.load_module(path_lib)
data = np.random.uniform(-1, 1, size=input_shape(mod)).astype("float32")
Expand Down

0 comments on commit 5bc05f9

Please sign in to comment.