Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
c70ea1cc
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c70ea1cc
编写于
1月 05, 2018
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add splitter
上级
ed55f1b9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
1 deletion
+38
-1
python/paddle/v2/fluid/distribute_transpiler.py
python/paddle/v2/fluid/distribute_transpiler.py
+0
-1
python/paddle/v2/fluid/distributed_spliter.py
python/paddle/v2/fluid/distributed_spliter.py
+38
-0
未找到文件。
python/paddle/v2/fluid/distribute_transpiler.py
浏览文件 @
c70ea1cc
...
@@ -80,7 +80,6 @@ class DistributeTranspiler:
...
@@ -80,7 +80,6 @@ class DistributeTranspiler:
# step3
# step3
send_inputs
=
[]
send_inputs
=
[]
send_outputs
=
[]
for
_
,
splited
in
var2splited
.
iteritems
():
for
_
,
splited
in
var2splited
.
iteritems
():
send_inputs
.
extend
(
splited
)
send_inputs
.
extend
(
splited
)
send_outputs
=
self
.
_create_vars_from_blocklist
(
program
,
param_blocks
)
send_outputs
=
self
.
_create_vars_from_blocklist
(
program
,
param_blocks
)
...
...
python/paddle/v2/fluid/distributed_spliter.py
0 → 100644
浏览文件 @
c70ea1cc
def
hash_name
(
varblocks
,
pserver_endpoints
):
"""
:param varblocks: a list of VarBlock string indicating
sub blocks of variables
:return: a map of pserver endpoint -> varblock_str
"""
def
_hash_block
(
block_str
,
total
):
return
hash
(
block_str
)
%
total
ep2block
=
dict
()
for
varblock_str
in
varblocks
:
if
param
.
trainable
is
True
and
grad
is
not
None
:
server_id
=
_hash_block
(
varblock_str
,
len
(
pserver_endpoints
))
server_for_param
=
pserver_endpoints
[
server_id
]
if
not
ep2block
.
has_key
(
server_for_param
):
ep2block
[
server_for_param
]
=
[]
ep2block
[
server_for_param
].
append
(
varblock_str
)
return
ep2block
def
round_robin
(
varblocks
,
pserver_endpoints
):
assert
(
len
(
varblocks
)
>
len
(
pserver_endpoints
))
ep2block
=
dict
()
pserver_idx
=
0
for
varblock_str
in
varblocks
:
if
param
.
trainable
is
True
:
server_for_param
=
pserver_endpoints
[
pserver_idx
]
if
not
ep2block
.
has_key
(
server_for_param
):
ep2block
[
server_for_param
]
=
[]
ep2block
[
server_for_param
].
append
(
varblock_str
)
pserver_idx
+=
1
if
pserver_idx
>=
len
(
pserver_endpoints
):
pserver_idx
=
0
return
ep2block
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录