Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
1ce2d613
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
1ce2d613
编写于
11月 20, 2017
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update grammar
上级
0b72a27e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
20 deletion
+45
-20
doc/design/refactor/distributed_architecture.md
doc/design/refactor/distributed_architecture.md
+45
-20
未找到文件。
doc/design/refactor/distributed_architecture.md
浏览文件 @
1ce2d613
...
...
@@ -16,9 +16,9 @@ limitations:
write the inter-model-shard communication code.
3.
The user can not directly specify the parameter update rule: need
to modify the parameter server C++ code and compile a new
binary. This adds complication for researchers: A lot of extra
effort is
required. Besides, the training job submission program
to modify the parameter server C++ code and compile a new
binary.
This adds complication for researchers: A lot of extra effort is
required. Besides, the training job submission program
may not allow running arbitrary binaries.
This design doc discusses PaddlePaddle's new distributed training
...
...
@@ -44,7 +44,7 @@ replicated Python instances are running on different nodes: both the
training logic and the neural network computation is replicated.
The tasks that should only run once all belong to the training logic,
if we only replicate the neural network computation
,
but do
**not**
if we only replicate the neural network computation but do
**not**
replicate the training logic, the limitation could be solved.
### Limitation 2
...
...
@@ -53,13 +53,13 @@ Model parallelism means running a single model on multiple nodes by
partitioning the model onto different nodes and managing the
inter-model-shard communications.
PaddlePaddle should be able to modify the ne
ru
al network computation
PaddlePaddle should be able to modify the ne
ur
al network computation
definition to support model parallelism automatically. However, the
computation is only specified in Python code, and PaddlePaddle can
not
computation is only specified in Python code, and PaddlePaddle cannot
modify Python code.
Just like compiler uses a intermediate representation (IR) so that
programmer does not need to manually optimize their code in most of
Just like compiler uses a
n
intermediate representation (IR) so that
the
programmer does not need to manually optimize their code in most of
the cases - the compiler will optimize the IR:
<img
src=
"src/compiler.png"
/>
...
...
@@ -75,20 +75,20 @@ Python:
### Limitation 3
The user can not directly specify the parameter update rule for the
parameter server because the previous implementaion hard coded that
parameter server because the previous implementa
t
ion hard coded that
parameter server only do vector's optimization algorithm by
configuration. The user can not specify the parameter server's
computation layer by layer.
This could be fixed by making the parameter server run a separated
IR according to the trainer's varia
l
ble (tensors, selectedrows)
defin
a
tion.
IR according to the trainer's variable (tensors, selectedrows)
defin
i
tion.
the same
computation definition
as
the trainer. For a detailed explanation,
computation definition
of
the trainer. For a detailed explanation,
please
see
[
Design Doc: Operation Graph
Based Parameter Server
](
./parameter_server.md
)
[
Design Doc: Operation Graph
-
Based Parameter Server
](
./parameter_server.md
)
## Distributed Training Architecture
...
...
@@ -136,18 +136,43 @@ iteratively.
As shown in the graph,
`RemoteExecutor.run`
sends the IR to the
PaddlePaddle cluster for Execution. You can also use parameter
`fetch_list`
to interactively fetch vari
r
able back to local for
`fetch_list`
to interactively fetch variable back to local for
log printing.
The Python
`RemoteExecutor`
is derived from
`Executor`
class.
For more information about
`RemoteExecutor`
, please
see
[
Design Doc: RemoteExecutor
](
./remote_executor.md
)
.
The
`RemoteExecutor.run`
interface defination is:
```
python
run
(
self
,
program
=
None
,
feed
=
None
,
fetch_list
=
None
,
feed_var_name
=
'feed'
,
fetch_var_name
=
'fetch'
,
job_desc
=
JobDesc
(
jobname
,
num_trainer
,
num_pserver
,
cpu_per_trainer
,
gpu_per_trainer
,
mem_per_trainer
,
cpu_per_pserver
,
mem_per_pserver
))
```
`JobDesc`
object describe the distributed job resource specification to run on
Cluster environment.
By default,
`Executor.run`
starts a PaddlePaddle Cloud
[
TrainingJob
](
https://github.com/PaddlePaddle/cloud/blob/develop/doc/autoscale/README.md#training-job-resource
)
, or you can run each component in the
[
TrainingJob
](
https://github.com/PaddlePaddle/cloud/blob/develop/doc/autoscale/README.md#training-job-resource
)
,
or you can run each component in the
executor by your own method:
-
Data Par
r
allelism
-
Data Parallelism
```
python
if
os
.
getenv
(
'PLACE_PSERVER'
):
exe
.
run_pserver
()
...
...
@@ -164,10 +189,10 @@ executor by your own method:
As mentioned above, the implementation of IR is
[
Program
](
../program.md
)
.
[
Executor
](
../executor.md
)
converts and parses the IR to a prefered
[
Executor
](
../executor.md
)
converts and parses the IR to a prefer
r
ed
graph for final execution. For local training you generally use
`Executor`
to run the graph locally. For any kind of distributed
training, you can use
`RemoteExecutor`
to specify desired distributed
training, you can use
`RemoteExecutor`
to specify desired distributed
training method with some optional arguments.
### PaddlePaddle Converter
...
...
@@ -182,7 +207,7 @@ to different PaddlePaddle runtimes. Below are the steps:
1.
Extract a new computation (sub)graph with
`feed`
and
`fetch`
OP as
the boundary. The runtime does not need to run the OP that is not
dependent
by
the
`fetch`
OP.
dependent
on
the
`fetch`
OP.
1.
Optimizes the computation graph.
...
...
@@ -238,7 +263,7 @@ the Python reader will need to read from the distributed filesystem
network traffic.
When doing distributed training, the user can still use Python data
reader: the training data are sent with
`Executor.run`
. However should
reader: the training data are sent with
`Executor.run`
. However
,
should
be used for debugging purpose only. The users are encouraged to use
the read data OPs.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录