Skip to content

Feat/dp attn 0514#490

Merged
zhangxiaolei123456 merged 1 commit into
bytedance-iaas:main_deepseek_dp_attentionfrom
shiyu7:feat/dp_attn_0514
May 14, 2026
Merged

Feat/dp attn 0514#490
zhangxiaolei123456 merged 1 commit into
bytedance-iaas:main_deepseek_dp_attentionfrom
shiyu7:feat/dp_attn_0514

Conversation

@shiyu7
Copy link
Copy Markdown
Collaborator

@shiyu7 shiyu7 commented May 14, 2026

Motivation

Modifications

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

@zhangxiaolei123456 zhangxiaolei123456 merged commit 5ec497c into bytedance-iaas:main_deepseek_dp_attention May 14, 2026
1 check passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the distributed communication logic in communicator.py and deepseek_v4.py to handle DP buffer group selection more dynamically. Specifically, it introduces a check to determine whether to use the tensor parallel group or the attention tensor parallel group based on the relationship between the TP world size and the attention DP size. Feedback was provided to ensure that the group selection logic in the DeepSeek-V4 model remains consistent with the implementation in the layer communicator to avoid potential issues with symmetric memory allocation.

Comment on lines +861 to +864
hidden_states, global_hidden_states = (
get_local_dp_buffer(get_attention_tp_group()),
hidden_states,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the logic in LayerCommunicator and to ensure correct symmetric memory allocation when the tensor parallel size equals the attention data parallel size, the group for the local DP buffer should be selected based on whether tp_size == dp_size. This pattern is followed in communicator.py for all dp_scatter operations.

Suggested change
hidden_states, global_hidden_states = (
get_local_dp_buffer(get_attention_tp_group()),
hidden_states,
)
if get_tensor_model_parallel_world_size() == get_attention_dp_size():
group = get_tp_group()
else:
group = get_attention_tp_group()
hidden_states, global_hidden_states = (
get_local_dp_buffer(group),
hidden_states,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants