Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
b6bc4cb5
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
b6bc4cb5
编写于
12月 04, 2020
作者:
S
ShenLiang
提交者:
GitHub
12月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support dp run single card (#29358) (#29372)
上级
374822b6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
9 deletion
+7
-9
python/paddle/distributed/fleet/base/fleet_base.py
python/paddle/distributed/fleet/base/fleet_base.py
+3
-4
python/paddle/fluid/dygraph/parallel.py
python/paddle/fluid/dygraph/parallel.py
+4
-5
未找到文件。
python/paddle/distributed/fleet/base/fleet_base.py
浏览文件 @
b6bc4cb5
...
@@ -179,6 +179,9 @@ class Fleet(object):
...
@@ -179,6 +179,9 @@ class Fleet(object):
fleet.init(strategy=strategy)
fleet.init(strategy=strategy)
"""
"""
if
strategy
is
None
:
strategy
=
DistributedStrategy
()
self
.
_user_defined_strategy
=
copy
.
deepcopy
(
strategy
)
if
role_maker
is
None
:
if
role_maker
is
None
:
if
isinstance
(
is_collective
,
bool
):
if
isinstance
(
is_collective
,
bool
):
...
@@ -220,10 +223,6 @@ class Fleet(object):
...
@@ -220,10 +223,6 @@ class Fleet(object):
else
:
else
:
paddle
.
distributed
.
init_parallel_env
()
paddle
.
distributed
.
init_parallel_env
()
if
strategy
is
None
:
strategy
=
DistributedStrategy
()
self
.
_user_defined_strategy
=
copy
.
deepcopy
(
strategy
)
def
is_first_worker
(
self
):
def
is_first_worker
(
self
):
"""
"""
Check whether the node is the first instance of worker.
Check whether the node is the first instance of worker.
...
...
python/paddle/fluid/dygraph/parallel.py
浏览文件 @
b6bc4cb5
...
@@ -395,11 +395,10 @@ class DataParallel(layers.Layer):
...
@@ -395,11 +395,10 @@ class DataParallel(layers.Layer):
1024
)
1024
)
self
.
init_reducer
()
self
.
init_reducer
()
else
:
else
:
warnings
.
warn
(
warnings
.
warn
(
"The program will return to single-card operation. "
"nranks is less than 2, "
"Please check 1, whether you use spawn or fleetrun "
"maybe you need to check the current system environment."
"to start the program. 2. Whether it is a multi-card "
" Need to use spawn or fleetrun to "
"program. 3. Is the current environment multi-card."
)
"start distributed programs."
)
def
init_reducer
(
self
):
def
init_reducer
(
self
):
layers_param
=
[]
layers_param
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录