Skip to content

Commit 71b1c39

Browse files
authored
Merge pull request #11874 from panyx0718/move_trainer
Move trainer and utils api
2 parents f7fd711 + d70a38d commit 71b1c39

File tree

356 files changed

+543
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+543
-533
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ learning to many products at Baidu.
1818
Our vision is to enable deep learning for everyone via PaddlePaddle.
1919
Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddle/releases) to track the latest feature of PaddlePaddle.
2020

21+
### Lastest PaddlePaddle Version: [Fluid](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid)
22+
2123
## Features
2224

2325
- **Flexibility**

doc/v2/design/cluster_train/large_model_dist_train.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ In `trainer_internal.cpp:L93 trainOneBatch`:
5252
5353
When doing actual network forward and backward, at the beginning of each batch, the trainer will try to download one row of data from pserver.
5454
55-
In `trainer/RemoteParameterUpdater.cpp`: `parameterUpdater_->getParametersRemote();`:
55+
In `legacy/trainer/RemoteParameterUpdater.cpp`: `parameterUpdater_->getParametersRemote();`:
5656
5757
```c++
5858
if (fullSize) {

doc/v2/design/mkl/mkldnn.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ Figure 1. PaddlePaddle on IA
1818
具体的完成状态可以参见[这里](https://github.com/PaddlePaddle/Paddle/projects/21)
1919

2020
## Contents
21-
22-
- [Overview](#overview)
23-
- [Actions](#actions)
24-
- [CMake](#cmake)
25-
- [Matrix](#matrix)
26-
- [Layers](#layers)
27-
- [Activations](#activations)
28-
- [Parameters](#parameters)
29-
- [Gradients](#gradients)
30-
- [Unit Tests](#unit-tests)
31-
- [Python API](#python-api)
32-
- [Benchmarking](#benchmarking)
33-
- [Others](#others)
34-
- [Design Concerns](#design-concerns)
21+
22+
- [Overview](#overview)
23+
- [Actions](#actions)
24+
- [CMake](#cmake)
25+
- [Matrix](#matrix)
26+
- [Layers](#layers)
27+
- [Activations](#activations)
28+
- [Parameters](#parameters)
29+
- [Gradients](#gradients)
30+
- [Unit Tests](#unit-tests)
31+
- [Python API](#python-api)
32+
- [Benchmarking](#benchmarking)
33+
- [Others](#others)
34+
- [Design Concerns](#design-concerns)
3535

3636
## Overview
3737

@@ -218,20 +218,20 @@ if use_mkldnn
218218
我们总结出一些特别需要注意的点:
219219

220220
1. 使用**deviceId_**。为了尽可能少的在父类Layer中添加变量或者函数,
221-
我们决定使用已有的`deviceId_`变量来区分layer的属性,定义`-2``MKLDNNLayer`特有的设备ID。
222-
2. 重写父类Layer的**init**函数,修改`deviceId_``-2`,代表这个layer是用于跑在MKL-DNN的环境下。
221+
我们决定使用已有的`deviceId_`变量来区分layer的属性,定义`-2``MKLDNNLayer`特有的设备ID。
222+
2. 重写父类Layer的**init**函数,修改`deviceId_``-2`,代表这个layer是用于跑在MKL-DNN的环境下。
223223
3. 创建`MKLDNNBase`,定义一些除了layer和memory相关的类和函数。
224-
包括MKL-DNN会用到`MKLDNNStream``CPUEngine`,和未来可能还会用到`FPGAEngine`等。
224+
包括MKL-DNN会用到`MKLDNNStream``CPUEngine`,和未来可能还会用到`FPGAEngine`等。
225225
4. 如果MKL-DNN layer的后面接有cpu device,那么就会使`output_.value``extOutVal_`共享内存,
226226
同时数据格式就是`NCHW`,这样下一个cpu device就能拿到正确的数据。
227227
在有普通的CPU layer时, `extOutVal_``extOutGrad_`的格式始终是`NCHW`或者`NC`
228228

229229
## References
230230
1. [MKL small library](https://github.com/01org/mkl-dnn#linking-your-application)[Intel MKL](https://software.intel.com/en-us/mkl)的一个子集。
231-
主要包括了深度学习相关的数学原语与操作,一般由MKL-DNN在发布[新版本](https://github.com/01org/mkl-dnn/releases)时一起更新。
231+
主要包括了深度学习相关的数学原语与操作,一般由MKL-DNN在发布[新版本](https://github.com/01org/mkl-dnn/releases)时一起更新。
232232
2. [MKL-DNN System Requirements](https://github.com/01org/mkl-dnn#system-requirements)
233233
目前在PaddlePaddle中,仅会在支持AVX2指令集及以上的机器才使用MKL-DNN。
234234
3. [原来的方案](https://github.com/PaddlePaddle/Paddle/pull/3096)会引入**nextLayer**的信息。
235-
但是在PaddlePaddle中,无论是重构前的layer还是重构后的op,都不会想要知道next layer/op的信息。
235+
但是在PaddlePaddle中,无论是重构前的layer还是重构后的op,都不会想要知道next layer/op的信息。
236236
4. MKL-DNN的高性能格式与PaddlePaddle原有的`NCHW`不同(PaddlePaddle中的cuDNN部分使用的也是`NCHW`,所以不存在这个问题)。
237-
所以需要引入一个转换方法,并且只需要在必要的时候转换这种格式,才能更好的发挥MKL-DNN的性能。
237+
所以需要引入一个转换方法,并且只需要在必要的时候转换这种格式,才能更好的发挥MKL-DNN的性能。

doc/v2/dev/new_layer_en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ If you are creating a new file for the test, such as :code:`paddle/legacy/gserve
339339
Implement Python Wrapper
340340
========================
341341

342-
Implementing Python wrapper allows us to use the added layer in configuration files. All the Python wrappers are in file :code:`python/paddle/trainer/config_parser.py`. An example of the Python wrapper for fully connected layer is listed below. It has the following steps:
342+
Implementing Python wrapper allows us to use the added layer in configuration files. All the Python wrappers are in file :code:`python/paddle/legacy/trainer/config_parser.py`. An example of the Python wrapper for fully connected layer is listed below. It has the following steps:
343343

344344
- Use :code:`@config_layer('fc')` at the decorator for all the Python wrapper class. :code:`fc` is the identifier of the layer.
345345
- Implements :code:`__init__` constructor function.

paddle/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if(NOT WITH_FLUID_ONLY)
22
add_subdirectory(legacy/cuda)
33
add_subdirectory(legacy/function)
4-
add_subdirectory(utils)
4+
add_subdirectory(legacy/utils)
55
add_subdirectory(legacy/math)
66
add_subdirectory(legacy/gserver)
77
add_subdirectory(legacy/parameter)
@@ -10,7 +10,7 @@ if(NOT WITH_FLUID_ONLY)
1010
add_subdirectory(legacy/capi)
1111
else()
1212
add_subdirectory(legacy/pserver)
13-
add_subdirectory(trainer)
13+
add_subdirectory(legacy/trainer)
1414
add_subdirectory(scripts)
1515

1616
if(WITH_C_API)

paddle/fluid/operators/positive_negative_pair_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ limitations under the License. */
1414
#include <vector>
1515
#include "paddle/fluid/framework/eigen.h"
1616
#include "paddle/fluid/framework/op_registry.h"
17-
#include "paddle/utils/Logging.h"
17+
#include "paddle/legacy/utils/Logging.h"
1818

1919
namespace paddle {
2020
namespace operators {

paddle/fluid/platform/float16_test.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License. */
1515

1616
#include "paddle/fluid/framework/lod_tensor.h"
1717
#include "paddle/fluid/framework/tensor_util.h"
18-
#include "paddle/utils/Logging.h"
18+
#include "paddle/legacy/utils/Logging.h"
1919

2020
#define ARITHMETIC_KERNEL(op_type, sign) \
2121
__global__ void op_type(const half* in1, const half* in2, half* out) { \

paddle/legacy/api/ConfigParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ limitations under the License. */
1414

1515
#include "PaddleAPI.h"
1616
#include "PaddleAPIPrivate.h"
17-
#include "paddle/trainer/Trainer.h"
17+
#include "paddle/legacy/trainer/Trainer.h"
1818

1919
struct ParameterConfigPrivate {
2020
paddle::ParameterPtr parameter;

paddle/legacy/api/Paddle.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,5 @@ namespace std {
198198
%ignore ParameterConfigPrivate;
199199
%ignore OptimizationConfigPrivate;
200200
%ignore ParameterTraverseCallbackPrivate;
201-
%include "utils/GlobalConstants.h"
201+
%include "legacy/utils/GlobalConstants.h"
202202
%include "legacy/api/PaddleAPI.h"

paddle/legacy/api/PaddleAPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ limitations under the License. */
2020
#include <string>
2121
#include <vector>
2222
#include "paddle/legacy/gserver/gradientmachines/GradientMachine.h"
23-
#include "paddle/utils/Common.h"
24-
#include "paddle/utils/GlobalConstants.h"
23+
#include "paddle/legacy/utils/Common.h"
24+
#include "paddle/legacy/utils/GlobalConstants.h"
2525

2626
/// Import PaddlePaddle's enumeration into global namespace.
2727
using namespace paddle::enumeration_wrapper; // NOLINT

0 commit comments

Comments
 (0)