From 793a31eeb685f1a9f0fbef88fd0492f18e92b6b4 Mon Sep 17 00:00:00 2001 From: Christopher Webb <207731778+thechriswebb@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:17:20 -0500 Subject: [PATCH] Fix missing domain_uuid_key in thunderbolt ring setup (#2682) --- python/mlx/distributed_run.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python/mlx/distributed_run.py b/python/mlx/distributed_run.py index bb0e3c633..424873dd3 100644 --- a/python/mlx/distributed_run.py +++ b/python/mlx/distributed_run.py @@ -567,13 +567,16 @@ def prepare_tb_ring(args, hosts): name = "" ports = [] for t in c["SPThunderboltDataType"]: + uuid = t.get("domain_uuid_key") + if uuid is None: + continue name = t["device_name_key"] - uuid = t["domain_uuid_key"] tag = t["receptacle_1_tag"]["receptacle_id_key"] - if items := t.get("_items", []): - connected_to = items[0]["domain_uuid_key"] - else: - connected_to = None + items = t.get("_items", []) + connected_items = [item for item in items if "domain_uuid_key" in item] + connected_to = ( + connected_items[0]["domain_uuid_key"] if connected_items else None + ) iface = iface_map[f"Thunderbolt {tag}"] ports.append(ThunderboltPort(iface, uuid, connected_to)) tb_hosts.append(ThunderboltHost(name, sorted(ports, key=lambda x: x.iface)))