diff --git a/doc/fluid/api/optimizer.rst b/doc/fluid/api/optimizer.rst index a3a1736f15d8b0da8823d8b9dad8992c3b8581b6..06ccc695574c9d060dfe4c853c7d6c2c4ed8eb4f 100644 --- a/doc/fluid/api/optimizer.rst +++ b/doc/fluid/api/optimizer.rst @@ -28,7 +28,6 @@ paddle.optimizer optimizer/ModelAverage.rst optimizer/Momentum.rst optimizer/MomentumOptimizer.rst - optimizer/PipelineOptimizer.rst optimizer/RecomputeOptimizer.rst optimizer/RMSPropOptimizer.rst optimizer/SGD.rst diff --git a/doc/fluid/api/optimizer/PipelineOptimizer.rst b/doc/fluid/api/optimizer/PipelineOptimizer.rst deleted file mode 100644 index 87e6f4026d49f4db11dec390faf325082bb1fdbe..0000000000000000000000000000000000000000 --- a/doc/fluid/api/optimizer/PipelineOptimizer.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` - !DO NOT EDIT THIS FILE MANUALLY! - -.. _api_fluid_optimizer_PipelineOptimizer: - -PipelineOptimizer ------------------ - -.. autoclass:: paddle.fluid.optimizer.PipelineOptimizer - :members: - :inherited-members: - :exclude-members: apply_gradients, apply_optimize, backward, load - :noindex: - diff --git a/doc/fluid/api/transpiler.rst b/doc/fluid/api/transpiler.rst index 2492b98136f85ccb49922c08b096be4f7eb96d7d..28905bd06b502b30df36f03d6aea8c1295eef02f 100644 --- a/doc/fluid/api/transpiler.rst +++ b/doc/fluid/api/transpiler.rst @@ -10,4 +10,3 @@ fluid.transpiler transpiler/HashName.rst transpiler/memory_optimize.rst transpiler/release_memory.rst - transpiler/RoundRobin.rst diff --git a/doc/fluid/api/transpiler/RoundRobin.rst b/doc/fluid/api/transpiler/RoundRobin.rst deleted file mode 100644 index 547757d20e8388b3ea51b52a0b4c9e23116f0645..0000000000000000000000000000000000000000 --- a/doc/fluid/api/transpiler/RoundRobin.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` - !DO NOT EDIT THIS FILE MANUALLY! - -.. _api_fluid_transpiler_RoundRobin: - -RoundRobin ----------- - -.. autoclass:: paddle.fluid.transpiler.RoundRobin - :members: - :inherited-members: - :noindex: - diff --git a/doc/fluid/api_cn/optimizer_cn.rst b/doc/fluid/api_cn/optimizer_cn.rst index 53f740cc450e9ba500cf7df825a03d61bc180f78..766c9d885ef84841eb9ceb1dc17cb90870ee9b35 100644 --- a/doc/fluid/api_cn/optimizer_cn.rst +++ b/doc/fluid/api_cn/optimizer_cn.rst @@ -31,7 +31,6 @@ paddle.optimizer optimizer_cn/ModelAverage_cn.rst optimizer_cn/Momentum_cn.rst optimizer_cn/MomentumOptimizer_cn.rst - optimizer_cn/PipelineOptimizer_cn.rst optimizer_cn/RecomputeOptimizer_cn.rst optimizer_cn/RMSPropOptimizer_cn.rst optimizer_cn/SGD_cn.rst diff --git a/doc/fluid/api_cn/optimizer_cn/PipelineOptimizer_cn.rst b/doc/fluid/api_cn/optimizer_cn/PipelineOptimizer_cn.rst deleted file mode 100644 index 5da5dc780d2c94e960961a62816686b93f91b3d7..0000000000000000000000000000000000000000 --- a/doc/fluid/api_cn/optimizer_cn/PipelineOptimizer_cn.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. _cn_api_fluid_optimizer_PipelineOptimizer: - -PipelineOptimizer -------------------------------- - - -.. py:class:: paddle.fluid.optimizer.PipelineOptimizer(optimizer, cut_list=None, place_list=None, concurrency_list=None, queue_size=30, sync_steps=1, start_cpu_core_id=0) - -:api_attr: 声明式编程模式(静态图) - - - -使用流水线模式进行训练。 -Program会根据切分列表cut_list进行分割。如果cut_list的长度是k,则整个program(包括反向部分)将被分割为2*k-1个section。 所以place_list和concurrency_list的长度也必须是2*k-1。 - -.. note:: - - 虽然我们在流水线训练模式中采用异步更新的方式来加速,但最终的效果会依赖于每条流水线的训练进程。我们将在未来尝试同步模式。 - -参数: - - **optimizer** (Optimizer) - 基础优化器,如SGD - - **cut_list** (list of Variable list) - main_program的cut变量列表 - - **place_list** (list of Place) - 对应section运行所在的place - - **concurrency_list** (list of int) - 指定每个section的并发度列表 - - **queue_size** (int) - 每个section都会消费其输入队列(in-scope queue)中的scope,并向输出队列(out-scope queue)产出scope。 此参数的作用就是指定队列的大小。 可选,默认值:30 - - **sync_steps** (int) - 不同显卡之间的同步周期数。可选,默认值:1 - - **start_cpu_core_id** (int) - 指定所使用的第一个CPU核的id。可选,默认值:0 - -**代码示例** - -.. code-block:: python - - import paddle.fluid as fluid - import paddle.fluid.layers as layers - x = fluid.layers.data(name='x', shape=[1], dtype='int64', lod_level=0) - y = fluid.layers.data(name='y', shape=[1], dtype='int64', lod_level=0) - emb_x = layers.embedding(input=x, param_attr=fluid.ParamAttr(name="embx"), size=[10,2], is_sparse=False) - emb_y = layers.embedding(input=y, param_attr=fluid.ParamAttr(name="emby",learning_rate=0.9), size=[10,2], is_sparse=False) - concat = layers.concat([emb_x, emb_y], axis=1) - fc = layers.fc(input=concat, name="fc", size=1, num_flatten_dims=1, bias_attr=False) - loss = layers.reduce_mean(fc) - optimizer = fluid.optimizer.SGD(learning_rate=0.5) - optimizer = fluid.optimizer.PipelineOptimizer(optimizer, - cut_list=[[emb_x, emb_y], [loss]], - place_list=[fluid.CPUPlace(), fluid.CUDAPlace(0), fluid.CPUPlace()], - concurrency_list=[1, 1, 4], - queue_size=2, - sync_steps=1, - ) - optimizer.minimize(loss) - place = fluid.CPUPlace() - exe = fluid.Executor(place) - exe.run(fluid.default_startup_program()) - filelist = [] # you should set your own filelist, e.g. filelist = ["dataA.txt"] - dataset = fluid.DatasetFactory().create_dataset("FileInstantDataset") - dataset.set_use_var([x,y]) - dataset.set_batch_size(batch_size) - dataset.set_filelist(filelist) - exe.train_from_dataset( - fluid.default_main_program(), - dataset, - thread=2, - debug=False, - fetch_list=[], - fetch_info=[], - print_period=1) - - - - diff --git a/doc/fluid/api_cn/transpiler_cn.rst b/doc/fluid/api_cn/transpiler_cn.rst index 4a84c5fbc465f0f8be342a0abcf07dc886b1eea5..ebf4661d09d8b21dba989e162e13fed5a9bda454 100644 --- a/doc/fluid/api_cn/transpiler_cn.rst +++ b/doc/fluid/api_cn/transpiler_cn.rst @@ -13,4 +13,3 @@ fluid.transpiler transpiler_cn/HashName_cn.rst transpiler_cn/memory_optimize_cn.rst transpiler_cn/release_memory_cn.rst - transpiler_cn/RoundRobin_cn.rst diff --git a/doc/fluid/api_cn/transpiler_cn/RoundRobin_cn.rst b/doc/fluid/api_cn/transpiler_cn/RoundRobin_cn.rst deleted file mode 100644 index aa4b7d3890d40c58ca568ece75d9e5d26a311559..0000000000000000000000000000000000000000 --- a/doc/fluid/api_cn/transpiler_cn/RoundRobin_cn.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _cn_api_fluid_transpiler_RoundRobin: - -RoundRobin -------------------------------- - - -.. py:class:: paddle.fluid.transpiler.RoundRobin(pserver_endpoints) - -:api_attr: 声明式编程模式(静态图) - - - -该方法使用 ``RoundRobin`` 的方式将变量散列到多个parameter server终端。 - -`RondRobin `_ - -参数: - - **pserver_endpoints** (list) - endpoint (ip:port)的 list - -返回:实例化后的RoundRobin的对象 - -返回类型:RoundRobin - -**代码示例** - -.. code-block:: python - - import paddle.fluid.transpiler.RoundRobin as RoundRobin - - pserver_endpoints = [“127.0.0.1:6007”, “127.0.0.1:6008”] - vars = [“var1”,”var2”,”var3”,”var4”,”var5”] - rr = RoundRobin(pserver_endpoints) - rr.dispatch(vars) - - -.. py:method:: dispatch(varlist) - -该方法使用RoundRobin的方式将多个参数散列到多个parameter Server终端。 - -参数: - - **varlist** (list) - 参数 (var1, var2, var3) 的 list - -返回:基于varlist中var的顺序,返回参数服务器(ip:port)的列表, 列表中的数据量和varlist的数据量一致。 - -返回类型:list - -**代码示例** - -.. code-block:: python - - pserver_endpoints = [“127.0.0.1:6007”, “127.0.0.1:6008”] - vars = [“var1”,”var2”,”var3”,”var4”,”var5”] - rr = RoundRobin(pserver_endpoints) - rr.dispatch(vars) - - -.. py:method:: reset() - -该方法将重置RoundRobin内置的计数, 计数将重置为0。 - -返回:无。 - -**代码示例** - -.. code-block:: python - - pserver_endpoints = [“127.0.0.1:6007”, “127.0.0.1:6008”] - vars = [“var1”,”var2”,”var3”,”var4”,”var5”] - rr = RoundRobin(pserver_endpoints) - rr.reset() - -