You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/unittest/llmapi/apps/_test_disagg_serving_multi_nodes.py
+46-35Lines changed: 46 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -57,10 +57,12 @@ def find_nic():
57
57
print(f"test_ip: {test_ip} for the other host {get_the_other_host()}")
58
58
try:
59
59
# iproute2 may not be installed
60
-
result=subprocess.check_output(
61
-
f"ip route get {test_ip} | sed -E 's/.*?dev (\\S+) .*/\\1/;t;d'",
62
-
shell=True)
63
-
nic_name=result.decode('utf-8').strip()
60
+
proc=subprocess.run(f"ip route get {test_ip}",
61
+
capture_output=True,
62
+
text=True,
63
+
shell=True,
64
+
check=True)
65
+
nic_name=proc.stdout.split()[4]
64
66
print(f"get NIC name from ip route, result: {nic_name}")
65
67
returnnic_name
66
68
exceptExceptionase:
@@ -69,7 +71,8 @@ def find_nic():
69
71
# Establish a socket to the test ip, then get the local ip from the socket,
70
72
# enumerate the local interfaces and find the one with the local ip
71
73
local_ip=get_local_ip(test_ip)
72
-
fornic_name, ipinget_local_interfaces().items():
74
+
local_ip_dict=get_local_interfaces()
75
+
fornic_name, ipinlocal_ip_dict.items():
73
76
ifip==local_ip:
74
77
returnnic_name
75
78
exceptOSErrorase:
@@ -89,7 +92,10 @@ def env():
89
92
ifnic:
90
93
# TODO: integrate this into disagg-serving
91
94
# setting TRTLLM_UCX_INTERFACE manually if possible because the interfaces found automatically by TRTLLM can have the same ip across nodes, then cache transceiver may fail to send/receive kv cache
95
+
print(f"setting TRTLLM_UCX_INTERFACE to {nic}")
92
96
new_env["TRTLLM_UCX_INTERFACE"] =nic
97
+
else:
98
+
print(f"Failed to find NIC, will use default UCX interface")
0 commit comments