Repository navigation
Conversation
check_nccl_so() identified the mapped NCCL library with
line.strip().split(' ')[-1]. A pathname that contains a space, or that
Linux reports with the ' (deleted)' suffix after the underlying inode was
replaced/removed, made that expression yield a truncated path or the
literal '(deleted)'. filecmp.cmp() then raised a bare FileNotFoundError
instead of a useful NCCL diagnosis.
Parse the sixth field of /proc/self/maps (the full pathname) and turn a
deleted mapping into an explicit, actionable error.
Signed-off-by: li-lizhe <147392333@qq.com>
Author
|
Gentle ping on this one — it's been quiet for 7 days since the last activity, so I wanted to check whether there's anything else you'd like me to adjust or add before this can move forward. Happy to make changes if so. Thanks! |
Author
|
@LyricZhao @jershi425 — would one of you be able to take a look at this when you get a chance?
Happy to adjust if the approach doesn't fit. |
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.
Fixes #777.
check_nccl_so()identifies the mapped NCCL library withline.strip().split(' ')[-1], which is the last space-separated token, not the pathname field of/proc/self/maps:filecmp.cmp();(deleted)marker, so the token is literally(deleted)and the check dies withThat is the traceback in #777: it aborts the import long before any NCCL version comparison happens, and hides the actual condition.
Change (
deep_ep/__init__.py, +19/-1)/proc/self/mapsline instead of the last token.(deleted)marker and raise an explicitAssertionErrornaming the library and the likely cause (the NCCL library changed underneath a running process, e.g. a concurrentpip install) instead of surfacing a bareFileNotFoundError.Verification
The real
check_nccl_so()is extracted from both revisions by AST and executed against synthetic/proc/self/mapscontent (filecmp.cmpandglobstubbed with a fixed file set; stdlib only, no torch / NCCL import needed):FileNotFoundError: 'nccl/lib/libnccl.so.2'(deleted)mappingFileNotFoundError: '(deleted)'AssertionError: The NCCL library mapped as /root/nccl/lib/libnccl.so.2 was replaced or removed while it was still mapped ...AssertionErrorAssertionError(unchanged)Not tested: an actual
import deep_ep/check_nccl_so()run on a machine with NCCL and a GPU (no such environment was available, so the version-comparison path against a real loaded library is exercised only through the stubbed harness above).Signed-off-by: li-lizhe 147392333@qq.com