Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
d69daed1
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d69daed1
编写于
11月 24, 2021
作者:
T
Thunderbrook
提交者:
GitHub
11月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GpuPs]pybind core (#37287)
* pybind core * set use psgpu
上级
acbf9974
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
11 deletion
+10
-11
python/paddle/fluid/dataset.py
python/paddle/fluid/dataset.py
+4
-4
python/paddle/fluid/executor.py
python/paddle/fluid/executor.py
+6
-6
python/paddle/fluid/tests/unittests/test_communicator_ps_gpu.py
.../paddle/fluid/tests/unittests/test_communicator_ps_gpu.py
+0
-1
未找到文件。
python/paddle/fluid/dataset.py
浏览文件 @
d69daed1
...
...
@@ -321,19 +321,19 @@ class DatasetBase(object):
self
.
dataset
.
set_data_feed_desc
(
self
.
desc
())
self
.
dataset
.
create_readers
()
def
_set_use_ps_gpu
(
self
,
use_ps_
gpu
):
def
_set_use_ps_gpu
(
self
,
ps
gpu
):
"""
set use_ps_gpu flag
Args:
use_ps_gpu: bool
"""
self
.
use_ps_gpu
=
use_ps_gpu
self
.
use_ps_gpu
=
True
# if not defined heterps with paddle, users will not use psgpu
if
not
core
.
_is_compiled_with_heterps
():
self
.
use_ps_gpu
=
0
self
.
use_ps_gpu
=
False
elif
self
.
use_ps_gpu
:
self
.
psgpu
=
core
.
PSGPU
()
self
.
psgpu
=
psgpu
def
_finish_to_run
(
self
):
self
.
dataset
.
destroy_readers
()
...
...
python/paddle/fluid/executor.py
浏览文件 @
d69daed1
...
...
@@ -1813,9 +1813,9 @@ class Executor(object):
if
program
.
_pipeline_opt
is
None
:
if
program
.
_heter_pipeline_opt
is
None
:
self
.
_dump_debug_info
(
program
=
program
,
trainer
=
trainer
)
#
in case of calling _set_use_ps_gpu explicitly
if
dataset
.
use_ps_gpu
is
False
:
dataset
.
_set_use_ps_gpu
(
trainer
.
proto_desc
.
use_ps_gpu
)
#
warning if dataset not set psgpu in psgpu mode
if
dataset
.
use_ps_gpu
is
False
and
trainer
.
proto_desc
.
use_ps_gpu
:
logging
.
warning
(
"dataset should call set_use_ps_gpu in PsGpu mode"
)
dataset
.
_dynamic_adjust_before_train
(
trainer
.
proto_desc
.
thread_num
)
if
program
.
_heter_pipeline_opt
is
None
:
...
...
@@ -1948,9 +1948,9 @@ class Executor(object):
# NOTE: only for debug, very slow
# self._dump_debug_info(program=program, trainer=trainer)
#
in case of calling _set_use_ps_gpu explicitly
if
dataset
.
use_ps_gpu
is
False
:
dataset
.
_set_use_ps_gpu
(
trainer
.
proto_desc
.
use_ps_gpu
)
#
warning if dataset not set psgpu in psgpu mode
if
dataset
.
use_ps_gpu
is
False
and
trainer
.
proto_desc
.
use_ps_gpu
:
logging
.
warning
(
"dataset should call set_use_ps_gpu in PsGpu mode"
)
dataset
.
_dynamic_adjust_before_train
(
trainer
.
proto_desc
.
thread_num
)
trainer_desc
=
trainer
.
_desc
()
# slow, cache
...
...
python/paddle/fluid/tests/unittests/test_communicator_ps_gpu.py
浏览文件 @
d69daed1
...
...
@@ -73,7 +73,6 @@ class TestCommunicator(unittest.TestCase):
dataset
.
init
(
batch_size
=
32
,
thread_num
=
1
,
pipe_command
=
"cat"
,
use_var
=
slots_vars
)
dataset
.
set_filelist
([
"test_communicator_ps_gpu.txt"
])
dataset
.
_set_use_ps_gpu
(
1
)
dataset
.
set_date
(
"20211111"
)
dataset
.
load_into_memory
(
is_shuffle
=
True
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录