Skip to content

Commit a123c16

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into sampler
2 parents 32b7711 + 4f93331 commit a123c16

File tree

1,341 files changed

+43975
-21433
lines changed

Some content is hidden

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

1,341 files changed

+43975
-21433
lines changed

.copyright.hook

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
from __future__ import absolute_import
2+
from __future__ import print_function
3+
from __future__ import unicode_literals
4+
5+
import argparse
6+
import io, re
7+
import sys, os
8+
import subprocess
9+
import platform
10+
11+
COPYRIGHT = '''
12+
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
13+
14+
Licensed under the Apache License, Version 2.0 (the "License");
15+
you may not use this file except in compliance with the License.
16+
You may obtain a copy of the License at
17+
18+
http://www.apache.org/licenses/LICENSE-2.0
19+
20+
Unless required by applicable law or agreed to in writing, software
21+
distributed under the License is distributed on an "AS IS" BASIS,
22+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
See the License for the specific language governing permissions and
24+
limitations under the License.
25+
'''
26+
27+
LANG_COMMENT_MARK = None
28+
29+
NEW_LINE_MARK = None
30+
31+
COPYRIGHT_HEADER = None
32+
33+
if platform.system() == "Windows":
34+
NEW_LINE_MARK = "\r\n"
35+
else:
36+
NEW_LINE_MARK = '\n'
37+
COPYRIGHT_HEADER = COPYRIGHT.split(NEW_LINE_MARK)[1]
38+
p = re.search('(\d{4})', COPYRIGHT_HEADER).group(0)
39+
process = subprocess.Popen(["date", "+%Y"], stdout=subprocess.PIPE)
40+
date, err = process.communicate()
41+
date = date.decode("utf-8").rstrip("\n")
42+
COPYRIGHT_HEADER = COPYRIGHT_HEADER.replace(p, date)
43+
44+
45+
def generate_copyright(template, lang='C'):
46+
if lang == 'Python':
47+
LANG_COMMENT_MARK = '#'
48+
else:
49+
LANG_COMMENT_MARK = "//"
50+
51+
lines = template.split(NEW_LINE_MARK)
52+
ans = LANG_COMMENT_MARK + " " + COPYRIGHT_HEADER + NEW_LINE_MARK
53+
for lino, line in enumerate(lines):
54+
if lino == 0 or lino == 1 or lino == len(lines) - 1: continue
55+
ans += LANG_COMMENT_MARK + " " + line + NEW_LINE_MARK
56+
57+
return ans + "\n"
58+
59+
60+
def lang_type(filename):
61+
if filename.endswith(".py"):
62+
return "Python"
63+
elif filename.endswith(".h"):
64+
return "C"
65+
elif filename.endswith(".hpp"):
66+
return "C"
67+
elif filename.endswith(".cc"):
68+
return "C"
69+
elif filename.endswith(".cpp"):
70+
return "C"
71+
elif filename.endswith(".cu"):
72+
return "C"
73+
elif filename.endswith(".cuh"):
74+
return "C"
75+
elif filename.endswith(".go"):
76+
return "C"
77+
elif filename.endswith(".proto"):
78+
return "C"
79+
else:
80+
print("Unsupported filetype %s", filename)
81+
exit(0)
82+
83+
84+
PYTHON_ENCODE = re.compile("^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)")
85+
86+
87+
def main(argv=None):
88+
parser = argparse.ArgumentParser(
89+
description='Checker for copyright declaration.')
90+
parser.add_argument('filenames', nargs='*', help='Filenames to check')
91+
args = parser.parse_args(argv)
92+
93+
retv = 0
94+
for filename in args.filenames:
95+
fd = io.open(filename)
96+
first_line = fd.readline()
97+
if "COPYRIGHT" in first_line.upper(): continue
98+
if filename.endswith(".py"):
99+
second_line = fd.readline()
100+
if first_line.startswith("#!") or PYTHON_ENCODE.match(
101+
second_line) != None or PYTHON_ENCODE.match(
102+
first_line) != None:
103+
continue
104+
original_contents = io.open(filename).read()
105+
new_contents = generate_copyright(
106+
COPYRIGHT, lang_type(filename)) + original_contents
107+
print('Auto Insert Copyright Header {}'.format(filename))
108+
retv = 1
109+
with io.open(filename, 'w') as output_file:
110+
output_file.write(new_contents)
111+
112+
return retv
113+
114+
115+
if __name__ == '__main__':
116+
exit(main())

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@
3131
- id: go-fmt
3232
types:
3333
- go
34+
- repo: local
35+
hooks:
36+
- id: copyright_checker
37+
name: copyright_checker
38+
entry: python ./.copyright.hook
39+
language: system
40+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
41+
exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ cmake_minimum_required(VERSION 3.0)
1616
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1717
set(PADDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
1818
set(PADDLE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
19-
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
20-
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
2119

2220
include(system)
2321

2422
project(paddle CXX C Go)
23+
message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
24+
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
25+
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
26+
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
2527

2628
find_package(Sphinx)
2729
if(NOT CMAKE_CROSSCOMPILING)
@@ -199,6 +201,10 @@ if(WITH_GOLANG)
199201
endif(WITH_GOLANG)
200202

201203
set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")
204+
205+
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
206+
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
207+
202208
add_subdirectory(paddle)
203209
if(WITH_PYTHON)
204210
add_subdirectory(python)

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CODE_OF_CONDUCT_cn.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 参与者公约
2+
3+
## 我们的保证
4+
5+
为了促进一个开放透明且友好的环境,我们作为贡献者和维护者保证:无论年龄、种族、民族、性别认同和表达(方式)、体型、身体健全与否、经验水平、国籍、个人表现、宗教或性别取向,参与者在我们项目和社区中都免于骚扰。
6+
7+
## 我们的标准
8+
9+
有助于创造正面环境的行为包括但不限于:
10+
* 使用友好和包容性语言
11+
* 尊重不同的观点和经历
12+
* 耐心地接受建设性批评
13+
* 关注对社区最有利的事情
14+
* 友善对待其他社区成员
15+
16+
身为参与者不能接受的行为包括但不限于:
17+
* 使用与性有关的言语或是图像,以及不受欢迎的性骚扰
18+
* 捣乱/煽动/造谣的行为或进行侮辱/贬损的评论,人身攻击及政治攻击
19+
* 公开或私下的骚扰
20+
* 未经许可地发布他人的个人资料,例如住址或是电子地址
21+
* 其他可以被合理地认定为不恰当或者违反职业操守的行为
22+
23+
## 我们的责任
24+
25+
项目维护者有责任为「可接受的行为」标准做出诠释,以及对已发生的不被接受的行为采取恰当且公平的纠正措施。
26+
27+
项目维护者有权利及责任去删除、编辑、拒绝与本行为标准有所违背的评论(comments)、提交(commits)、代码、wiki 编辑、问题(issues)和其他贡献,以及项目维护者可暂时或永久性的禁止任何他们认为有不适当、威胁、冒犯、有害行为的贡献者。
28+
29+
## 使用范围
30+
31+
当一个人代表该项目或是其社区时,本行为标准适用于其项目平台和公共平台。
32+
33+
代表项目或是社区的情况,举例来说包括使用官方项目的电子邮件地址、通过官方的社区媒体账号发布或线上或线下事件中担任指定代表。
34+
35+
该项目的呈现方式可由其项目维护者进行进一步的定义及解释。
36+
37+
## 强制执行
38+
39+
可以通过[email protected],来联系项目团队来举报滥用、骚扰或其他不被接受的行为。
40+
41+
任何维护团队认为有必要且适合的所有投诉都将进行审查及调查,并做出相对应的回应。项目小组有对事件回报者有保密的义务。具体执行的方针近一步细节可能会单独公布。
42+
43+
没有切实地遵守或是执行本行为标准的项目维护人员,可能会因项目领导人或是其他成员的决定,暂时或是永久地取消其参与资格。
44+
45+
## 来源
46+
47+
本行为标准改编自[贡献者公约][主页],版本 1.4
48+
可在此观看https://www.contributor-covenant.org/zh-cn/version/1/4/code-of-conduct.html
49+
50+
[主页]: https://www.contributor-covenant.org

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33

44
[![Build Status](https://travis-ci.org/PaddlePaddle/Paddle.svg?branch=develop)](https://travis-ci.org/PaddlePaddle/Paddle)
5-
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](http://doc.paddlepaddle.org/develop/doc/)
6-
[![Documentation Status](https://img.shields.io/badge/中文文档-最新-brightgreen.svg)](http://doc.paddlepaddle.org/develop/doc_cn/)
5+
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/index_en.html)
6+
[![Documentation Status](https://img.shields.io/badge/中文文档-最新-brightgreen.svg)](http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html)
77
[![Coverage Status](https://coveralls.io/repos/github/PaddlePaddle/Paddle/badge.svg?branch=develop)](https://coveralls.io/github/PaddlePaddle/Paddle?branch=develop)
88
[![Release](https://img.shields.io/github/release/PaddlePaddle/Paddle.svg)](https://github.com/PaddlePaddle/Paddle/releases)
99
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)
@@ -36,7 +36,8 @@ Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddl
3636
examples:
3737

3838
- Optimized math operations through SSE/AVX intrinsics, BLAS libraries
39-
(e.g. MKL, ATLAS, cuBLAS) or customized CPU/GPU kernels.
39+
(e.g. MKL, OpenBLAS, cuBLAS) or customized CPU/GPU kernels.
40+
- Optimized CNN networks through MKL-DNN library.
4041
- Highly optimized recurrent networks which can handle **variable-length**
4142
sequence without padding.
4243
- Optimized local and distributed training for models with high dimensional
@@ -61,32 +62,32 @@ Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddl
6162
## Installation
6263

6364
It is recommended to check out the
64-
[Docker installation guide](http://doc.paddlepaddle.org/develop/doc/getstarted/build_and_install/docker_install_en.html)
65+
[Docker installation guide](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/build_and_install/docker_install_en.html)
6566
before looking into the
66-
[build from source guide](http://doc.paddlepaddle.org/develop/doc/getstarted/build_and_install/build_from_source_en.html).
67+
[build from source guide](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/build_and_install/build_from_source_en.html).
6768

6869
## Documentation
6970

70-
We provide [English](http://doc.paddlepaddle.org/develop/doc/) and
71-
[Chinese](http://doc.paddlepaddle.org/doc_cn/) documentation.
71+
We provide [English](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/index_en.html) and
72+
[Chinese](http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html) documentation.
7273

73-
- [Deep Learning 101](http://book.paddlepaddle.org/index.html)
74+
- [Deep Learning 101](http://www.paddlepaddle.org/docs/develop/book/01.fit_a_line/index.html)
7475

7576
You might want to start from this online interactive book that can run in a Jupyter Notebook.
7677

77-
- [Distributed Training](http://doc.paddlepaddle.org/develop/doc/howto/usage/cluster/cluster_train_en.html)
78+
- [Distributed Training](http://www.paddlepaddle.org/docs/develop/documentation/en/howto/usage/cluster/cluster_train_en.html)
7879

7980
You can run distributed training jobs on MPI clusters.
8081

81-
- [Distributed Training on Kubernetes](http://doc.paddlepaddle.org/develop/doc/howto/usage/k8s/k8s_en.html)
82+
- [Distributed Training on Kubernetes](http://www.paddlepaddle.org/docs/develop/documentation/en/howto/usage/cluster/k8s_en.html)
8283

8384
You can also run distributed training jobs on Kubernetes clusters.
8485

85-
- [Python API](http://doc.paddlepaddle.org/develop/doc/api/index_en.html)
86+
- [Python API](http://www.paddlepaddle.org/docs/develop/documentation/en/api/index_en.html)
8687

8788
Our new API enables much shorter programs.
8889

89-
- [How to Contribute](http://doc.paddlepaddle.org/develop/doc/howto/dev/contribute_to_paddle_en.html)
90+
- [How to Contribute](http://www.paddlepaddle.org/docs/develop/documentation/en/howto/dev/contribute_to_paddle_en.html)
9091

9192
We appreciate your contributions!
9293

RELEASE.cn.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
# v0.11.0版本
2+
3+
## PaddlePaddle Fluid
4+
5+
- PaddlePaddle发布版本v0.11.0包含一个新的特性*PaddlePaddle Fluid*. Fluid 是设计用来让用户像Pytorch和Tensorflow Eager Execution一样执行程序。在这些系统中,不再有*模型*这个概念,应用也不再包含一个用于描述Operator图或者一系列层的符号描述,而是像通用程序那样描述训练或者预测的过程。而Fluid与PyTorch或Eager Execution的区别在于Fluid不依赖Python提供的控制流,例如 if-else-then或者for,而是提供了基于C++实现的控制流并暴露了对应的用with语法实现的Python接口。例如:
6+
7+
https://github.com/PaddlePaddle/Paddle/blob/3df78ed2a98d37f7ae6725894cc7514effd5664b/python/paddle/v2/fluid/tests/test_while_op.py#L36-L44
8+
9+
- 在v0.11.0版本中,我们提供了一个C++类`Executor`用于运行一个Fluid程序。Executor类似一个解释器。在未来的版本中,我们将提升和优化Executor成为一个调试器,就像GDB。并可能提供一些编译器,这个编译器会读取一个上文所描述的应用然后编译成一个等价的
10+
源代码,这个源代码可以被nvcc编译成可以使用CUDA的二进制,或者被icc编译成可以充分利用Intel CPU的二进制。
11+
12+
13+
## 新特点
14+
15+
* 发布 `PaddlePaddle Fluid`
16+
* 增加了用于模型预测的C-API。
17+
* 用Fluid API实现了一个简单的GAN的例子。
18+
* 增加了关于性能调优的文档。
19+
*`paddle.v2.dataset`下载数据集提供了重试机制.
20+
* C++中使用protobuf-lite替换protobuf减少了二进制的大小。
21+
* 发布了新特性 [Elastic Deep Learning (EDL)](https://github.com/PaddlePaddle/cloud/tree/develop/doc/autoscale/experiment).
22+
* 基于Bazel API利用cmake实现了一个的新的构建系统函数库。
23+
* 当使用编译选项`WITH_MKL=ON`时自动下载和编译Intel® [MKLML](https://github.com/01org/mkl-dnn/releases/download/v0.11/mklml_lnx_2018.0.1.20171007.tgz) 函数库.
24+
* [Intel® MKL-DNN on PaddlePaddle](https://github.com/PaddlePaddle/Paddle/tree/develop/doc/design/mkldnn):
25+
- 完成了 11个 MKL-DNN 层: Convolution, Fully connectivity, Pooling, ReLU, Tanh, ELU, Softmax, BatchNorm, AddTo, Concat, LRN。
26+
- 完成了 3个 MKL-DNN 网络: VGG-19, ResNet-50, GoogleNet
27+
- 基于Intel Skylake 6148 CPU的[性能测试](https://github.com/PaddlePaddle/Paddle/blob/develop/benchmark/IntelOptimizedPaddle.md) : 相对于MKLML有2~3倍的训练加速。
28+
* 增加 [softsign activation](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/activation.html#softsign)
29+
* 增加 [dot product layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#dot-prod)
30+
* 增加 [L2 distance layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#l2-distance)
31+
* 增加 [sub-nested sequence layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#sub-nested-seq)
32+
* 增加 [kmax sequence score layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#kmax-sequence-score)
33+
* 增加 [sequence slice layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#seq-slice)
34+
* 增加 [row convolution layer](http://www.paddlepaddle.org/docs/develop/documentation/zh/api/v2/config/layer.html#row-conv)
35+
* 增加移动端友好的网页
36+
37+
## 改进
38+
39+
* 使用一个Python`whl`包即可安装.
40+
* [V2 API可以实现用户定制化评估](https://github.com/PaddlePaddle/models/tree/develop/ltr#训练过程中输出自定义评估指标)
41+
*`PADDLE_ONLY_CPU` 改为 `PADDLE_WITH_GPU`, 因为我们会支持多种设备。
42+
* 删除了有一些bug的BarrierStat。
43+
* 清理和删除了paddle::Parameter中未使用的函数。
44+
* 删除了ProtoDataProvider。
45+
* Huber loss同时支持回归和分类。
46+
* 为sequence pooling 层增加`stride`参数。
47+
* v2 API自动使用cudnn batch normalization。
48+
* 可以使用一个固定的参数名共享BN层的参数。
49+
* 2D convolution operation支持variable-dimension input特性。
50+
* 重构cmake中关于CUDA的部分并实现自动检测GPU架构的功能。
51+
* 优化网页导航。
52+
53+
## 错误修复
54+
55+
* 修复ROI pooling的Bug. cc9a761
56+
* 修复当label是dense vector是AUC变成0的问题. #5274
57+
* 修复WarpCTC 层的Bug.
58+
59+
160
# v0.10.0版本
261

362
我们非常高兴发布了PaddlePaddle V0.10.0版,并开发了新的[Python API](http://research.baidu.com/paddlepaddles-new-api-simplifies-deep-learning-programs/)

0 commit comments

Comments
 (0)