[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-08-13 09:36:22 +00:00 committed by Tong Li
parent a8840a090f
commit 3629b36517

View File

@ -1326,9 +1326,11 @@ class HybridParallelPlugin(PipelinePluginBase):
) )
# run with gradients accumulation # run with gradients accumulation
if model.require_grad_sync == False or ( if (
isinstance(optimizer, HybridParallelZeroOptimizer) and optimizer.require_grad_sync == False model.require_grad_sync == False
) or not torch.is_grad_enabled(): or (isinstance(optimizer, HybridParallelZeroOptimizer) and optimizer.require_grad_sync == False)
or not torch.is_grad_enabled()
):
return outputs return outputs
# Synchronize the grads of shared parameters of the model. # Synchronize the grads of shared parameters of the model.