[BUGFIX] Fix dp size > 1 for qwen3 vl model (#17624)
Co-authored-by: yizhang2077 <1109276519@qq.com>
This commit is contained in:
@@ -21,7 +21,10 @@ from sglang.srt.distributed import (
|
||||
from sglang.srt.distributed.device_communicators.pynccl_allocator import (
|
||||
use_symmetric_memory,
|
||||
)
|
||||
from sglang.srt.layers.dp_attention import is_allocation_symmetric
|
||||
from sglang.srt.layers.dp_attention import (
|
||||
get_attention_tp_group,
|
||||
is_allocation_symmetric,
|
||||
)
|
||||
from sglang.srt.layers.parameter import (
|
||||
BasevLLMParameter,
|
||||
BlockQuantScaleParameter,
|
||||
@@ -1263,6 +1266,7 @@ class RowParallelLinear(LinearBase):
|
||||
tp_rank: Optional[int] = None,
|
||||
tp_size: Optional[int] = None,
|
||||
use_presharded_weights: bool = False,
|
||||
use_dp_attention_reduce: bool = False,
|
||||
):
|
||||
quant_config = None if _disable_hip_linear_quant else quant_config
|
||||
super().__init__(
|
||||
@@ -1271,6 +1275,7 @@ class RowParallelLinear(LinearBase):
|
||||
|
||||
self.input_is_parallel = input_is_parallel
|
||||
self.reduce_results = reduce_results
|
||||
self.use_dp_attention_reduce = use_dp_attention_reduce
|
||||
|
||||
# Divide the weight matrix along the last dimension.
|
||||
if tp_rank is None:
|
||||
@@ -1419,7 +1424,10 @@ class RowParallelLinear(LinearBase):
|
||||
output_parallel = self.quant_method.apply(self, input_parallel, bias=bias_)
|
||||
|
||||
if self.reduce_results and self.tp_size > 1 and not skip_all_reduce:
|
||||
output = tensor_model_parallel_all_reduce(output_parallel)
|
||||
if self.use_dp_attention_reduce:
|
||||
output = get_attention_tp_group().all_reduce(output_parallel)
|
||||
else:
|
||||
output = tensor_model_parallel_all_reduce(output_parallel)
|
||||
else:
|
||||
output = output_parallel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user