mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-21 13:11:27 +00:00
fix sync condition (#6000)
This commit is contained in:
parent
ed97d3a5d3
commit
ceb1e262e7
@ -1326,8 +1326,10 @@ 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 (isinstance(optimizer, HybridParallelZeroOptimizer) and optimizer.require_grad_sync == False)
|
||||||
|
or not torch.is_grad_enabled()
|
||||||
):
|
):
|
||||||
return outputs
|
return outputs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user