Skip to content

Fix check_nvlink_connections called with None group#543

Open
yurekami wants to merge 1 commit intodeepseek-ai:mainfrom
yurekami:fix-nvlink-check-none-group
Open

Fix check_nvlink_connections called with None group#543
yurekami wants to merge 1 commit intodeepseek-ai:mainfrom
yurekami:fix-nvlink-check-none-group

Conversation

@yurekami
Copy link
Copy Markdown
Contributor

Summary

  • Fixed a bug where check_nvlink_connections(group) was called before validating that group is not None
  • This caused an AttributeError when users used the comm (mpi4py) parameter instead of group

Problem

# In Buffer.__init__:
check_nvlink_connections(group)  # Called here, but group can be None!

if group is not None:
    # ... handle group
elif comm is not None:
    # ... handle comm

When group=None and comm is provided, check_nvlink_connections would fail trying to call group.size().

Solution

Moved check_nvlink_connections(group) inside the if group is not None: block.

Changes

  • deep_ep/buffer.py - Moved NVLink check after None validation

Test plan

  • Create Buffer with group=None, comm=<mpi4py comm> and verify no AttributeError
  • Create Buffer with valid group and verify NVLink check still runs

🤖 Generated with Claude Code

Previously, check_nvlink_connections(group) was called before validating
that group is not None. When users use the comm parameter instead of group,
this would cause an AttributeError when trying to call group.size().

Moved the check inside the `if group is not None` block to only run the
NVLink validation when a torch.distributed ProcessGroup is provided.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant