Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
a7275226
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a7275226
编写于
9月 04, 2020
作者:
C
Chengmo
提交者:
GitHub
9月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support heter-xpu-ps (#27018)
support heter-xpu-ps
上级
d8437062
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
0 deletion
+31
-0
paddle/fluid/operators/distributed/variable_response.cc
paddle/fluid/operators/distributed/variable_response.cc
+28
-0
python/paddle/distributed/fleet/runtime/parameter_server_runtime.py
...dle/distributed/fleet/runtime/parameter_server_runtime.py
+3
-0
未找到文件。
paddle/fluid/operators/distributed/variable_response.cc
浏览文件 @
a7275226
...
...
@@ -62,6 +62,34 @@ bool VariableResponse::ReadRaw(::google::protobuf::io::CodedInputStream* input,
gpu_dev_ctx
.
Wait
();
#else
PADDLE_THROW
(
"Unexpected branch"
);
#endif
return
true
;
}
else
if
(
platform
::
is_xpu_place
(
place
))
{
#ifdef PADDLE_WITH_XPU
auto
&
xpu_dev_ctx
=
static_cast
<
const
platform
::
XPUDeviceContext
&>
(
dev_ctx
);
platform
::
CPUPlace
cpu
;
char
*
p
=
reinterpret_cast
<
char
*>
(
dest
);
while
(
total_written
<
length
)
{
if
(
!
input
->
GetDirectBufferPointer
(
&
data
,
&
size_to_write
))
{
return
false
;
}
if
(
total_written
+
size_to_write
>
length
)
{
size_to_write
=
length
-
total_written
;
}
memory
::
Copy
(
BOOST_GET_CONST
(
platform
::
XPUPlace
,
place
),
reinterpret_cast
<
void
*>
(
p
),
cpu
,
data
,
size_to_write
);
p
+=
size_to_write
;
total_written
+=
size_to_write
;
input
->
Skip
(
size_to_write
);
}
xpu_dev_ctx
.
Wait
();
#else
PADDLE_ENFORCE_NOT_NULL
(
nullptr
,
platform
::
errors
::
Unimplemented
(
"Not supported XPU, please compile with option WITH_XPU=ON."
));
#endif
return
true
;
}
...
...
python/paddle/distributed/fleet/runtime/parameter_server_runtime.py
浏览文件 @
a7275226
...
...
@@ -202,6 +202,9 @@ class ParameterServerRuntime(RuntimeBase):
if
self
.
role_maker
.
_get_heter_worker_device
()
==
"GPU"
:
gpu_id
=
int
(
os
.
getenv
(
"FLAGS_selected_gpus"
,
"0"
))
executor
=
Executor
(
fluid
.
CUDAPlace
(
gpu_id
))
elif
self
.
role_maker
.
_get_heter_worker_device
()
==
"XPU"
:
xpu_id
=
int
(
os
.
getenv
(
"FLAGS_selected_xpus"
,
"0"
))
executor
=
Executor
(
fluid
.
XPUPlace
(
xpu_id
))
else
:
raise
ValueError
(
"Not Support Device {}"
.
format
(
self
.
role_maker
.
_get_heter_worker_device
()))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录