fix opt_shard bug

This commit is contained in:
yao_yf 2023-03-07 09:50:39 +08:00
parent aa905d51af
commit 4e42992cc1
1 changed files with 2 additions and 2 deletions

View File

@ -1271,9 +1271,9 @@ static void InsertAllGatherOp(const FuncGraphPtr &root, const std::string &group
if (param_ptr->user_data<TensorLayout>()) {
auto opt_shard_mirror_group = param_ptr->user_data<TensorLayout>()->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<TensorLayout>());
is_with_mirror = !mirror_group.empty();
is_with_mirror = mirror_group.size() > 1;
}
}