Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
FluidDoc
提交
503d8f0f
F
FluidDoc
项目概览
PaddlePaddle
/
FluidDoc
通知
5
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
23
列表
看板
标记
里程碑
合并请求
111
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FluidDoc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
23
Issue
23
列表
看板
标记
里程碑
合并请求
111
合并请求
111
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
503d8f0f
编写于
9月 21, 2020
作者:
S
seiriosPlus
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add doc
上级
9aa6e363
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
259 addition
and
0 deletion
+259
-0
doc/paddle/api/paddle/distributed/fleet/Fleet_cn.rst
doc/paddle/api/paddle/distributed/fleet/Fleet_cn.rst
+256
-0
doc/paddle/api/paddle/distributed/fleet/PaddleCloudRoleMaker_cn.rst
.../api/paddle/distributed/fleet/PaddleCloudRoleMaker_cn.rst
+1
-0
doc/paddle/api/paddle/distributed/fleet/UserDefinedRoleMaker_cn.rst
.../api/paddle/distributed/fleet/UserDefinedRoleMaker_cn.rst
+2
-0
未找到文件。
doc/paddle/api/paddle/distributed/fleet/Fleet_cn.rst
浏览文件 @
503d8f0f
...
@@ -11,57 +11,313 @@ Fleet
...
@@ -11,57 +11,313 @@ Fleet
..
py
:
method
::
init
(
role_maker
=
None
,
is_collective
=
False
)
..
py
:
method
::
init
(
role_maker
=
None
,
is_collective
=
False
)
使用
RoleMaker
或其他配置初始化
fleet
。
返回:无。
**
代码示例
1
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
**
代码示例
2
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
(
is_collective
=
True
)
**
代码示例
3
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
role
=
fleet
.
PaddleCloudRoleMaker
fleet
.
init
(
role
)
..
py
:
method
::
is_first_worker
()
..
py
:
method
::
is_first_worker
()
返回当前节点是否为第一个
`
worker
`
节点
返回:
True
/
False
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
is_first_worker
()
..
py
:
method
::
worker_index
()
..
py
:
method
::
worker_index
()
返回当前节点的编号
,
每个
`
worker
`
节点被分配
[
0
,
worker_num
-
1
]
内的唯一的编码
ID
返回:
int
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
worker_index
()
..
py
:
method
::
worker_num
()
..
py
:
method
::
worker_num
()
返回当前全部训练节点的个数
返回:
int
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
worker_num
()
..
py
:
method
::
is_worker
()
..
py
:
method
::
is_worker
()
返回当前节点是否为
`
worker
`
节点
返回:
True
/
False
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
is_worker
()
..
py
:
method
::
worker_endpoints
(
to_string
=
False
)
..
py
:
method
::
worker_endpoints
(
to_string
=
False
)
返回全部
worker
节点的
ip
及端口信息
返回:
list
/
string
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
worker_endpoints
()
..
py
:
method
::
server_num
()
..
py
:
method
::
server_num
()
返回当前全部
Server
节点的个数
返回:
int
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
server_num
()
..
py
:
method
::
server_index
()
..
py
:
method
::
server_index
()
返回当前节点的编号
,
每个
`
server
`
节点被分配
[
0
,
server_num
-
1
]
内的唯一的编码
ID
返回:
int
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
server_index
()
..
py
:
method
::
server_endpoints
(
to_string
=
False
)
..
py
:
method
::
server_endpoints
(
to_string
=
False
)
返回全部
server
节点的
ip
及端口信息
返回:
list
/
string
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
server_endpoints
()
..
py
:
method
::
is_server
()
..
py
:
method
::
is_server
()
返回当前节点是否为
`
server
`
节点
返回:
True
/
False
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
is_server
()
..
py
:
method
::
barrier_worker
()
..
py
:
method
::
barrier_worker
()
强制要求所有的
worker
在此处需要相互等待一次
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
barrier_worker
()
..
py
:
method
::
init_worker
()
..
py
:
method
::
init_worker
()
worker
节点在训练前的初始化
,
包括通信模块,
参数同步等
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
init_worker
()
..
py
:
method
::
init_server
(*
args
,
**
kwargs
)
..
py
:
method
::
init_server
(*
args
,
**
kwargs
)
server
节点的初始化
,
包括
server
端参数初始化,模型加载等
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
init_server
()
..
py
:
method
::
run_server
()
..
py
:
method
::
run_server
()
server
节点的运行
,
此命令会将
ParameterServer
的进程启动并常驻直至训练结束
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
init_server
()
fleet
.
run_server
()
..
py
:
method
::
stop_worker
()
..
py
:
method
::
stop_worker
()
停止当前正在运行的
worker
节点
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
fleet
.
init
()
fleet
.
init_worker
()
"..."
fleet
.
stop_worker
()
..
py
:
method
::
save_inference_model
(
executor
,
dirname
,
feeded_var_names
,
target_vars
,
main_program
=
None
,
export_for_deployment
=
True
)
..
py
:
method
::
save_inference_model
(
executor
,
dirname
,
feeded_var_names
,
target_vars
,
main_program
=
None
,
export_for_deployment
=
True
)
保存模型及参数用于预估服务
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
import
paddle
.
fluid
as
fluid
fleet
.
init
()
#
build
net
#
fleet
.
distributed_optimizer
(...)
exe
=
fluid
.
Executor
(
fluid
.
CPUPlace
())
fleet
.
save_inference_model
(
exe
,
"dirname"
,
[
"feednames1"
],
[
acc
,
loss
],
fluid
.
default_main_program
())
..
py
:
method
::
save_persistables
(
executor
,
dirname
,
main_program
=
None
)
..
py
:
method
::
save_persistables
(
executor
,
dirname
,
main_program
=
None
)
保存全量模型参数
返回:无
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
import
paddle
.
fluid
as
fluid
fleet
.
init
()
#
build
net
#
fleet
.
distributed_optimizer
(...)
exe
=
fluid
.
Executor
(
fluid
.
CPUPlace
())
fleet
.
save_persistables
(
exe
,
"dirname"
,
fluid
.
default_main_program
())
..
py
:
method
::
distributed_optimizer
(
optimizer
,
strategy
=
None
)
..
py
:
method
::
distributed_optimizer
(
optimizer
,
strategy
=
None
)
基于分布式布式并行策略进行模型的拆分及优化。
**
代码示例
**
..
code
-
block
::
python
import
paddle
.
distributed
.
fleet
as
fleet
role
=
fleet
.
role_maker
.
PaddleCloudRoleMaker
(
is_collective
=
True
)
fleet
.
init
(
role
)
strategy
=
fleet
.
DistributedStrategy
()
optimizer
=
paddle
.
optimizer
.
SGD
(
learning_rate
=
0.001
)
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
=
strategy
)
..
py
:
method
::
distributed_model
(
model
)
..
py
:
method
::
distributed_model
(
model
)
...
...
doc/paddle/api/paddle/distributed/fleet/PaddleCloudRoleMaker_cn.rst
浏览文件 @
503d8f0f
...
@@ -4,6 +4,7 @@ PaddleCloudRoleMaker
...
@@ -4,6 +4,7 @@ PaddleCloudRoleMaker
-------------------------------
-------------------------------
.. py:class:: paddle.distributed.fleet.PaddleCloudRoleMaker
.. py:class:: paddle.distributed.fleet.PaddleCloudRoleMaker
PaddleCloudRoleMaker是基于从环境变量中获取分布式相关信息进行分布式配置初始化的接口.
...
...
doc/paddle/api/paddle/distributed/fleet/UserDefinedRoleMaker_cn.rst
浏览文件 @
503d8f0f
...
@@ -5,6 +5,8 @@ UserDefinedRoleMaker
...
@@ -5,6 +5,8 @@ UserDefinedRoleMaker
.. py:class:: paddle.distributed.fleet.UserDefinedRoleMaker
.. py:class:: paddle.distributed.fleet.UserDefinedRoleMaker
UserDefinedRoleMaker是基于从用户自定义的参数中获取分布式相关信息进行分布式配置初始化的接口
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录