mirror of https://github.com/hpcaitech/ColossalAI
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.cipull/6007/head
parent
a8840a090f
commit
3629b36517
|
@ -1326,9 +1326,11 @@ class HybridParallelPlugin(PipelinePluginBase):
|
|||
)
|
||||
|
||||
# run with gradients accumulation
|
||||
if model.require_grad_sync == False or (
|
||||
isinstance(optimizer, HybridParallelZeroOptimizer) and optimizer.require_grad_sync == False
|
||||
) or not torch.is_grad_enabled():
|
||||
if (
|
||||
model.require_grad_sync == False
|
||||
or (isinstance(optimizer, HybridParallelZeroOptimizer) and optimizer.require_grad_sync == False)
|
||||
or not torch.is_grad_enabled()
|
||||
):
|
||||
return outputs
|
||||
|
||||
# Synchronize the grads of shared parameters of the model.
|
||||
|
|
Loading…
Reference in New Issue