feat: Support DP Attention for step3_vl (#8699)
This commit is contained in:
@@ -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),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user