Skip to content

Commit 05a96db

Browse files
authored
Merge branch 'develop' into feature/matmul_support_float16_double
2 parents 66590a0 + 5ce2df9 commit 05a96db

File tree

216 files changed

+677
-869
lines changed

Some content is hidden

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

216 files changed

+677
-869
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddl
6262
## Installation
6363

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

6969
## Documentation
7070

cmake/external/mkldnn.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ IF(${CBLAS_PROVIDER} STREQUAL "MKLML")
4545
ELSE()
4646
MESSAGE(FATAL_ERROR "Should enable MKLML when build MKLDNN")
4747
ENDIF()
48-
49-
SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} -Wno-error=strict-overflow")
50-
SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} -Wno-error=strict-overflow")
48+
SET(MKLDNN_FLAG "-Wno-error=strict-overflow -Wno-error=unused-result -Wno-unused-result")
49+
SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} ${MKLDNN_FLAG}")
50+
SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} ${MKLDNN_FLAG}")
5151
ExternalProject_Add(
5252
${MKLDNN_PROJECT}
5353
${EXTERNAL_PROJECT_LOG_ARGS}
@@ -61,6 +61,7 @@ ExternalProject_Add(
6161
CMAKE_ARGS -DMKLROOT=${MKLML_ROOT}
6262
CMAKE_ARGS -DCMAKE_C_FLAGS=${MKLDNN_CFLAG}
6363
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${MKLDNN_CXXFLAG}
64+
CMAKE_ARGS -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF
6465
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${MKLDNN_INSTALL_DIR}
6566
-DMKLROOT:PATH=${MKLML_ROOT}
6667
)

cmake/external/mklml.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ENDIF()
2727
INCLUDE(ExternalProject)
2828

2929
SET(MKLML_PROJECT "extern_mklml")
30-
SET(MKLML_VER "mklml_lnx_2018.0.1.20171007")
30+
SET(MKLML_VER "mklml_lnx_2018.0.3.20180406")
3131
SET(MKLML_URL "http://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.tgz")
3232
SET(MKLML_SOURCE_DIR "${THIRD_PARTY_PATH}/mklml")
3333
SET(MKLML_DOWNLOAD_DIR "${MKLML_SOURCE_DIR}/src/${MKLML_PROJECT}")

doc/fluid/design/concepts/lod_tensor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ into offsets
155155
3 2+3 4+5 1+9 2+10 3+12
156156
```
157157

158-
so we know that the first sentence is from word 0 to word 3, and the second sentence from work 3 to word 5.
158+
so we know that the first sentence is from word 0 to word 3, and the second sentence from word 3 to word 5.
159159

160160
Similarly, the lengths in the top level LoD
161161

paddle/fluid/framework/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cc_library(data_transform SRCS data_transform.cc DEPS math_function tensor
5757
cc_library(attribute SRCS attribute.cc DEPS framework_proto boost)
5858
cc_test(program_desc_test SRCS program_desc_test.cc DEPS proto_desc
5959
device_context)
60-
cc_library(op_proto_maker SRCS op_proto_maker.cc DEPS framework_proto attribute)
60+
cc_library(op_proto_maker SRCS op_proto_maker.cc DEPS framework_proto attribute glog)
6161
cc_test(op_proto_maker_test SRCS op_proto_maker_test.cc DEPS op_proto_maker)
6262
cc_library(op_info SRCS op_info.cc DEPS attribute framework_proto)
6363
cc_library(shape_inference SRCS shape_inference.cc DEPS ddim attribute device_context)

paddle/fluid/framework/data_device_transform_test.cu

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ struct AddFunctor {
3232

3333
class OpKernelTestProtoAndCheckerMaker : public OpProtoAndCheckerMaker {
3434
public:
35-
OpKernelTestProtoAndCheckerMaker(OpProto* proto, OpAttrChecker* op_checker)
36-
: OpProtoAndCheckerMaker(proto, op_checker) {
35+
void Make() {
3736
AddInput("input", "input1 of test op");
3837
AddOutput("output", "output of test op");
3938
AddAttr<bool>("use_gpu", "force to use gpu kernel").SetDefault(false);

paddle/fluid/framework/details/computation_op_handle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ComputationOpHandle : public OpHandleBase {
3636
protected:
3737
void RunImpl() override;
3838

39-
virtual bool NeedWait(VarHandleBase *in_var);
39+
bool NeedWait(VarHandleBase *in_var) override;
4040

4141
private:
4242
std::unique_ptr<OperatorBase> op_;

paddle/fluid/framework/details/fetch_op_handle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct FetchOpHandle : public OpHandleBase {
4242
protected:
4343
void RunImpl() override;
4444

45-
virtual void WaitInputVarGenerated(const platform::Place &place);
45+
void WaitInputVarGenerated(const platform::Place &place) override;
4646

4747
private:
4848
FeedFetchList *data_;

paddle/fluid/framework/details/op_registry.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ struct OpInfoFiller<T, kOpProtoAndCheckerMaker> {
9595
void operator()(const char* op_type, OpInfo* info) const {
9696
info->proto_ = new proto::OpProto;
9797
info->checker_ = new OpAttrChecker();
98-
auto maker = T(info->proto_, info->checker_);
98+
T maker;
99+
maker.SetProto(info->proto_);
100+
maker.SetChecker(info->checker_);
101+
maker.Make();
99102
maker.Validate();
100103
info->proto_->set_type(op_type);
101104
PADDLE_ENFORCE(

paddle/fluid/framework/op_proto_maker.h

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,78 +14,72 @@ limitations under the License. */
1414
#pragma once
1515

1616
#include <string>
17+
#include "glog/logging.h"
1718
#include "paddle/fluid/framework/attribute.h"
1819
#include "paddle/fluid/framework/framework.pb.h"
19-
2020
namespace paddle {
2121
namespace framework {
2222

2323
// this class not only make proto but also init attribute checkers.
2424
class OpProtoAndCheckerMaker {
2525
public:
26-
using OpProto = proto::OpProto;
27-
using OpAttrChecker = framework::OpAttrChecker;
28-
OpProtoAndCheckerMaker(OpProto* proto, OpAttrChecker* op_checker)
29-
: proto_(proto), op_checker_(op_checker) {}
26+
virtual void Make() = 0;
3027

3128
virtual ~OpProtoAndCheckerMaker() {
32-
PADDLE_ENFORCE(validated_, "should call Validate after build");
29+
CHECK(validated_) << "should call Validate after build";
3330
}
3431

32+
void SetProto(proto::OpProto *proto) { proto_ = proto; }
33+
34+
void SetChecker(OpAttrChecker *attr_checker) { op_checker_ = attr_checker; }
35+
3536
void Validate();
3637

3738
protected:
3839
struct VariableBuilder {
39-
OpProto::Var* var_;
40+
proto::OpProto::Var *var_;
4041

41-
VariableBuilder& AsDuplicable() {
42+
VariableBuilder &AsDuplicable() {
4243
var_->set_duplicable(true);
4344
return *this;
4445
}
4546

46-
VariableBuilder& AsIntermediate() {
47+
VariableBuilder &AsIntermediate() {
4748
var_->set_intermediate(true);
4849
return *this;
4950
}
5051

51-
VariableBuilder& AsDispensable() {
52+
VariableBuilder &AsDispensable() {
5253
var_->set_dispensable(true);
5354
return *this;
5455
}
5556
};
5657

57-
VariableBuilder AddInput(const std::string& name, const std::string& comment);
58+
VariableBuilder AddInput(const std::string &name, const std::string &comment);
5859

59-
VariableBuilder AddOutput(const std::string& name,
60-
const std::string& comment);
60+
VariableBuilder AddOutput(const std::string &name,
61+
const std::string &comment);
6162

6263
template <typename T>
63-
TypedAttrChecker<T>& AddAttr(const std::string& name,
64-
const std::string& comment,
64+
TypedAttrChecker<T> &AddAttr(const std::string &name,
65+
const std::string &comment,
6566
bool generated = false) {
66-
auto* attr = proto_->add_attrs();
67+
auto *attr = proto_->add_attrs();
6768
attr->set_name(name);
6869
attr->set_comment(comment);
6970
attr->set_generated(generated);
7071
attr->set_type(AttrTypeID<T>());
7172
return op_checker_->AddAttrChecker<T>(name);
7273
}
7374

74-
void AddComment(const std::string& comment) { proto_->set_comment(comment); }
75+
void AddComment(const std::string &comment) { proto_->set_comment(comment); }
7576

7677
private:
7778
void CheckNoDuplicatedInOutAttrs();
7879

79-
OpProto* proto_;
80-
OpAttrChecker* op_checker_;
80+
proto::OpProto *proto_;
81+
OpAttrChecker *op_checker_;
8182
bool validated_{false};
8283
};
83-
84-
class NOPMaker : public OpProtoAndCheckerMaker {
85-
public:
86-
NOPMaker(OpProto* proto, framework::OpAttrChecker* op_checker)
87-
: OpProtoAndCheckerMaker(proto, op_checker) {}
88-
};
89-
9084
} // namespace framework
9185
} // namespace paddle

0 commit comments

Comments
 (0)