Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
22db82c0
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
22db82c0
编写于
1月 24, 2019
作者:
W
Wu Yi
提交者:
GitHub
1月 24, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix tangwei merge issue test=develop (#15506)
上级
dec89bd7
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
3 deletion
+8
-3
python/paddle/fluid/parallel_executor.py
python/paddle/fluid/parallel_executor.py
+1
-1
python/paddle/fluid/transpiler/distribute_transpiler.py
python/paddle/fluid/transpiler/distribute_transpiler.py
+7
-2
未找到文件。
python/paddle/fluid/parallel_executor.py
浏览文件 @
22db82c0
...
@@ -159,7 +159,7 @@ class ParallelExecutor(object):
...
@@ -159,7 +159,7 @@ class ParallelExecutor(object):
trainers_endpoints
=
main
.
_trainers_endpoints
trainers_endpoints
=
main
.
_trainers_endpoints
if
num_trainers
>
1
and
trainers_endpoints
:
if
num_trainers
>
1
and
trainers_endpoints
:
assert
num_trainers
==
len
(
assert
num_trainers
==
len
(
trainers_endpoints
),
"num_trainers == len(end
_
points)"
trainers_endpoints
),
"num_trainers == len(endpoints)"
build_strategy
.
trainers_endpoints
=
trainers_endpoints
build_strategy
.
trainers_endpoints
=
trainers_endpoints
# step6: get persistable_vars, places. persistable_vars
# step6: get persistable_vars, places. persistable_vars
...
...
python/paddle/fluid/transpiler/distribute_transpiler.py
浏览文件 @
22db82c0
...
@@ -477,13 +477,16 @@ class DistributeTranspiler(object):
...
@@ -477,13 +477,16 @@ class DistributeTranspiler(object):
trainer_id
,
trainer_id
,
trainers
,
trainers
,
current_endpoint
,
current_endpoint
,
startup_program
=
None
):
startup_program
=
None
,
wait_port
=
True
):
if
not
startup_program
:
if
not
startup_program
:
startup_program
=
default_startup_program
()
startup_program
=
default_startup_program
()
if
trainer_id
>=
0
:
if
trainer_id
>=
0
:
worker_endpoints
=
trainers
.
split
(
","
)
worker_endpoints
=
trainers
.
split
(
","
)
# send NCCL_ID to others or recv from trainer 0
# send NCCL_ID to others or recv from trainer 0
worker_endpoints
.
remove
(
current_endpoint
)
worker_endpoints
.
remove
(
current_endpoint
)
if
trainer_id
==
0
and
wait_port
:
wait_server_ready
(
worker_endpoints
)
nccl_id_var
=
startup_program
.
global_block
().
create_var
(
nccl_id_var
=
startup_program
.
global_block
().
create_var
(
name
=
"NCCLID"
,
persistable
=
True
,
type
=
core
.
VarDesc
.
VarType
.
RAW
)
name
=
"NCCLID"
,
persistable
=
True
,
type
=
core
.
VarDesc
.
VarType
.
RAW
)
...
@@ -564,11 +567,13 @@ class DistributeTranspiler(object):
...
@@ -564,11 +567,13 @@ class DistributeTranspiler(object):
if
self
.
config
.
mode
==
"nccl2"
:
if
self
.
config
.
mode
==
"nccl2"
:
assert
(
isinstance
(
trainers
,
str
))
assert
(
isinstance
(
trainers
,
str
))
self
.
origin_program
.
_trainers_endpoints
=
trainers
.
split
(
","
)
self
.
_transpile_nccl2
(
self
.
_transpile_nccl2
(
trainer_id
,
trainer_id
,
trainers
,
trainers
,
current_endpoint
,
current_endpoint
,
startup_program
=
startup_program
)
startup_program
=
startup_program
,
wait_port
=
self
.
config
.
wait_port
)
return
return
self
.
trainer_num
=
trainers
self
.
trainer_num
=
trainers
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录