Repository navigation
Fix MtLink P2P detection with partially visible GPUs - #14
Merged
yeahdongcn merged 1 commit intoAug 20, 2026
Merged
Conversation
froststeam
force-pushed
the
fix/partial-visibility-mtlink
branch
from
August 20, 2026 06:24
dcee0fb to
5343a22
Compare
yeahdongcn
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mtmlDeviceCountMtLinkLayouts()query for NVLink-compatible P2P detectionMTHREADS_VISIBLE_DEVICESRoot cause
In an 8-GPU host with only four GPUs exposed,
mtmlDeviceGetMtLinkSpec()still reports all 14 physical links as UP.mtmlDeviceGetMtLinkRemoteDevice()correctly returnsMTML_ERROR_NOT_FOUNDfor links whose remote endpoint is outside the visible device set. Pairwise P2P detection should not enumerate those hidden endpoints.Validation
15 passed(test_mtlink_visibility.py,test_abi_layout.py,test_library_loading.py)MTHREADS_VISIBLE_DEVICES=0,1,2,3: all six visible pairs returnedNVML_P2P_STATUS_OK, each reported two MtLink layouts, and the patched pairwise path performed zero remote-device lookupsMTMLError_NotFoundlinks and still finds a visible peerThe repository baseline currently has pre-existing full-file Black/flake8 failures; the new test file passes Black and isort checks.