未验证 提交 9a6465ca 编写于 作者: J james 提交者: GitHub

bugfix in XPU legacy_dygraph distributed training: (#47838)

phi::Alloc() complains about missing device_allocator_
上级 31f3f643
......@@ -353,6 +353,17 @@ BKCLComm* BKCLCommContext::AssignBKCLComm(
BKCLContext_t comm, int nranks, int rank, int dev_id, int ring_id) {
std::unique_ptr<XPUDeviceContext> dev_ctx(
new XPUDeviceContext(XPUPlace(dev_id)));
dev_ctx->SetAllocator(paddle::memory::allocation::AllocatorFacade::Instance()
.GetAllocator(XPUPlace(dev_id))
.get());
dev_ctx->SetHostAllocator(
paddle::memory::allocation::AllocatorFacade::Instance()
.GetAllocator(paddle::platform::CPUPlace())
.get());
dev_ctx->SetZeroAllocator(
paddle::memory::allocation::AllocatorFacade::Instance()
.GetZeroAllocator(XPUPlace(dev_id))
.get());
BKCLCommImpl* c = new BKCLCommImpl;
c->set_ring_id(ring_id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册