diff --git a/paddle/fluid/distributed/collective/process_group_custom.cc b/paddle/fluid/distributed/collective/process_group_custom.cc index 89ec97c08dd1db50e13738c3f26fa6c3a0a6ac1e..633b56dfd4803b613488f387b77aa541fa7a6129 100644 --- a/paddle/fluid/distributed/collective/process_group_custom.cc +++ b/paddle/fluid/distributed/collective/process_group_custom.cc @@ -153,12 +153,10 @@ void ProcessGroupCustom::CreateCustomManagerCache( std::vector> dev_ctx; dev_ctx.resize(places.size()); - std::unique_ptr comms( - new phi::ccl::CCLComm[places.size()]); for (size_t i = 0; i < places.size(); ++i) { phi::DeviceGuard guard(places[i]); ccl_comms[i] = CustomCCLCommManager::Create( - device_type, GetSize(), GetRank(), &ccl_id, comms.get() + i); + device_type, GetSize(), GetRank(), &ccl_id, new phi::ccl::CCLComm); dev_ctx[i].reset(new CustomDeviceContext(places[i])); }