Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
12e873b9
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
12e873b9
编写于
6月 05, 2018
作者:
X
Xin Pan
提交者:
GitHub
6月 05, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11160 from typhoonzero/fix_release_013_dist_bug
Fix release 013 dist bug
上级
e5fc9a11
5e853840
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
19 addition
and
4 deletion
+19
-4
cmake/external/grpc.cmake
cmake/external/grpc.cmake
+9
-2
python/paddle/fluid/transpiler/distribute_transpiler.py
python/paddle/fluid/transpiler/distribute_transpiler.py
+10
-2
未找到文件。
cmake/external/grpc.cmake
浏览文件 @
12e873b9
...
@@ -33,10 +33,18 @@ ELSE()
...
@@ -33,10 +33,18 @@ ELSE()
SET
(
BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j
${
NUM_OF_PROCESSOR
}
static grpc_cpp_plugin
)
SET
(
BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j
${
NUM_OF_PROCESSOR
}
static grpc_cpp_plugin
)
ENDIF
()
ENDIF
()
# FIXME(wuyi): do not build zlib cares protobuf twice, find a way to build grpc with them
ExternalProject_Add
(
ExternalProject_Add
(
extern_grpc
extern_grpc
DEPENDS protobuf zlib
DEPENDS protobuf zlib
URL
"http://paddlepaddledeps.bj.bcebos.com/grpc.tar.xz"
# NOTE(wuyi):
# this package is generated by following steps:
# 1. git clone -b v1.8.x https://github.com/grpc/grpc.git
# 2. submodule update --init
# 3. keep only zlib, cares, protobuf, boringssl under "third_party",
# checkout and clean other dirs under third_party
# 4. remove .git, and package the directory.
URL
"http://paddlepaddledeps.bj.bcebos.com/grpc-v1.8.x.tar.gz"
PREFIX
${
GRPC_SOURCES_DIR
}
PREFIX
${
GRPC_SOURCES_DIR
}
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
CONFIGURE_COMMAND
""
...
@@ -49,7 +57,6 @@ ExternalProject_Add(
...
@@ -49,7 +57,6 @@ ExternalProject_Add(
INSTALL_COMMAND make prefix=
${
GRPC_INSTALL_DIR
}
install
INSTALL_COMMAND make prefix=
${
GRPC_INSTALL_DIR
}
install
)
)
# FIXME(typhoonzero): hack to get static lib path, try a better way like merge them.
ADD_LIBRARY
(
grpc++_unsecure STATIC IMPORTED GLOBAL
)
ADD_LIBRARY
(
grpc++_unsecure STATIC IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET grpc++_unsecure PROPERTY IMPORTED_LOCATION
SET_PROPERTY
(
TARGET grpc++_unsecure PROPERTY IMPORTED_LOCATION
"
${
GRPC_INSTALL_DIR
}
/lib/libgrpc++_unsecure.a"
)
"
${
GRPC_INSTALL_DIR
}
/lib/libgrpc++_unsecure.a"
)
...
...
python/paddle/fluid/transpiler/distribute_transpiler.py
浏览文件 @
12e873b9
...
@@ -186,12 +186,17 @@ class DistributeTranspiler:
...
@@ -186,12 +186,17 @@ class DistributeTranspiler:
param_list
=
[]
param_list
=
[]
grad_list
=
[]
grad_list
=
[]
param_grad_set
=
set
()
for
p
,
g
in
self
.
params_grads
:
for
p
,
g
in
self
.
params_grads
:
# skip parameter marked not trainable
# skip parameter marked not trainable
if
type
(
p
)
==
Parameter
and
p
.
trainable
==
False
:
if
type
(
p
)
==
Parameter
and
p
.
trainable
==
False
:
continue
continue
if
p
.
name
not
in
param_grad_set
:
param_list
.
append
(
p
)
param_list
.
append
(
p
)
param_grad_set
.
add
(
p
.
name
)
if
g
.
name
not
in
param_grad_set
:
grad_list
.
append
(
g
)
grad_list
.
append
(
g
)
param_grad_set
.
add
(
g
.
name
)
self
.
_update_dist_lookup_table_vars
(
param_list
,
grad_list
,
self
.
_update_dist_lookup_table_vars
(
param_list
,
grad_list
,
self
.
params_grads
)
self
.
params_grads
)
...
@@ -802,6 +807,9 @@ class DistributeTranspiler:
...
@@ -802,6 +807,9 @@ class DistributeTranspiler:
if
not
block_map
.
has_key
(
varname
):
if
not
block_map
.
has_key
(
varname
):
block_map
[
varname
]
=
[]
block_map
[
varname
]
=
[]
block_map
[
varname
].
append
((
long
(
offset
),
long
(
size
)))
block_map
[
varname
].
append
((
long
(
offset
),
long
(
size
)))
# Do not remove this important debug message:
print
(
"block map: %s"
%
block_map
)
for
varname
,
splited
in
block_map
.
iteritems
():
for
varname
,
splited
in
block_map
.
iteritems
():
orig_var
=
program
.
global_block
().
var
(
varname
)
orig_var
=
program
.
global_block
().
var
(
varname
)
if
len
(
splited
)
==
1
:
if
len
(
splited
)
==
1
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录