Use reduce scatter for DP (#8539)
This commit is contained in:
@@ -1277,7 +1277,7 @@ class RowParallelLinear(LinearBase):
|
||||
# It does not support additional parameters.
|
||||
param.load_row_parallel_weight(loaded_weight)
|
||||
|
||||
def forward(self, input_, can_fuse_mlp_allreduce=False):
|
||||
def forward(self, input_, skip_all_reduce=False):
|
||||
if self.input_is_parallel:
|
||||
input_parallel = input_
|
||||
else:
|
||||
@@ -1294,7 +1294,7 @@ class RowParallelLinear(LinearBase):
|
||||
with use_symmetric_memory(parallel_state.get_tp_group()) as sm:
|
||||
output_parallel = self.quant_method.apply(self, input_parallel, bias=bias_)
|
||||
sm.tag(output_parallel)
|
||||
if self.reduce_results and self.tp_size > 1 and not can_fuse_mlp_allreduce:
|
||||
if self.reduce_results and self.tp_size > 1 and not skip_all_reduce:
|
||||
output = tensor_model_parallel_all_reduce(output_parallel)
|
||||
else:
|
||||
output = output_parallel
|
||||
|
||||
Reference in New Issue
Block a user