From 4e42992cc1e7159f2c476105864ea12580e5ccdc Mon Sep 17 00:00:00 2001 From: yao_yf Date: Tue, 7 Mar 2023 09:50:39 +0800 Subject: [PATCH] fix opt_shard bug --- mindspore/ccsrc/frontend/parallel/step_parallel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/frontend/parallel/step_parallel.cc b/mindspore/ccsrc/frontend/parallel/step_parallel.cc index c7e515953fe..6ef6010ddbe 100644 --- a/mindspore/ccsrc/frontend/parallel/step_parallel.cc +++ b/mindspore/ccsrc/frontend/parallel/step_parallel.cc @@ -1271,9 +1271,9 @@ static void InsertAllGatherOp(const FuncGraphPtr &root, const std::string &group if (param_ptr->user_data()) { auto opt_shard_mirror_group = param_ptr->user_data()->opt_shard_mirror_group(); is_with_mirror = !opt_shard_mirror_group.empty(); - if (!is_with_mirror) { + if (!param_ptr->param_info()->parallel_optimizer()) { auto mirror_group = mirror_group_list(param_ptr->user_data()); - is_with_mirror = !mirror_group.empty(); + is_with_mirror = mirror_group.size() > 1; } }