From f4a680d80cba38a503227de508c61faed29db458 Mon Sep 17 00:00:00 2001 From: Robert Kimball Date: Sun, 2 May 2021 04:43:12 -0700 Subject: [PATCH] Replace 0.0.0.0 with 127.0.0.1 for client connections (#7766) * Rename references to 0.0.0.0 to localhost. Also change references to 127.0.0.1 to localhost so that all references are consistent. 0.0.0.0 is not the same as localhost. --- apps/benchmark/arm_cpu_imagenet_bench.py | 2 +- apps/benchmark/mobile_gpu_imagenet_bench.py | 2 +- docs/deploy/arm_compute_lib.rst | 2 +- jvm/README.md | 2 +- .../apache/tvm/contrib/GraphExecutorTest.java | 2 +- .../test/java/org/apache/tvm/rpc/RPCTest.java | 4 +- .../src/test/scripts/test_rpc_proxy_server.py | 2 +- python/tvm/auto_scheduler/measure.py | 8 +- python/tvm/autotvm/database.py | 2 +- .../autotvm/graph_tuner/base_graph_tuner.py | 2 +- python/tvm/autotvm/measure/measure_methods.py | 7 +- python/tvm/error.py | 2 +- python/tvm/exec/measure_peak.py | 6 +- python/tvm/exec/query_rpc_tracker.py | 2 +- python/tvm/exec/rpc_proxy.py | 2 +- python/tvm/exec/rpc_server.py | 4 +- python/tvm/exec/rpc_tracker.py | 4 +- python/tvm/rpc/proxy.py | 2 +- python/tvm/rpc/server.py | 5 +- python/tvm/rpc/tracker.py | 8 +- .../test_arm_compute_lib/infrastructure.py | 2 +- .../test_arm_compute_lib/test_config.json | 2 +- .../contrib/test_bnns/infrastructure.py | 2 +- tests/python/contrib/test_coreml_runtime.py | 2 +- tests/python/contrib/test_edgetpu_runtime.py | 2 +- tests/python/contrib/test_random.py | 4 +- tests/python/contrib/test_rpc_tracker.py | 14 ++-- tests/python/contrib/test_tflite_runtime.py | 2 +- tests/python/unittest/test_runtime_graph.py | 2 +- .../unittest/test_runtime_graph_debug.py | 2 +- .../test_runtime_module_based_interface.py | 2 +- tests/python/unittest/test_runtime_rpc.py | 79 +++++++++---------- tutorials/auto_scheduler/tune_network_arm.py | 4 +- tutorials/auto_scheduler/tune_network_mali.py | 10 +-- tutorials/autotvm/tune_relay_arm.py | 4 +- tutorials/autotvm/tune_relay_cuda.py | 6 +- tutorials/autotvm/tune_relay_mobile_gpu.py | 4 +- tutorials/frontend/deploy_model_on_android.py | 2 +- vta/python/vta/exec/rpc_server.py | 4 +- vta/tutorials/autotvm/tune_relay_vta.py | 2 +- web/tests/python/webgpu_rpc_test.py | 2 +- web/tests/python/websock_rpc_test.py | 2 +- 42 files changed, 114 insertions(+), 111 deletions(-) diff --git a/apps/benchmark/arm_cpu_imagenet_bench.py b/apps/benchmark/arm_cpu_imagenet_bench.py index 656735ec6c05..30607f79f5fb 100644 --- a/apps/benchmark/arm_cpu_imagenet_bench.py +++ b/apps/benchmark/arm_cpu_imagenet_bench.py @@ -98,7 +98,7 @@ def evaluate_network(network, target, target_host, repeat): help="The model of the test device. If your device is not listed in " "the choices list, pick the most similar one as argument.", ) - parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--host", type=str, default="127.0.0.1") parser.add_argument("--port", type=int, default=9190) parser.add_argument("--rpc-key", type=str, required=True) parser.add_argument("--repeat", type=int, default=10) diff --git a/apps/benchmark/mobile_gpu_imagenet_bench.py b/apps/benchmark/mobile_gpu_imagenet_bench.py index 4eff259875ca..01d1f13c08b3 100644 --- a/apps/benchmark/mobile_gpu_imagenet_bench.py +++ b/apps/benchmark/mobile_gpu_imagenet_bench.py @@ -98,7 +98,7 @@ def evaluate_network(network, target, target_host, dtype, repeat): help="The model of the test device. If your device is not listed in " "the choices list, pick the most similar one as argument.", ) - parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--host", type=str, default="127.0.0.1") parser.add_argument("--port", type=int, default=9190) parser.add_argument("--rpc-key", type=str, required=True) parser.add_argument("--repeat", type=int, default=30) diff --git a/docs/deploy/arm_compute_lib.rst b/docs/deploy/arm_compute_lib.rst index 4e43682a240a..1abc31bbb422 100644 --- a/docs/deploy/arm_compute_lib.rst +++ b/docs/deploy/arm_compute_lib.rst @@ -178,7 +178,7 @@ An example configuration for `test_config.json`: { "connection_type": "local", - "host": "localhost", + "host": "127.0.0.1", "port": 9090, "target": "llvm -mtriple=aarch64-linux-gnu -mattr=+neon", "device_key": "", diff --git a/jvm/README.md b/jvm/README.md index 6e71adf65683..a481756ff48d 100644 --- a/jvm/README.md +++ b/jvm/README.md @@ -164,7 +164,7 @@ server.start(); This will open a socket and wait for remote requests. You can use Java, Python, or any other frontend to make an RPC call. Here's an example for calling remote function `test.rpc.strcat` in Java. ```java -RPCSession client = Client.connect("localhost", port.value); +RPCSession client = Client.connect("127.0.0.1", port.value); Function func = client.getFunction("test.rpc.strcat"); String result = func.call("abc", 11L).asString(); ``` diff --git a/jvm/core/src/test/java/org/apache/tvm/contrib/GraphExecutorTest.java b/jvm/core/src/test/java/org/apache/tvm/contrib/GraphExecutorTest.java index 0a5fa9a67e3a..f79253e487e1 100644 --- a/jvm/core/src/test/java/org/apache/tvm/contrib/GraphExecutorTest.java +++ b/jvm/core/src/test/java/org/apache/tvm/contrib/GraphExecutorTest.java @@ -86,7 +86,7 @@ public void test_add_one_remote() throws IOException { Server server = null; try { server = TestUtils.startServer(port); - RPCSession remote = Client.connect("localhost", port.value); + RPCSession remote = Client.connect("127.0.0.1", port.value); Device dev = remote.cpu(); remote.upload(new File(libPath)); diff --git a/jvm/core/src/test/java/org/apache/tvm/rpc/RPCTest.java b/jvm/core/src/test/java/org/apache/tvm/rpc/RPCTest.java index 07181642fbeb..641633def8a0 100644 --- a/jvm/core/src/test/java/org/apache/tvm/rpc/RPCTest.java +++ b/jvm/core/src/test/java/org/apache/tvm/rpc/RPCTest.java @@ -47,7 +47,7 @@ public void test_addone() { Server server = null; try { server = TestUtils.startServer(port); - RPCSession client = Client.connect("localhost", port.value); + RPCSession client = Client.connect("127.0.0.1", port.value); Function func = client.getFunction("test.rpc.addone"); assertEquals(11L, func.call(10).asLong()); } finally { @@ -73,7 +73,7 @@ public void test_strcat() { Server server = null; try { server = TestUtils.startServer(port); - RPCSession client = Client.connect("localhost", port.value); + RPCSession client = Client.connect("127.0.0.1", port.value); Function func = client.getFunction("test.rpc.strcat"); assertEquals("abc:11", func.call("abc", 11L).asString()); } finally { diff --git a/jvm/core/src/test/scripts/test_rpc_proxy_server.py b/jvm/core/src/test/scripts/test_rpc_proxy_server.py index d3e23e1ae672..664b65da42da 100644 --- a/jvm/core/src/test/scripts/test_rpc_proxy_server.py +++ b/jvm/core/src/test/scripts/test_rpc_proxy_server.py @@ -19,7 +19,7 @@ def start_proxy_server(port, timeout): - prox = proxy.Proxy("localhost", port=port, port_end=port + 1) + prox = proxy.Proxy("127.0.0.1", port=port, port_end=port + 1) if timeout > 0: import time diff --git a/python/tvm/auto_scheduler/measure.py b/python/tvm/auto_scheduler/measure.py index e77721496386..55a91148bc94 100644 --- a/python/tvm/auto_scheduler/measure.py +++ b/python/tvm/auto_scheduler/measure.py @@ -552,20 +552,18 @@ def __init__( if dev.exist: cuda_arch = "sm_" + "".join(dev.compute_version.split(".")) set_cuda_target_arch(cuda_arch) - host = "0.0.0.0" - self.tracker = Tracker(host, port=9000, port_end=10000, silent=True) + self.tracker = Tracker(port=9000, port_end=10000, silent=True) device_key = "$local$device$%d" % self.tracker.port self.server = Server( - host, port=self.tracker.port, port_end=10000, key=device_key, silent=True, - tracker_addr=(self.tracker.host, self.tracker.port), + tracker_addr=("127.0.0.1", self.tracker.port), ) self.runner = RPCRunner( device_key, - host, + "127.0.0.1", self.tracker.port, priority, n_parallel, diff --git a/python/tvm/autotvm/database.py b/python/tvm/autotvm/database.py index 6bb02e85a5bf..4c4ed649236f 100644 --- a/python/tvm/autotvm/database.py +++ b/python/tvm/autotvm/database.py @@ -111,7 +111,7 @@ def __init__(self, db_index=REDIS_PROD): import redis if db_index == RedisDatabase.REDIS_TEST: - host = "localhost" + host = "127.0.0.1" else: host = os.environ.get("TVM_FLEET_HOST") self.db = redis.StrictRedis(host=host, port=6379, db=db_index) diff --git a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py index b307130780a7..780e6c9a7477 100644 --- a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py +++ b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py @@ -368,7 +368,7 @@ def benchmark_layout_transform( timeout=10, use_rpc=False, device_key=None, - host="localhost", + host="127.0.0.1", port=9190, n_parallel=1, build_func="default", diff --git a/python/tvm/autotvm/measure/measure_methods.py b/python/tvm/autotvm/measure/measure_methods.py index 6d011408a242..60a26ecd7d81 100644 --- a/python/tvm/autotvm/measure/measure_methods.py +++ b/python/tvm/autotvm/measure/measure_methods.py @@ -399,18 +399,17 @@ def set_task(self, task): from ...rpc.server import Server self.task = task - tracker = Tracker("0.0.0.0", port=9000, port_end=10000, silent=True) + tracker = Tracker(port=9000, port_end=10000, silent=True) device_key = "$local$device$%d" % tracker.port server = Server( - "0.0.0.0", port=9000, port_end=10000, key=device_key, silent=True, - tracker_addr=(tracker.host, tracker.port), + tracker_addr=("127.0.0.1", tracker.port), ) self.key = device_key - self.host = tracker.host + self.host = "127.0.0.1" self.port = tracker.port super(LocalRunner, self).set_task(task) diff --git a/python/tvm/error.py b/python/tvm/error.py index 5502fe8e071e..9755270ec3ba 100644 --- a/python/tvm/error.py +++ b/python/tvm/error.py @@ -63,7 +63,7 @@ def __init__(self, msg): @register_error -class RPCError(RuntimeError): +class RPCError(TVMError): """Error thrown by the remote server handling the RPC call.""" diff --git a/python/tvm/exec/measure_peak.py b/python/tvm/exec/measure_peak.py index d8840fadd802..6db61080eaf7 100644 --- a/python/tvm/exec/measure_peak.py +++ b/python/tvm/exec/measure_peak.py @@ -17,7 +17,7 @@ """measure bandwidth and compute peak e.g. -python3 -m tvm.exec.measure_peak --target cuda --rpc-host 0.0.0.0 --rpc-port 9090 +python3 -m tvm.exec.measure_peak --target cuda --rpc-host 127.0.0.1 --rpc-port 9090 python3 -m tvm.exec.measure_peak --target opencl --target-host "llvm -mtriple=aarch64-linux-gnu" \ --rpc-host $TVM_OPENCL_DEVICE_HOST --rpc-port 9090 """ @@ -30,14 +30,14 @@ def main(): - """Main funciton""" + """Main function""" parser = argparse.ArgumentParser() parser.add_argument("--target", type=str, default="llvm", help="The build target") parser.add_argument( "--target-host", type=str, default=None, help="The host code compilation target" ) parser.add_argument( - "--rpc-host", type=str, default="0.0.0.0", help="the hostname of the server" + "--rpc-host", type=str, default="127.0.0.1", help="the hostname of the server" ) parser.add_argument("--rpc-port", type=int, default=9090, help="The port of the RPC") diff --git a/python/tvm/exec/query_rpc_tracker.py b/python/tvm/exec/query_rpc_tracker.py index 360325189dd4..febd093dbd9b 100644 --- a/python/tvm/exec/query_rpc_tracker.py +++ b/python/tvm/exec/query_rpc_tracker.py @@ -33,7 +33,7 @@ def main(): # default to local host or environment variable if not args.host: - args.host = os.environ.get("TVM_TRACKER_HOST", "localhost") + args.host = os.environ.get("TVM_TRACKER_HOST", "127.0.0.1") if not args.port: args.port = int(os.environ.get("TVM_TRACKER_PORT", "9190")) diff --git a/python/tvm/exec/rpc_proxy.py b/python/tvm/exec/rpc_proxy.py index bf315fdb9087..3aa93e66ea0a 100644 --- a/python/tvm/exec/rpc_proxy.py +++ b/python/tvm/exec/rpc_proxy.py @@ -69,7 +69,7 @@ def main(args): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--host", type=str, default="localhost", help="the hostname of the server") + parser.add_argument("--host", type=str, default="127.0.0.1", help="the hostname of the server") parser.add_argument("--port", type=int, default=9090, help="The port of the RPC") parser.add_argument( "--web-port", type=int, default=8888, help="The port of the http/websocket server" diff --git a/python/tvm/exec/rpc_server.py b/python/tvm/exec/rpc_server.py index 6b3e93edd223..ceab65c5c427 100644 --- a/python/tvm/exec/rpc_server.py +++ b/python/tvm/exec/rpc_server.py @@ -54,7 +54,9 @@ def main(args): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--host", type=str, default="0.0.0.0", help="the hostname of the server") + parser.add_argument( + "--host", type=str, default="0.0.0.0", help="The host IP address the tracker binds to" + ) parser.add_argument("--port", type=int, default=9090, help="The port of the RPC") parser.add_argument("--port-end", type=int, default=9199, help="The end search port of the RPC") parser.add_argument( diff --git a/python/tvm/exec/rpc_tracker.py b/python/tvm/exec/rpc_tracker.py index 4a1a964338ba..05809e044fec 100644 --- a/python/tvm/exec/rpc_tracker.py +++ b/python/tvm/exec/rpc_tracker.py @@ -33,7 +33,9 @@ def main(args): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--host", type=str, default="0.0.0.0", help="the hostname of the tracker") + parser.add_argument( + "--host", type=str, default="0.0.0.0", help="The host IP address the tracker binds to" + ) parser.add_argument("--port", type=int, default=9190, help="The port of the RPC") parser.add_argument("--port-end", type=int, default=9199, help="The end search port of the RPC") parser.add_argument( diff --git a/python/tvm/rpc/proxy.py b/python/tvm/rpc/proxy.py index 7e02bd77c491..e5ec73db51b9 100644 --- a/python/tvm/rpc/proxy.py +++ b/python/tvm/rpc/proxy.py @@ -512,7 +512,7 @@ def __init__( self.port = my_port break except socket.error as sock_err: - if sock_err.errno in [98, 48]: + if sock_err.errno in [errno.EADDRINUSE]: continue raise sock_err if not self.port: diff --git a/python/tvm/rpc/server.py b/python/tvm/rpc/server.py index 3fd6996034f7..bfde74febcb5 100644 --- a/python/tvm/rpc/server.py +++ b/python/tvm/rpc/server.py @@ -34,6 +34,7 @@ import threading import multiprocessing import time +import errno import tvm._ffi from tvm._ffi.base import py_str @@ -333,7 +334,7 @@ def __init__( self.port = my_port break except socket.error as sock_err: - if sock_err.errno in [98, 48]: + if sock_err.errno in [errno.EADDRINUSE]: continue raise sock_err if not self.port: @@ -423,7 +424,7 @@ class Server(object): def __init__( self, - host, + host="0.0.0.0", port=9091, port_end=9199, is_proxy=False, diff --git a/python/tvm/rpc/tracker.py b/python/tvm/rpc/tracker.py index e1c366e99b0d..9dc4139f97ca 100644 --- a/python/tvm/rpc/tracker.py +++ b/python/tvm/rpc/tracker.py @@ -367,7 +367,7 @@ def _tracker_server(listen_sock, stop_key): class Tracker(object): - """Start RPC tracker on a seperate process. + """Start RPC tracker on a separate process. Python implementation based on multi-processing. @@ -386,7 +386,7 @@ class Tracker(object): Whether run in silent mode """ - def __init__(self, host, port=9190, port_end=9199, silent=False): + def __init__(self, host="0.0.0.0", port=9190, port_end=9199, silent=False): if silent: logger.setLevel(logging.WARN) @@ -399,7 +399,7 @@ def __init__(self, host, port=9190, port_end=9199, silent=False): self.port = my_port break except socket.error as sock_err: - if sock_err.errno in [98, 48]: + if sock_err.errno in [errno.EADDRINUSE]: continue raise sock_err if not self.port: @@ -414,7 +414,7 @@ def __init__(self, host, port=9190, port_end=9199, silent=False): def _stop_tracker(self): sock = socket.socket(base.get_addr_family((self.host, self.port)), socket.SOCK_STREAM) - sock.connect((self.host, self.port)) + sock.connect(("127.0.0.1", self.port)) sock.sendall(struct.pack(" 1 else dev.warp_size @@ -228,7 +228,7 @@ def tune_and_evaluate(): num_measure_trials=200, # change this to 20000 to achieve the best performance builder=auto_scheduler.LocalBuilder(build_func="ndk" if use_ndk else "default"), runner=auto_scheduler.RPCRunner( - device_key, host="0.0.0.0", port=9190, repeat=3, timeout=50 + device_key, host="127.0.0.1", port=9190, repeat=3, timeout=50 ), measure_callbacks=[auto_scheduler.RecordToFile(log_file)], ) @@ -247,7 +247,7 @@ def tune_and_evaluate(): print("=============== Request Remote ===============") from tvm.auto_scheduler.utils import request_remote - remote = request_remote(device_key, "0.0.0.0", 9190) + remote = request_remote(device_key, "127.0.0.1", 9190) dev = remote.cl() from tvm.contrib import utils, ndk diff --git a/tutorials/autotvm/tune_relay_arm.py b/tutorials/autotvm/tune_relay_arm.py index 9223eb30cd9d..68d263b6f29a 100644 --- a/tutorials/autotvm/tune_relay_arm.py +++ b/tutorials/autotvm/tune_relay_arm.py @@ -224,7 +224,7 @@ def get_network(name, batch_size): builder=autotvm.LocalBuilder(build_func="ndk" if use_android else "default"), runner=autotvm.RPCRunner( device_key, - host="0.0.0.0", + host="127.0.0.1", port=9190, number=5, timeout=10, @@ -343,7 +343,7 @@ def tune_and_evaluate(tuning_opt): # upload module to device print("Upload...") - remote = autotvm.measure.request_remote(device_key, "0.0.0.0", 9190, timeout=10000) + remote = autotvm.measure.request_remote(device_key, "127.0.0.1", 9190, timeout=10000) remote.upload(tmp.relpath(filename)) rlib = remote.load_module(filename) diff --git a/tutorials/autotvm/tune_relay_cuda.py b/tutorials/autotvm/tune_relay_cuda.py index 50485c4d7ff2..65991cc83454 100644 --- a/tutorials/autotvm/tune_relay_cuda.py +++ b/tutorials/autotvm/tune_relay_cuda.py @@ -345,13 +345,13 @@ def tune_and_evaluate(tuning_opt): # # .. code-block:: bash # -# python -m tvm.exec.rpc_server --tracker=0.0.0.0:9190 --key=1080ti +# python -m tvm.exec.rpc_server --tracker=127.0.0.1:9190 --key=1080ti # # After registering devices, we can confirm it by querying rpc_tracker # # .. code-block:: bash # -# python -m tvm.exec.query_rpc_tracker --host=0.0.0.0 --port=9190 +# python -m tvm.exec.query_rpc_tracker --host=127.0.0.1 --port=9190 # # For example, if we have four 1080ti, two titanx and one gfx900, the output can be # @@ -378,7 +378,7 @@ def tune_and_evaluate(tuning_opt): builder=autotvm.LocalBuilder(timeout=10), runner=autotvm.RPCRunner( "1080ti", # change the device key to your key - "0.0.0.0", + "127.0.0.1", 9190, number=20, repeat=3, diff --git a/tutorials/autotvm/tune_relay_mobile_gpu.py b/tutorials/autotvm/tune_relay_mobile_gpu.py index 2b109873c750..790c2ff2c2b9 100644 --- a/tutorials/autotvm/tune_relay_mobile_gpu.py +++ b/tutorials/autotvm/tune_relay_mobile_gpu.py @@ -225,7 +225,7 @@ def get_network(name, batch_size): builder=autotvm.LocalBuilder(build_func="ndk" if use_android else "default"), runner=autotvm.RPCRunner( device_key, - host="0.0.0.0", + host="127.0.0.1", port=9190, number=10, timeout=5, @@ -340,7 +340,7 @@ def tune_and_evaluate(tuning_opt): # upload module to device print("Upload...") - remote = autotvm.measure.request_remote(device_key, "0.0.0.0", 9190, timeout=10000) + remote = autotvm.measure.request_remote(device_key, "127.0.0.1", 9190, timeout=10000) remote.upload(tmp.relpath(filename)) rlib = remote.load_module(filename) diff --git a/tutorials/frontend/deploy_model_on_android.py b/tutorials/frontend/deploy_model_on_android.py index 158280fe9447..864e81328c99 100644 --- a/tutorials/frontend/deploy_model_on_android.py +++ b/tutorials/frontend/deploy_model_on_android.py @@ -289,7 +289,7 @@ def transform_image(image): # With RPC, you can deploy the model remotely from your host machine # to the remote android device. -tracker_host = os.environ.get("TVM_TRACKER_HOST", "0.0.0.0") +tracker_host = os.environ.get("TVM_TRACKER_HOST", "127.0.0.1") tracker_port = int(os.environ.get("TVM_TRACKER_PORT", 9190)) key = "android" diff --git a/vta/python/vta/exec/rpc_server.py b/vta/python/vta/exec/rpc_server.py index cd519137bce7..b7a9c79392d2 100644 --- a/vta/python/vta/exec/rpc_server.py +++ b/vta/python/vta/exec/rpc_server.py @@ -127,7 +127,9 @@ def reconfig_runtime(cfg_json): def main(): """Main funciton""" parser = argparse.ArgumentParser() - parser.add_argument("--host", type=str, default="0.0.0.0", help="the hostname of the server") + parser.add_argument( + "--host", type=str, default="0.0.0.0", help="The host IP address the server binds to" + ) parser.add_argument("--port", type=int, default=9091, help="The port of the RPC") parser.add_argument("--port-end", type=int, default=9199, help="The end search port of the RPC") parser.add_argument( diff --git a/vta/tutorials/autotvm/tune_relay_vta.py b/vta/tutorials/autotvm/tune_relay_vta.py index 7deb7408479a..38633b01d976 100644 --- a/vta/tutorials/autotvm/tune_relay_vta.py +++ b/vta/tutorials/autotvm/tune_relay_vta.py @@ -180,7 +180,7 @@ def compile_network(env, target, model, start_pack, stop_pack): # Here we use an Pynq-Z1 board as an example. # Tracker host and port can be set by your environment -tracker_host = os.environ.get("TVM_TRACKER_HOST", "0.0.0.0") +tracker_host = os.environ.get("TVM_TRACKER_HOST", "127.0.0.1") tracker_port = int(os.environ.get("TVM_TRACKER_PORT", 9190)) # Load VTA parameters from the 3rdparty/vta-hw/config/vta_config.json file diff --git a/web/tests/python/webgpu_rpc_test.py b/web/tests/python/webgpu_rpc_test.py index 80e358b56498..e26937038fa2 100644 --- a/web/tests/python/webgpu_rpc_test.py +++ b/web/tests/python/webgpu_rpc_test.py @@ -26,7 +26,7 @@ from tvm.contrib import utils, emcc import numpy as np -proxy_host = "localhost" +proxy_host = "127.0.0.1" proxy_port = 9090 diff --git a/web/tests/python/websock_rpc_test.py b/web/tests/python/websock_rpc_test.py index 9c1876a182e3..84a0c9f134d5 100644 --- a/web/tests/python/websock_rpc_test.py +++ b/web/tests/python/websock_rpc_test.py @@ -26,7 +26,7 @@ from tvm.contrib import utils, emcc import numpy as np -proxy_host = "localhost" +proxy_host = "127.0.0.1" proxy_port = 9090