Skip to content

Fix KeyError for missing domain_uuid_key in Thunderbolt setup#2682

Merged
angeloskath merged 1 commit intoml-explore:mainfrom
thechriswebb:webb/fix-thunderbolt-domain-uuid-keyerror
Oct 30, 2025
Merged

Fix KeyError for missing domain_uuid_key in Thunderbolt setup#2682
angeloskath merged 1 commit intoml-explore:mainfrom
thechriswebb:webb/fix-thunderbolt-domain-uuid-keyerror

Conversation

@thechriswebb
Copy link
Copy Markdown
Contributor

  • Check for None before accessing domain_uuid_key and skip invalid entries
  • Filter items to only those with domain_uuid_key before extracting connection
  • Prevents KeyError when thunderbolt topology data is incomplete

Proposed changes

Fixes a KeyError in mlx.distributed when setting up Thunderbolt ring topology.

The error occurred when domain_uuid_key was missing from Thunderbolt topology data, which happens when certain devices (such as external monitors) are connected to the Mac. The code attempted to access this key without first checking for its presence.

This PR adds validation to check for domain_uuid_key before accessing it and filters topology items to only those with valid keys, preventing the crash when the topology data is incomplete.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes

- Check for None before accessing domain_uuid_key and skip invalid entries
- Filter items to only those with domain_uuid_key before extracting connection
- Prevents KeyError when thunderbolt topology data is incomplete
Copy link
Copy Markdown
Member

@angeloskath angeloskath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks and works great.

@angeloskath angeloskath merged commit 793a31e into ml-explore:main Oct 30, 2025
7 checks passed
@ivanfioravanti
Copy link
Copy Markdown
Contributor

Thanks! I was experiencing this recently!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants