mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #604] Hybrid-EP has hang and precision issues in SFT training with variable sequence lengths #369
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#369
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?
Originally created by @fengchen-98 on GitHub (Apr 17, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/604
hello DeepEp and HybridEp team
I found some bugs about HybridEp
max_num_of_tokens_per_rankinHybridEPBuffer.__init__().Inupdate_template_configcalls, thenum_of_tokens_per_rankin the hidden state is also different. This causes some ranks to wait at an all_gather while others skip it, resulting in a hang.the hang place is
bool HybridEPBuffer::update_buffer. some ranksneed_reallocate=falseso skip the all_gather inallgather_obj.update(buffer_config);dispatch_with_permute,metadata_preprocessingreceives arouting_map, but the length ofrouting_mapis different. This leads to different input lengths for theall_gather_into_tensoroperation inExecutor::allgather_routing_map, causing precision issues.Fix:
max_num_of_tokens_per_rank=next_power_of_two(max_num_of_tokens_per_rank)so that the length is always max_length.routing_maptomax_num_of_tokens_per_rank.pad_rows = config.max_num_of_tokens_per_rank - num_of_tokens_per_rankrouting_map = torch.nn.functional.pad(routing_map, (0, 0, 0, pad_rows), value=False)Training normally after these two fixes
@Autumn1998 commented on GitHub (May 9, 2026):
Hi, thank you for the information. For this situation where the number of tokens from attn by each rank is inconsistent, there is currently no official support. The only workaround is through an approach similar to padding. Sorry about that!