feat: Support DP Attention for step3_vl (#8699)

This commit is contained in:
yhyang201
2025-08-03 19:35:26 +08:00
committed by GitHub
parent 8cd344586e
commit 00da906584
3 changed files with 25 additions and 6 deletions

View File

@@ -531,11 +531,18 @@ class Step3VisionMLP(nn.Module):
prefix: str = "",
) -> None:
super().__init__()
# Since this is a dense model,
# the MLP component likewise adopts a DP-MLP approach modeled after DP Attention.
# This choice may not represent the optimal solution and remains open to further deliberation.
attn_tp_rank = get_attention_tp_rank()
attn_tp_size = get_attention_tp_size()
self.fc1 = ColumnParallelLinear(
dim,
intermediate_size,
bias=bias,
quant_config=quant_config,
tp_rank=attn_tp_rank,
tp_size=attn_tp_size,
prefix=add_prefix("gate_proj", prefix),
)
self.act = ACT2FN[hidden_act] # quick_gelu
@@ -544,6 +551,8 @@ class Step3VisionMLP(nn.Module):
dim,
bias=bias,
quant_config=quant_config,
tp_rank=attn_tp_rank,
tp_size=attn_tp_size,
prefix=add_prefix("down_proj", prefix),
)