Skip to content

fix: prevent duplicate expert IDs on same GPU (#22)#27

Open
yurekami wants to merge 2 commits into
deepseek-ai:mainfrom
yurekami:fix/duplicate-expert-ids
Open

fix: prevent duplicate expert IDs on same GPU (#22)#27
yurekami wants to merge 2 commits into
deepseek-ai:mainfrom
yurekami:fix/duplicate-expert-ids

Conversation

@yurekami

Copy link
Copy Markdown

Summary

Fix the issue where hot experts could be duplicated on the same rank, e.g., "dup expert layer 0 rank 16, [200, 226, 236, 236, 12, ...]"

Changes

Modified balanced_packing() to accept an optional item_ids parameter that prevents items with the same ID from being placed in the same pack.

When packing physical experts to GPUs in rebalance_experts_hierarchical(), pass phy2mlog as item_ids to ensure no two physical experts that map to the same logical expert end up on the same GPU.

Test plan

  • Verify no duplicate expert IDs appear on same rank after rebalancing

🤖 Generated with Claude Code

yurekami and others added 2 commits December 26, 2025 00:23
Add proper Python packaging support to enable pip installation:
- Add pyproject.toml with modern build system configuration
- Add module docstring describing the package
- Add __version__ = "1.0.0" for version tracking
- Expand __all__ to export additional utility functions

This enables users to install the package via:
  pip install git+https://github.com/deepseek-ai/EPLB.git

Or for local development:
  pip install -e .

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Modified balanced_packing() to accept an optional item_ids parameter
that prevents items with the same ID from being placed in the same pack.

When packing physical experts to GPUs in rebalance_experts_hierarchical(),
pass phy2mlog as item_ids to ensure no two physical experts that map to
the same logical expert end up on the same GPU.

This fixes the issue where hot experts could be duplicated on the same rank,
e.g., "dup expert layer 0 rank 16, [200, 226, 236, 236, 12, ...]"

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

Co-Authored-By: Claude <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