未验证 提交 2d0fb059 编写于 作者: R Roc 提交者: GitHub

Fix Ctx Dev pointer for KUNLUN (#48184)

上级 fed0ed34
...@@ -292,14 +292,14 @@ phi::DeviceContext* ProcessGroupBKCL::GetDeviceContext( ...@@ -292,14 +292,14 @@ phi::DeviceContext* ProcessGroupBKCL::GetDeviceContext(
const std::string& key = GetKeyFromPlace(place); const std::string& key = GetKeyFromPlace(place);
if (use_calc_stream) { if (use_calc_stream) {
const auto& iter = place_to_calc_ctx_.find(key); const auto& iter = place_to_calc_ctx_.find(key);
return *iter->second; return iter->second;
} else { } else {
const auto& iter = place_to_comm_ctx_.find(key); const auto& iter = place_to_comm_ctx_.find(key);
PADDLE_ENFORCE_NE(iter, PADDLE_ENFORCE_NE(iter,
place_to_comm_ctx_.end(), place_to_comm_ctx_.end(),
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"Cannot find device context in process group.")); "Cannot find device context in process group."));
return *iter->second; return iter->second.get();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册