Browse Source

[hotfix] fix fp16 optimzier bug (#2273)

pull/2315/head
YuliangLiu0306 2 years ago committed by GitHub
parent
commit
f027ef7913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      colossalai/amp/naive_amp/_fp16_optimizer.py

4
colossalai/amp/naive_amp/_fp16_optimizer.py

@ -70,8 +70,8 @@ class FP16Optimizer(Optimizer):
# get process group
def _get_process_group(parallel_mode):
if gpc.is_initialized(ParallelMode.DATA) and gpc.get_world_size(ParallelMode.DATA):
return gpc.get_group(ParallelMode.DATA)
if gpc.is_initialized(parallel_mode) and gpc.get_world_size(parallel_mode):
return gpc.get_group(parallel_mode)
else:
return None

Loading…
Cancel
Save