提交 02d1d957 编写于 作者: R RaindragonD 提交者: xsrobin

Release/1.4 (#905)

* modify write_docs (how to contribute documentation) (#899)

* modify write_docs_cn, write_docs_en, include specifications about python 2.7.15 and creating  virtual env with conda

* gitignore update

* revert .gitignore;  update write_docs

* icafe DLTP-1328, stress  exe.close()

* DLTP-1383 不可迭代更正

* DLTP-1404 修复动态图文档中每段代码的格式和大小都不一样

* DLTP-1390 Pyreader中文显示格式问题

* DLTP-1393 无效链接

* DLTP-1421 paddle.fluid.layers.reduce_max中文翻译有问题

* DyGraph 调整标签结构
上级 e4cf6e82
...@@ -24,8 +24,8 @@ PaddlePaddle Fluid可以支持在现代GPU [#]_ 服务器集群上完成高性 ...@@ -24,8 +24,8 @@ PaddlePaddle Fluid可以支持在现代GPU [#]_ 服务器集群上完成高性
:header: "调节项", "可选值说明", "配置方法" :header: "调节项", "可选值说明", "配置方法"
:widths: 3, 3, 5 :widths: 3, 3, 5
"通信模式", "pserver模式;NCCL2模式(collective [#]_ )", "配置方法参考: `这里 <../../user_guides/howto/training/cluster_howto.html#permalink-8--nccl2->`_ " "通信模式", "pserver模式;NCCL2模式(collective [#]_ )", "配置方法参考::ref:`cluster_howto`"
"执行模式", "单进程;单进程ParallelGraph;多进程", "配置方法参考: `这里 <../../user_guides/howto/training/cluster_howto.html#permalink-9--nccl2->`_ " "执行模式", "单进程;单进程ParallelGraph;多进程", "配置方法参考::ref:`cluster_howto`"
"同步AllReduce操作", "开启则使每次调用等待AllReduce同步", "设置环境变量 :code:`FLAGS_sync_nccl_allreduce`" "同步AllReduce操作", "开启则使每次调用等待AllReduce同步", "设置环境变量 :code:`FLAGS_sync_nccl_allreduce`"
"CPU线程数", "int值,配置使用的CPU线程数", "参考本片后续说明" "CPU线程数", "int值,配置使用的CPU线程数", "参考本片后续说明"
"预先分配足够的显存", "0~1之间的float值,预先分配显存的占比", "设置环境变量 :code:`FLAGS_fraction_of_gpu_memory_to_use`" "预先分配足够的显存", "0~1之间的float值,预先分配显存的占比", "设置环境变量 :code:`FLAGS_fraction_of_gpu_memory_to_use`"
...@@ -41,7 +41,7 @@ PaddlePaddle Fluid可以支持在现代GPU [#]_ 服务器集群上完成高性 ...@@ -41,7 +41,7 @@ PaddlePaddle Fluid可以支持在现代GPU [#]_ 服务器集群上完成高性
选择通信模式和执行模式 选择通信模式和执行模式
+++++++++++++++++++ +++++++++++++++++++
GPU分布式训练场景,使用多进程+NCCL2模式(collective)通常可以获得最好的性能。参考 `这里 <../../user_guides/howto/training/cluster_howto.html#permalink-8--nccl2->`_ 配置您的程序使用多进程NCCL2模式训练。 GPU分布式训练场景,使用多进程+NCCL2模式(collective)通常可以获得最好的性能。参考 :ref:`cluster_howto` 配置您的程序使用多进程NCCL2模式训练。
在进程模式下,每台服务器的每个GPU卡都会对应启动一个训练进程, 在进程模式下,每台服务器的每个GPU卡都会对应启动一个训练进程,
集群中的所有进程之间会互相通信完成训练。以此方式最大限度的降低进程内部资源抢占的开销。 集群中的所有进程之间会互相通信完成训练。以此方式最大限度的降低进程内部资源抢占的开销。
......
...@@ -56,8 +56,13 @@ sudo apt-get update && apt-get install -y python-dev build-essential ...@@ -56,8 +56,13 @@ sudo apt-get update && apt-get install -y python-dev build-essential
``` ```
git clone https://github.com/PaddlePaddle/PaddlePaddle.org.git git clone https://github.com/PaddlePaddle/PaddlePaddle.org.git
cd PaddlePaddle.org/portal cd PaddlePaddle.org/portal
# To install in a virtual environment. ```
# virtualenv venv; source venv/bin/activate
之后需要安装依赖库,请确保在python 2.7.15 或2.7.16 环境下安装。推荐使用Anaconda或virtualenv创建合适的虚拟环境后安装依赖库。
安装依赖库:
```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
......
...@@ -51,13 +51,19 @@ Take the ubuntu system as an example, run: ...@@ -51,13 +51,19 @@ Take the ubuntu system as an example, run:
sudo apt-get update && apt-get install -y python-dev build-essential sudo apt-get update && apt-get install -y python-dev build-essential
``` ```
then: Then:
``` ```
git clone https://github.com/PaddlePaddle/PaddlePaddle.org.git git clone https://github.com/PaddlePaddle/PaddlePaddle.org.git
cd PaddlePaddle.org/portal cd PaddlePaddle.org/portal
# To install in a virtual environment. ```
# virtualenv venv; source venv/bin/activate
Then install requirements. Please make sure that you install with python 2.7.15 or 2.7.16. We recommend you to use Anaconda or virtualenv to create an appropriate virtual environment first.
Install requirements:
```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
......
...@@ -196,7 +196,7 @@ PyReader ...@@ -196,7 +196,7 @@ PyReader
**代码示例** **代码示例**
1.如果iterable=false,则创建的Pyreader对象几乎与 ``fluid.layers.py_reader()`` 相同。算子将被插入program中。用户应该在每个epoch之前调用start(),并在epoch结束时捕获 ``Executor.run()`` 抛出的 ``fluid.core.EOFException `` 。一旦捕获到异常,用户应该调用reset()手动重置reader。 1.如果iterable=False,则创建的Pyreader对象几乎与 ``fluid.layers.py_reader()`` 相同。算子将被插入program中。用户应该在每个epoch之前调用start(),并在epoch结束时捕获 ``Executor.run()`` 抛出的 ``fluid.core.EOFException `` 。一旦捕获到异常,用户应该调用reset()手动重置reader。
.. code-block:: python .. code-block:: python
...@@ -220,7 +220,7 @@ PyReader ...@@ -220,7 +220,7 @@ PyReader
break break
2.如果iterable=True,则创建的Pyreader对象与程序分离。程序中不会插入任何算子。在本例中,创建的reader是一个python生成器,它是可迭代的。用户应将从Pyreader对象生成的数据输入 ``Executor.run(feed=...)`` 2.如果iterable=True,则创建的Pyreader对象与程序分离。程序中不会插入任何算子。在本例中,创建的reader是一个python生成器,它是可迭代的。用户应将从Pyreader对象生成的数据输入 ``Executor.run(feed=...)``
.. code-block:: python .. code-block:: python
...@@ -239,15 +239,15 @@ PyReader ...@@ -239,15 +239,15 @@ PyReader
for data in reader(): for data in reader():
executor.run(feed=data, ...) executor.run(feed=data, ...)
.. py:method::start() .. py:function:: start()
启动数据输入线程。只能在reader对象不可迭代时调用。 启动数据输入线程。只能在reader对象不可迭代时调用。
.. py:method::reset() .. py:function:: reset()
当 ``fluid.core.EOFException`` 提升时重置reader对象。只能在reader对象不可迭代时调用。 当 ``fluid.core.EOFException`` 提升时重置reader对象。只能在reader对象不可迭代时调用。
.. py:method::decorate_sample_generator(sample_generator, batch_size, drop_last=True, places=None) .. py:function:: decorate_sample_generator(sample_generator, batch_size, drop_last=True, places=None)
设置Pyreader对象的数据源。 设置Pyreader对象的数据源。
...@@ -264,7 +264,7 @@ PyReader ...@@ -264,7 +264,7 @@ PyReader
- **places** (None|list(CUDAPlace)|list(CPUPlace)) – 位置列表。当PyReader可迭代时必须被提供 - **places** (None|list(CUDAPlace)|list(CPUPlace)) – 位置列表。当PyReader可迭代时必须被提供
.. py:method::decorate_sample_list_generator(reader, places=None) .. py:function:: decorate_sample_list_generator(reader, places=None)
设置Pyreader对象的数据源。 设置Pyreader对象的数据源。
...@@ -277,7 +277,7 @@ PyReader ...@@ -277,7 +277,7 @@ PyReader
- **places** (None|list(CUDAPlace)|list(CPUPlace)) – 位置列表。当PyReader可迭代时必须被提供 - **places** (None|list(CUDAPlace)|list(CPUPlace)) – 位置列表。当PyReader可迭代时必须被提供
.. py:method::decorate_batch_generator(reader, places=None) .. py:function:: decorate_batch_generator(reader, places=None)
设置Pyreader对象的数据源。 设置Pyreader对象的数据源。
......
...@@ -6839,7 +6839,7 @@ reduce_max ...@@ -6839,7 +6839,7 @@ reduce_max
参数: 参数:
- **input** (Variable):输入变量为Tensor或LoDTensor。 - **input** (Variable):输入变量为Tensor或LoDTensor。
- **dim** (list | int | None):函数运算的维度。如果为None,则计算所有元素的平均值并返回单个元素的Tensor变量,否则必须在 :math:`[−rank(input),rank(input)]` 范围内。如果 :math:`dim [i] <0` ,则维度将减小为 :math:`rank+dim[i]` 。 - **dim** (list | int | None):函数运算的维度。如果为None,则计算所有元素中的最大值并返回单个元素的Tensor变量,否则必须在 :math:`[−rank(input),rank(input)]` 范围内。如果 :math:`dim [i] <0` ,则维度将减小为 :math:`rank+dim[i]` 。
- **keep_dim** (bool | False):是否在输出Tensor中保留减小的维度。除非 ``keep_dim`` 为true,否则结果张量将比输入少一个维度。 - **keep_dim** (bool | False):是否在输出Tensor中保留减小的维度。除非 ``keep_dim`` 为true,否则结果张量将比输入少一个维度。
- **name** (str | None):这一层的名称(可选)。如果设置为None,则将自动命名这一层。 - **name** (str | None):这一层的名称(可选)。如果设置为None,则将自动命名这一层。
......
...@@ -171,6 +171,9 @@ PSERVER 节点中会保存所有 TRAINER 节点的状态信息,在 TRAINER 结 ...@@ -171,6 +171,9 @@ PSERVER 节点中会保存所有 TRAINER 节点的状态信息,在 TRAINER 结
# training process ... # training process ...
exe.close() # notify PServer to destory the resource exe.close() # notify PServer to destory the resource
注意:所有的trainer在退出时都需要调用exe.close()。
启动分布式训练任务 启动分布式训练任务
-------------------- --------------------
......
...@@ -167,6 +167,7 @@ The status information of all trainer nodes is saved in the pserver node. When t ...@@ -167,6 +167,7 @@ The status information of all trainer nodes is saved in the pserver node. When t
# training process ... # training process ...
exe.close() # notify PServer to destory the resource exe.close() # notify PServer to destory the resource
Note: every trainer needs to call exe.close() when the trainer finishes.
Start a Distributed Training Task Start a Distributed Training Task
---------------------------------- ----------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册