fix mpi create group and cpu tensor update

This commit is contained in:
baihuawei 2021-09-19 16:35:01 +08:00
parent a009c8e8b4
commit 6e7b5b61c0
2 changed files with 6 additions and 2 deletions

View File

@ -75,7 +75,9 @@ bool MPICollective::CreateCommGroup(const std::string &name, const std::vector<u
CHECK_RET(mpi_inited_, true, "HcclCollectiveGroup has not been inited.");
CHECK_RET(ranks.empty(), false, "Ranks is empty.");
std::vector<int> group_ranks(ranks.begin(), ranks.end());
CHECK_RET(group_comm_.count(name), 0, "Group comm has already been created.");
if (group_comm_.count(name) != 0) {
return true;
}
CHECK_RET(rtSetDevice(local_rank_id_), RT_ERROR_NONE, "Call rtSetDevice error.");
HcclRootInfo rootInfo;
if (static_cast<size_t>(rank_id_) == ranks[0]) {

View File

@ -232,7 +232,9 @@ tensor::TensorPtr CPUKernelRuntime::CreatTensorForOutput(
}
(void)bound_addresses_.insert(address);
}
tensor->set_sync_status(kNeedSyncDeviceToHostImmediately);
if (address->ptr_ != nullptr) {
tensor->set_sync_status(kNeedSyncDeviceToHostImmediately);
}
session::KernelWithIndex node_index(node, index);
tensor->SetNeedWait(true);
tensor->SetIsGraphOutput();