From 5bc05f92f6a4baead7b3897198d12993c53d2fa2 Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Mon, 17 Aug 2020 22:50:57 -0700 Subject: [PATCH] [TEST] use rpc.LocalSession for simple tests (#6294) To avoid flaky due to networking. --- .../unittest/test_runtime_module_based_interface.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/python/unittest/test_runtime_module_based_interface.py b/tests/python/unittest/test_runtime_module_based_interface.py index f97a4454f3bee..56ae250925104 100644 --- a/tests/python/unittest/test_runtime_module_based_interface.py +++ b/tests/python/unittest/test_runtime_module_based_interface.py @@ -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") @@ -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") @@ -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")