[Bugfix] Fix missing group arg in get dp buffer (#25585)

This commit is contained in:
Shangming Cai
2026-05-19 02:08:10 +08:00
committed by GitHub
parent b29e41e8b3
commit 86c6c77f2f
2 changed files with 18 additions and 4 deletions
+5 -1
View File
@@ -1304,8 +1304,12 @@ class CommunicateSummableTensorPairFn:
# DP scatter (if DP attention is enabled)
if context.attn_dp_size > 1:
if get_tensor_model_parallel_world_size() == get_attention_dp_size():
group = get_tp_group()
else:
group = get_attention_tp_group()
hidden_states_output, global_hidden_states = (
get_local_dp_buffer(),
get_local_dp_buffer(group),
hidden_states,
)
dp_scatter(hidden_states_output, global_hidden_states, forward_batch)
+13 -3
View File
@@ -26,7 +26,11 @@ from sglang.jit_kernel.deepseek_v4 import (
fused_rope_inplace,
)
from sglang.srt.configs.deepseek_v4 import DeepSeekV4Config
from sglang.srt.distributed import get_pp_group, get_tensor_model_parallel_world_size
from sglang.srt.distributed import (
get_pp_group,
get_tensor_model_parallel_world_size,
get_tp_group,
)
from sglang.srt.environ import envs
from sglang.srt.eplb.expert_location import ModelConfigForExpertLocation
from sglang.srt.layers.attention.dsv4.compressor import Compressor
@@ -885,7 +889,10 @@ class DeepseekV4DecoderLayer(nn.Module):
input_ids = input_ids[cp_rank::cp_size].contiguous()
input_ids_global = input_ids
elif _use_tp_moe_gather:
hidden_states, local_hidden_states = get_global_dp_buffer(), hidden_states
hidden_states, local_hidden_states = (
get_global_dp_buffer(get_tp_group()),
hidden_states,
)
dp_gather_partial(hidden_states, local_hidden_states, forward_batch)
_a2a_scatter_chunks: Optional[List[torch.Tensor]] = None
if _use_tp_attn_a2a_scatter:
@@ -901,7 +908,10 @@ class DeepseekV4DecoderLayer(nn.Module):
input_ids_global=input_ids_global,
)
if _use_tp_moe_gather:
hidden_states, global_hidden_states = get_local_dp_buffer(), hidden_states
hidden_states, global_hidden_states = (
get_local_dp_buffer(get_tp_group()),
hidden_states,
)
dp_scatter(hidden_states, global_hidden_states, forward_batch)
if _use_tp_attn_a2a_scatter:
assert _a2a_scatter_chunks is not None