mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #796] fix(utils): enhance NCCL library directory resolution and environment robustness #793
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#793
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/796
Author: @reginaldalfret
Created: 10/25/2026
Status: 🔄 Open
Base:
main← Head:fix/nccl-discovery-lib-dirs📝 Commits (1)
a1f7cbffix(utils): enhance NCCL library directory resolution and environment robustness📊 Changes
4 files changed (+124 additions, -19 deletions)
View changed files
📝
deep_ep/__init__.py(+21 -7)📝
deep_ep/utils/envs.py(+1 -1)📝
deep_ep/utils/find_pkgs.py(+16 -11)➕
tests/utils/test_find_pkgs.py(+86 -0)📄 Description
Problem
deep_ep/utils/find_pkgs.py,get_nccl_lib_name()strictly looked insidePath(root) / 'lib'. If a user setNCCL_DIR=/usr/lib64orNCCL_DIR=/usr/lib/x86_64-linux-gnu, or whenfind_pkg_root()returned a library folder directly (due toos.path.basename(lib_dir) != 'lib'), resolution failed withModuleNotFoundError: libnccl.so not found under .../lib.EP_NCCL_ROOT_DIR=""orNCCL_DIR=""was exported as an empty string,find_pkg_root()checkedif env_name in os.environ:and returned"", breaking downstream path construction instead of falling back to distribution discovery.find_pkg_root(), accessingdist._path.parentanddist.metadata['Name']directly could raiseAttributeErrororKeyErroron non-path or malformed distributions.check_nccl_so()unconditionally attempted to read/proc/self/maps, crashing withFileNotFoundErrorin environments without/procmounted.Solution
get_nccl_lib_name()to search candidate directories:Path(root) / 'lib',Path(root) / 'lib64', andPath(root).os.environ.get(env_name)to ignore empty environment variables.dist._pathand dictionary metadata lookups infind_pkg_root().os.path.exists('/proc/self/maps')incheck_nccl_so()and support candidate search paths for linked NCCL candidates.EnvOverride.__exit__, useos.environ.pop(name, None)to preventKeyErrorif variables were deleted during the context block.tests/utils/test_find_pkgs.pycovering standardlib,lib64, direct directories, empty environment variables, andEnvOverridesafety.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.