From 16daffc042f19109bd754778f7a45fd00c806cc3 Mon Sep 17 00:00:00 2001 From: nimlgen <138685161+nimlgen@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:44:16 +0800 Subject: [PATCH] remote connection timeout (#15370) --- tinygrad/runtime/support/system.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tinygrad/runtime/support/system.py b/tinygrad/runtime/support/system.py index 9352695e20..dc559d5bed 100644 --- a/tinygrad/runtime/support/system.py +++ b/tinygrad/runtime/support/system.py @@ -314,7 +314,9 @@ class RemotePCIDevice(PCIDevice): host, port = host_port[0], int(host_port[1]) if len(host_port) > 1 else 6667 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + sock.settimeout(getenv("REMOTE_TIMEOUT", 3)) sock.connect((host, port)) + sock.settimeout(None) return sock @staticmethod