From f027ef7913bd2f5043937f6715b956a81cb07323 Mon Sep 17 00:00:00 2001 From: YuliangLiu0306 <72588413+YuliangLiu0306@users.noreply.github.com> Date: Tue, 3 Jan 2023 16:53:43 +0800 Subject: [PATCH] [hotfix] fix fp16 optimzier bug (#2273) --- colossalai/amp/naive_amp/_fp16_optimizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/colossalai/amp/naive_amp/_fp16_optimizer.py b/colossalai/amp/naive_amp/_fp16_optimizer.py index 8eecacb77..1e8884c86 100644 --- a/colossalai/amp/naive_amp/_fp16_optimizer.py +++ b/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