提交 b2dc54c0 编写于 作者: D dongdaxiang

add distributed.fleet to gen_doc

上级 c98bfff1
==============
paddle.complex
==============
.. toctree::
:maxdepth: 1
===========
distributed
===========
.. toctree::
:maxdepth: 1
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_LambdaDecay:
LambdaDecay
-----------
.. autoclass:: paddle.fluid.dygraph.LambdaDecay
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_LinearLrWarmup:
LinearLrWarmup
--------------
.. autoclass:: paddle.fluid.dygraph.LinearLrWarmup
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_MultiStepDecay:
MultiStepDecay
--------------
.. autoclass:: paddle.fluid.dygraph.MultiStepDecay
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_ProgramTranslator:
ProgramTranslator
-----------------
.. autoclass:: paddle.fluid.dygraph.ProgramTranslator
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_StepDecay:
StepDecay
---------
.. autoclass:: paddle.fluid.dygraph.StepDecay
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_declarative:
declarative
-----------
.. autofunction:: paddle.fluid.dygraph.declarative
:noindex:
=================
distributed.fleet
=================
.. toctree::
:maxdepth: 1
fleet/DistributedStrategy.rst
fleet/UtilBase.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fleet_DistributedStrategy:
DistributedStrategy
-------------------
.. autoclass:: paddle.fleet.DistributedStrategy
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fleet_UtilBase:
UtilBase
--------
.. autoclass:: paddle.fleet.UtilBase
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_ComplexVariable:
ComplexVariable
---------------
.. autoclass:: paddle.fluid.ComplexVariable
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_disable_imperative:
disable_imperative
------------------
.. autofunction:: paddle.fluid.disable_imperative
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_enable_imperative:
enable_imperative
-----------------
.. autofunction:: paddle.fluid.enable_imperative
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_ComplexVariable:
ComplexVariable
---------------
.. autoclass:: paddle.fluid.framework.ComplexVariable
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_cpu_places:
cpu_places
----------
.. autofunction:: paddle.fluid.framework.cpu_places
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_cuda_pinned_places:
cuda_pinned_places
------------------
.. autofunction:: paddle.fluid.framework.cuda_pinned_places
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_cuda_places:
cuda_places
-----------
.. autofunction:: paddle.fluid.framework.cuda_places
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_device_guard:
device_guard
------------
.. autofunction:: paddle.fluid.framework.device_guard
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_get_flags:
get_flags
---------
.. autofunction:: paddle.fluid.framework.get_flags
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_in_dygraph_mode:
in_dygraph_mode
---------------
.. autofunction:: paddle.fluid.framework.in_dygraph_mode
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_is_compiled_with_cuda:
is_compiled_with_cuda
---------------------
.. autofunction:: paddle.fluid.framework.is_compiled_with_cuda
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_load_op_library:
load_op_library
---------------
.. autofunction:: paddle.fluid.framework.load_op_library
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_require_version:
require_version
---------------
.. autofunction:: paddle.fluid.framework.require_version
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_framework_set_flags:
set_flags
---------
.. autofunction:: paddle.fluid.framework.set_flags
:noindex:
......@@ -22,6 +22,7 @@ import paddle.fluid as fluid
import paddle.tensor as tensor
import paddle.nn as nn
import paddle.complex as complex
import paddle.distributed as distributed
#import paddle.framework as framework
def parse_arg():
......
......@@ -9,6 +9,15 @@ done
python gen_doc.py --module_name "" --module_prefix "" --output fluid --output_name fluid --to_multiple_files True
python gen_module_index.py fluid fluid
for module in fleet
do
python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name fleet --to_multiple_files True
python gen_module_index.py ${module} distributed.${module}
done
python gen_doc.py --module_name "" --module_prefix "" --output distributed --output_name distributed --to_multiple_files True
python gen_module_index.py distributed distributed
# tensor
for module in math random stat linalg search
do
......
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_initializer_set_global_initializer:
set_global_initializer
----------------------
.. autofunction:: paddle.fluid.initializer.set_global_initializer
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_io_default_collate_fn:
default_collate_fn
------------------
.. autofunction:: paddle.fluid.io.default_collate_fn
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_Assert:
Assert
------
.. autofunction:: paddle.fluid.layers.Assert
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_cosh:
cosh
----
.. autofunction:: paddle.fluid.layers.cosh
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_mish:
mish
----
.. autofunction:: paddle.fluid.layers.mish
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_resize_linear:
resize_linear
-------------
.. autofunction:: paddle.fluid.layers.resize_linear
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_sinh:
sinh
----
.. autofunction:: paddle.fluid.layers.sinh
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_unbind:
unbind
------
.. autofunction:: paddle.fluid.layers.unbind
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_InstanceNorm:
InstanceNorm
------------
.. autoclass:: paddle.nn.InstanceNorm
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_Pad2D:
Pad2D
-----
.. autoclass:: paddle.nn.Pad2D
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_UpSample:
UpSample
--------
.. autoclass:: paddle.nn.UpSample
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_loss_BCELoss:
BCELoss
-------
.. autoclass:: paddle.nn.loss.BCELoss
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_loss_CrossEntropyLoss:
CrossEntropyLoss
----------------
.. autoclass:: paddle.nn.loss.CrossEntropyLoss
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_loss_MSELoss:
MSELoss
-------
.. autoclass:: paddle.nn.loss.MSELoss
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_bmm:
bmm
---
.. autofunction:: paddle.tensor.linalg.bmm
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_cholesky:
cholesky
--------
.. autofunction:: paddle.tensor.linalg.cholesky
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_cross:
cross
-----
.. autofunction:: paddle.tensor.linalg.cross
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_dot:
dot
---
.. autofunction:: paddle.tensor.linalg.dot
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_histogram:
histogram
---------
.. autofunction:: paddle.tensor.linalg.histogram
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_matmul:
matmul
------
.. autofunction:: paddle.tensor.linalg.matmul
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_norm:
norm
----
.. autofunction:: paddle.tensor.linalg.norm
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_t:
t
-
.. autofunction:: paddle.tensor.linalg.t
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_linalg_transpose:
transpose
---------
.. autofunction:: paddle.tensor.linalg.transpose
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_abs:
abs
---
.. autofunction:: paddle.tensor.math.abs
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_acos:
acos
----
.. autofunction:: paddle.tensor.math.acos
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_addcmul:
addcmul
-------
.. autofunction:: paddle.tensor.math.addcmul
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_addmm:
addmm
-----
.. autofunction:: paddle.tensor.math.addmm
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_asin:
asin
----
.. autofunction:: paddle.tensor.math.asin
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_ceil:
ceil
----
.. autofunction:: paddle.tensor.math.ceil
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_clamp:
clamp
-----
.. autofunction:: paddle.tensor.math.clamp
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_cos:
cos
---
.. autofunction:: paddle.tensor.math.cos
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_cosh:
cosh
----
.. autofunction:: paddle.tensor.math.cosh
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_cumsum:
cumsum
------
.. autofunction:: paddle.tensor.math.cumsum
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_add:
elementwise_add
---------------
.. autofunction:: paddle.tensor.math.elementwise_add
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_div:
elementwise_div
---------------
.. autofunction:: paddle.tensor.math.elementwise_div
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_floordiv:
elementwise_floordiv
--------------------
.. autofunction:: paddle.tensor.math.elementwise_floordiv
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_max:
elementwise_max
---------------
.. autofunction:: paddle.tensor.math.elementwise_max
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_min:
elementwise_min
---------------
.. autofunction:: paddle.tensor.math.elementwise_min
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_mod:
elementwise_mod
---------------
.. autofunction:: paddle.tensor.math.elementwise_mod
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_pow:
elementwise_pow
---------------
.. autofunction:: paddle.tensor.math.elementwise_pow
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_sub:
elementwise_sub
---------------
.. autofunction:: paddle.tensor.math.elementwise_sub
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_erf:
erf
---
.. autofunction:: paddle.tensor.math.erf
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_exp:
exp
---
.. autofunction:: paddle.tensor.math.exp
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_floor:
floor
-----
.. autofunction:: paddle.tensor.math.floor
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_increment:
increment
---------
.. autofunction:: paddle.tensor.math.increment
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_inverse:
inverse
-------
.. autofunction:: paddle.tensor.math.inverse
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_kron:
kron
----
.. autofunction:: paddle.tensor.math.kron
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_log:
log
---
.. autofunction:: paddle.tensor.math.log
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_log1p:
log1p
-----
.. autofunction:: paddle.tensor.math.log1p
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_logsumexp:
logsumexp
---------
.. autofunction:: paddle.tensor.math.logsumexp
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_max:
max
---
.. autofunction:: paddle.tensor.math.max
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_min:
min
---
.. autofunction:: paddle.tensor.math.min
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_multiplex:
multiplex
---------
.. autofunction:: paddle.tensor.math.multiplex
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_multiply:
multiply
--------
.. autofunction:: paddle.tensor.math.multiply
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_reciprocal:
reciprocal
----------
.. autofunction:: paddle.tensor.math.reciprocal
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_reduce_max:
reduce_max
----------
.. autofunction:: paddle.tensor.math.reduce_max
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_reduce_min:
reduce_min
----------
.. autofunction:: paddle.tensor.math.reduce_min
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_reduce_prod:
reduce_prod
-----------
.. autofunction:: paddle.tensor.math.reduce_prod
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_reduce_sum:
reduce_sum
----------
.. autofunction:: paddle.tensor.math.reduce_sum
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_round:
round
-----
.. autofunction:: paddle.tensor.math.round
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_rsqrt:
rsqrt
-----
.. autofunction:: paddle.tensor.math.rsqrt
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_scale:
scale
-----
.. autofunction:: paddle.tensor.math.scale
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sign:
sign
----
.. autofunction:: paddle.tensor.math.sign
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sinh:
sinh
----
.. autofunction:: paddle.tensor.math.sinh
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_square:
square
------
.. autofunction:: paddle.tensor.math.square
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_stanh:
stanh
-----
.. autofunction:: paddle.tensor.math.stanh
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sums:
sums
----
.. autofunction:: paddle.tensor.math.sums
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_trace:
trace
-----
.. autofunction:: paddle.tensor.math.trace
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_random_shuffle:
shuffle
-------
.. autofunction:: paddle.tensor.random.shuffle
:noindex:
======
search
======
.. toctree::
:maxdepth: 1
search/argmax.rst
search/argmin.rst
search/argsort.rst
search/has_inf.rst
search/has_nan.rst
search/index_sample.rst
search/index_select.rst
search/nonzero.rst
search/sort.rst
search/topk.rst
search/where.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_argmax:
argmax
------
.. autofunction:: paddle.tensor.search.argmax
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_argmin:
argmin
------
.. autofunction:: paddle.tensor.search.argmin
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_argsort:
argsort
-------
.. autofunction:: paddle.tensor.search.argsort
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_has_inf:
has_inf
-------
.. autofunction:: paddle.tensor.search.has_inf
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_has_nan:
has_nan
-------
.. autofunction:: paddle.tensor.search.has_nan
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_index_sample:
index_sample
------------
.. autofunction:: paddle.tensor.search.index_sample
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_index_select:
index_select
------------
.. autofunction:: paddle.tensor.search.index_select
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_nonzero:
nonzero
-------
.. autofunction:: paddle.tensor.search.nonzero
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_sort:
sort
----
.. autofunction:: paddle.tensor.search.sort
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_topk:
topk
----
.. autofunction:: paddle.tensor.search.topk
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_search_where:
where
-----
.. autofunction:: paddle.tensor.search.where
:noindex:
====
stat
====
.. toctree::
:maxdepth: 1
stat/mean.rst
stat/reduce_mean.rst
stat/std.rst
stat/var.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_stat_mean:
mean
----
.. autofunction:: paddle.tensor.stat.mean
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_stat_reduce_mean:
reduce_mean
-----------
.. autofunction:: paddle.tensor.stat.reduce_mean
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_stat_std:
std
---
.. autofunction:: paddle.tensor.stat.std
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_stat_var:
var
---
.. autofunction:: paddle.tensor.stat.var
:noindex:
.. _cluster_quick_start:
从Paddle Fluid 1.5开始,我们推荐使用Fleet API进行分布式训练,关于Fleet API的介绍可以参考 :ref:`fleet_api`
首先,我们假设读者已经学会单机训练,如果还没单机训练的经验,请参考 :ref:`single_training`
想了解分布式训练,我们可以从单机模拟分布式训练开始,在单台机器上启动多个进程代表多台机器,并进行分布式训练。
为了让读者快速上手,我们采用点击率预估任务作为示例,相关的源码可以参考 xxxx
单机训练代码
.. code:: python
def train():
args = parse_args()
if not os.path.isdir(args.model_output_dir):
os.mkdir(args.model_output_dir)
dense_input = fluid.layers.data(
name="dense_input", shape=[dense_feature_dim], dtype='float32')
sparse_input_ids = [
fluid.layers.data(name="C" + str(i), shape=[1], lod_level=1, dtype="int64")
for i in range(1, 27)]
label = fluid.layers.data(name='label', shape=[1], dtype='int64')
loss, auc_var, batch_auc_var = ctr_dnn_model_dataset(dense_input, sparse_input_ids, label,
args.embedding_size, args.sparse_feature_dim)
optimizer = fluid.optimizer.SGD(learning_rate=1e-4)
optimizer.minimize(loss)
exe = fluid.Executor(fluid.CPUPlace())
exe.run(fluid.default_startup_program())
dataset = fluid.DatasetFactory().create_dataset()
dataset.set_use_var([dense_input] + sparse_input_ids + [label])
pipe_command = "python criteo_reader.py %d" % args.sparse_feature_dim
dataset.set_pipe_command(pipe_command)
dataset.set_batch_size(100)
thread_num = 10
dataset.set_thread(thread_num)
whole_filelist = ["raw_data/part-%d" % x for x in range(len(os.listdir("raw_data")))]
epochs = 20
for i in range(epochs):
dataset.set_filelist(whole_filelist[:int(0.8*len(whole_filelist))])
exe.train_from_dataset(program=fluid.default_main_program(),
dataset=dataset,
fetch_list=[auc_var],
fetch_info=["auc"],
debug=False)
model_dir = args.model_output_dir + '/epoch' + str(i + 1) + ".model"
sys.stderr.write("epoch%d finished" % (i + 1))
fluid.io.save_inference_model(model_dir, [dense_input.name] + [x.name for x in sparse_input_ids] + [label.name], [loss, auc_var], exe)
使用FleetAPI进行训练的代码
.. code:: python
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
def train():
args = parse_args()
if not os.path.isdir(args.model_output_dir):
os.mkdir(args.model_output_dir)
dense_input = fluid.layers.data(
name="dense_input", shape=[dense_feature_dim], dtype='float32')
sparse_input_ids = [
fluid.layers.data(name="C" + str(i), shape=[1], lod_level=1, dtype="int64")
for i in range(1, 27)]
label = fluid.layers.data(name='label', shape=[1], dtype='int64')
loss, auc_var, batch_auc_var = ctr_dnn_model_dataset(dense_input, sparse_input_ids, label,
args.embedding_size, args.sparse_feature_dim)
role = role_maker.PaddleCloudRoleMaker()
exe = fluid.Executor(fluid.CPUPlace())
fleet.init(role)
optimizer = fluid.optimizer.SGD(learning_rate=1e-4)
strategy = DistributeTranspilerConfig()
strategy.sync_mode = False
optimizer = fleet.distributed_optimizer(optimizer, strategy)
optimizer.minimize(loss)
if fleet.is_server():
fleet.init_server()
fleet.run_server()
elif fleet.is_worker():
fleet.init_worker()
exe = fluid.Executor(fluid.CPUPlace())
exe.run(fluid.default_startup_program())
dataset = fluid.DatasetFactory().create_dataset()
dataset.set_use_var([dense_input] + sparse_input_ids + [label])
pipe_command = "python criteo_reader.py %d" % args.sparse_feature_dim
dataset.set_pipe_command(pipe_command)
dataset.set_batch_size(100)
thread_num = 10
dataset.set_thread(thread_num)
whole_filelist = ["raw_data/part-%d" % x for x in range(len(os.listdir("raw_data")))]
epochs = 20
for i in range(epochs):
dataset.set_filelist(whole_filelist[:int(0.8*len(whole_filelist))])
exe.train_from_dataset(program=fluid.default_main_program(),
dataset=dataset,
fetch_list=[auc_var],
fetch_info=["auc"],
debug=False)
if fleet.worker_index() == 0:
model_dir = args.model_output_dir + '/epoch' + str(i + 1) + ".model"
sys.stderr.write("epoch%d finished" % (i + 1))
fluid.io.save_inference_model(model_dir,
[dense_input.name] + [x.name for x in sparse_input_ids] + [label.name], [loss, auc_var], exe)
启动命令
.. code:: python
python -m paddle.distributed.launch_ps --worker_num 2 --server_num 2 dist_train.py
运行日志
如何进行多机分布式训练
请参考百度云运行分布式任务的示例
分布式训练快速开始
==================
准备工作
--------
在本篇文章中,我们将会在介绍如何快速在一个集群中启动一个 PaddlePaddle
的分布式训练任务,在开始之前,请按如下步骤做些准备工作:
1. 准备一个网络连通的训练集群,在本文中我们使用4个训练节点使用 ``*.paddlepaddle.com``
来表示节点的主机名称,您可以根据实际情况修改它。
2. 在开始之前确保已经阅读过 :ref:`install_steps`
并且可以在集群的所有节点上可以正常运行 PaddlePaddle。
样例代码
-------
下面使用一个非常简单的线性回归模型作为样例来解释如何启动一个包含2个 ``PSERVER`` 节点以及
2个 ``TRAINER`` 节点的分布式训练任务,您可以将本段代码保存为 ``dist_train.py`` 运行。
.. code:: python
import os
import paddle
import paddle.fluid as fluid
# train reader
BATCH_SIZE = 20
EPOCH_NUM = 30
BATCH_SIZE = 8
train_reader = paddle.batch(
paddle.reader.shuffle(
paddle.dataset.uci_housing.train(), buf_size=500),
batch_size=BATCH_SIZE)
def train():
y = fluid.layers.data(name='y', shape=[1], dtype='float32')
x = fluid.layers.data(name='x', shape=[13], dtype='float32')
y_predict = fluid.layers.fc(input=x, size=1, act=None)
loss = fluid.layers.square_error_cost(input=y_predict, label=y)
avg_loss = fluid.layers.mean(loss)
opt = fluid.optimizer.SGD(learning_rate=0.001)
opt.minimize(avg_loss)
place = fluid.CPUPlace()
feeder = fluid.DataFeeder(place=place, feed_list=[x, y])
exe = fluid.Executor(place)
# fetch distributed training environment setting
training_role = os.getenv("PADDLE_TRAINING_ROLE", None)
port = os.getenv("PADDLE_PSERVER_PORT", "6174")
pserver_ips = os.getenv("PADDLE_PSERVER_IPS", "")
trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
eplist = []
for ip in pserver_ips.split(","):
eplist.append(':'.join([ip, port]))
pserver_endpoints = ",".join(eplist)
trainers = int(os.getenv("PADDLE_TRAINERS"))
current_endpoint = os.getenv("PADDLE_CURRENT_IP", "") + ":" + port
t = fluid.DistributeTranspiler()
t.transpile(
trainer_id = trainer_id,
pservers = pserver_endpoints,
trainers = trainers)
if training_role == "PSERVER":
pserver_prog = t.get_pserver_program(current_endpoint)
startup_prog = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(startup_prog)
exe.run(pserver_prog)
elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program()
exe.run(fluid.default_startup_program())
for epoch in range(EPOCH_NUM):
for batch_id, batch_data in enumerate(train_reader()):
avg_loss_value, = exe.run(trainer_prog,
feed=feeder.feed(batch_data),
fetch_list=[avg_loss])
if (batch_id + 1) % 10 == 0:
print("Epoch: {0}, Batch: {1}, loss: {2}".format(
epoch, batch_id, avg_loss_value[0]))
# destory the resource of current trainer node in pserver server node
exe.close()
else:
raise AssertionError("PADDLE_TRAINING_ROLE should be one of [TRAINER, PSERVER]")
train()
环境变量说明
-----------
在启动分布式训练任务时,使用不同的环境变量来表示不同的节点角色,具体如下:
.. list-table::
:header-rows: 1
* - 环境变量
- 数据类型
- 样例
- 描述
* - :code:`PADDLE_TRAINING_ROLE`
- str
- :code:`PSERVER,TRAINER`
- 当前训练节点角色
* - :code:`PADDLE_PSERVER_IPS`
- str
- :code:`ps0.paddlepaddle.com,ps1.paddlepaddle.com`
- 分布式训练任务中所有 PSERVER 节点的 IP 地址或 hostname, 使用","分隔
* - :code:`PADDLE_PSERVER_PORT`
- int
- 6174
- PSERVER 进程监听的端口
* - :code:`PADDLE_TRAINERS`
- int
- 2
- 分布式训练任务中 trainer 节点的数量
* - :code:`PADDLE_CURRENT_IP`
- str
- :code:`ps0.paddlepaddle.com`
- 当前 PSERVER 节点的 IP 地址或 hostname
* - :code:`PADDLE_TRAINER_ID`
- str
- 0
- 当前 TRAINER 节点的 ID (唯一), 取值范围为 [0, PADDLE_TRAINERS)
注: 环境变量只是获取运行时信息的一种方式,实际任务中可以采用命令行参数等方式获取运行时信息。
分布式训练相关 API
------------------
DistributeTranspiler
~~~~~~~~~~~~~~~~~~~~~~
基于 pserver-trainer 架构的的分布式训练任务分为两种角色: Parameter Server(PSERVER) 以及 TRAINER,
在 Fluid 中,用户只需配置单机训练所需要的网络配置, ``DistributeTranspiler`` 模块会自动地根据
当前训练节点的角色将用户配置的单机网路配置改写成 PSERVER 和 TRAINER 需要运行的网络配置:
.. code:: python
t = fluid.DistributeTranspiler()
t.transpile(
trainer_id = trainer_id,
pservers = pserver_endpoints,
trainers = trainers)
if PADDLE_TRAINING_ROLE == "TRAINER":
# fetch the trainer program and execute it
trainer_prog = t.get_trainer_program()
...
elif PADDLE_TRAINER_ROLE == "PSERVER":
# fetch the pserver program and execute it
pserver_prog = t.get_pserver_program(current_endpoint)
...
exe.close()
~~~~~~~~~~~~~~
PSERVER 节点中会保存所有 TRAINER 节点的状态信息,在 TRAINER 结束训练时需要调用 ``exe.close()``
通知所有 PSERVER 节点释放当前 TRAINER 节点的资源:
.. code:: python
exe = fluid.Executor(fluid.CPUPlace())
# training process ...
exe.close() # notify PServer to destory the resource
注意:所有的trainer在退出时都需要调用exe.close()。
启动分布式训练任务
--------------------
.. list-table::
:header-rows: 1
* - 启动节点
- 启动命令
- 说明
* - ps0.paddlepaddle.com
- :code:`PADDLE_TRAINING_ROLE=PSERVER PADDLE_CURRENT_IP=ps0.paddlepaddle.com PADDLE_PSERVER_IPS=ps0.paddlepaddle.com,ps1.paddlepaddle.com PADDLE_TRAINERS=2 PADDLE_PSERVER_PORT=6174 python fluid_dist.py`
- 启动 PSERVER 节点
* - ps1.paddlepaddle.com
- :code:`PADDLE_TRAINING_ROLE=PSERVER PADDLE_CURRENT_IP=ps1.paddlepaddle.com PADDLE_PSERVER_IPS=ps0.paddlepaddle.com,ps1.paddlepaddle.com PADDLE_TRAINERS=2 PADDLE_PSERVER_PORT=6174 python fluid_dist.py`
- 启动 PSERVER 节点
* - trainer0.paddlepaddle.com
- :code:`PADDLE_TRAINING_ROLE=TRAINER PADDLE_PSERVER_IPS=ps0.paddlepaddle.com,ps1.paddlepaddle.com PADDLE_TRAINERS=2 PADDLE_TRAINER_ID=0 PADDLE_PSERVER_PORT=6174 python fluid_dist.py`
- 启动第0号 TRAINER 节点
* - trainer1.paddlepaddle.com
- :code:`PADDLE_TRAINING_ROLE=TRAINER PADDLE_PSERVER_IPS=ps0.paddlepaddle.com,ps1.paddlepaddle.com PADDLE_TRAINERS=2 PADDLE_TRAINER_ID=1 PADDLE_PSERVER_PORT=6174 python fluid_dist.py`
- 启动第1号 TRAINER 节点
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册