Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,8 @@ void ProcessGroupNCCL::Restart() {
phi::distributed::P2POption p2p_opts = place_to_p2p_opts_.at(place_key);
phi::distributed::CommContextManager::RecreateNCCLComm(
store_, store_key, rank_, std::to_string(create_count_), &p2p_opts);
create_count_++;
}
create_count_++;
}

void ProcessGroupNCCL::SyncCalcStream(const Place& place,
Expand Down
3 changes: 2 additions & 1 deletion paddle/fluid/distributed/collective/process_group_nccl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include <chrono>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -276,7 +277,7 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {

uint64_t comm_seq_{0};
std::unordered_map<std::string, uint64_t> p2p_comm_seq_;
std::unordered_map<std::string, std::string> place_to_group_key_;
std::map<std::string, std::string> place_to_group_key_;

// TODO(sunyilun): attrs below will be removed later
std::mutex mutex_;
Expand Down
5 changes: 3 additions & 2 deletions paddle/phi/core/distributed/comm_context_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void CommContextManager::CreateNCCLCommContext(
void CommContextManager::RecreateNCCLComm(const std::shared_ptr<Store>& store,
const std::string& unique_comm_key,
int rank,
const std::string& hash_key,
const std::string& recreate_key,
const P2POption* p2p_opt) {
auto& comm_context_manager = CommContextManager::GetInstance();

Expand All @@ -139,7 +139,8 @@ void CommContextManager::RecreateNCCLComm(const std::shared_ptr<Store>& store,
PADDLE_ENFORCE_GPU_SUCCESS(phi::dynload::ncclGetUniqueId(&nccl_id));
}

std::string unique_key = "NCCLCommContext/" + unique_comm_key + hash_key;
std::string unique_key =
"NCCLCommContext/" + unique_comm_key + "/" + recreate_key;
if (rank == 0 || (p2p_opt && p2p_opt->is_p2p_op && p2p_opt->p2p_rank == 0)) {
std::vector<uint8_t> nccl_id_wrapper(
reinterpret_cast<uint8_t*>(&nccl_id),
Expand Down
Loading