Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update forked paddle repo #4

Merged
merged 91 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
e496640
fix bmm enforce equal batch (#27694)
yaoxuefeng6 Sep 30, 2020
a01bc6b
【paddle.fleet】fleet support non_distributed training in dygraph mode …
danleifeng Sep 30, 2020
7f9b198
Romove grid_sampler and refine example code (#27649)
LielinJiang Sep 30, 2020
488152a
[API 2.0]Update 2.0 api from fluid to paddle. (#27598)
jiweibo Sep 30, 2020
ab85a89
[Dy2stat] Add Resnet Test for V2 APIs (#27459)
zhhsplendid Sep 30, 2020
4d3eefb
Modify the docs for Transformer's APIs. test=document_fix (#27729)
xiemoyuan Sep 30, 2020
9b3ef59
add categorical class (#27695)
pangyoki Sep 30, 2020
a0f1dba
Add visualdl callback function (#27565)
LielinJiang Sep 30, 2020
69a3339
Move dygraph amp api to paddle-2.0 (#27681)
zhiqiu Sep 30, 2020
54c368d
[API 2.0: doc] fix doc of nonzero (#27685)
123malin Sep 30, 2020
9cd8648
Fix api for ErrorClipByValue, code demo of clip_by_norm. test=develop…
ysh329 Sep 30, 2020
7a96d57
Optimize the error messages of the CUDA implementation of activation …
hong19860320 Sep 30, 2020
0cd4907
Add avx512 core instructions check (#27732)
wozna Sep 30, 2020
966447e
Added support for quantization of fusion_gru (#27518)
Oct 1, 2020
b9fda2f
Fix to issue #25537 (#27546)
jczaja Oct 1, 2020
f399bed
Add an option to set number of warmup iterations (#27739)
Oct 1, 2020
a90711c
Add avx512 core instructions check 2 (#27750)
wozna Oct 1, 2020
9f3fb95
[Dy2stat] Add Simnet Test for V2 APIs (#27460)
zhhsplendid Oct 2, 2020
65207b4
Polish the error message of fc, fused_fc_elementwise_layernorm and fu…
Xreki Oct 4, 2020
de60c54
fix doc and example code of huber_loss and npair_loss (#27678)
huangjun12 Oct 8, 2020
7793fd2
add huber_loss to fix ci, test=develop (#27766)
huangjun12 Oct 8, 2020
7698e19
modify doc for paddle.nn.Layer (#27624)
wanghuancoder Oct 8, 2020
7ca66f1
modify Sequential doc, test=develop (#27608)
wanghuancoder Oct 8, 2020
aaa3ee6
modify doc for unique_name.guard unique_name.generate unique_name.swi…
wanghuancoder Oct 8, 2020
c826bcb
modify doc for ParameterList and LayerList (#27609)
wanghuancoder Oct 8, 2020
bcc3472
polish api code & example (#27696)
chenwhql Oct 9, 2020
6076d0a
modify doc for bilinear_tensor_product, test=develop (#27613)
wanghuancoder Oct 9, 2020
5345a58
update readme for 1.8.5,test=document_fix (#27764)
XieYunshen Oct 9, 2020
9089841
Fix bilateral inference shape bug (#26822)
LielinJiang Oct 9, 2020
b9c7c66
add type promotion (#27756)
LielinJiang Oct 9, 2020
d84eb9b
keep network mode unchange when use summary api (#27754)
LielinJiang Oct 9, 2020
365c2c9
fix error message showing in UpdateLossScalingOp (#27596)
wzzju Oct 9, 2020
994438b
change clip grad api, test=develop (#27767)
qili93 Oct 9, 2020
ec7d11a
refine fused_elemwise_activation error message (#27734)
juncaipeng Oct 9, 2020
7ecbc46
reimplement paddle.nn.functional.sigmoid_focal_loss (#27748)
FlyingQianMM Oct 9, 2020
6da552a
Update initializer examples of Bilinear (#27709)
Ray2020BD Oct 9, 2020
baddedf
fix ut test=develop (#27760)
gongweibao Oct 9, 2020
6c1acf3
Optimize the error message for OP (#27617)
xiemoyuan Oct 9, 2020
606611d
[oneDNN] GRU BF16 kernel (#27731)
jczaja Oct 9, 2020
057e28b
API(lstm_unit, lstmp, sequence_mask, sequence_enumerate, sequence_con…
smallv0221 Oct 9, 2020
395cb56
refine logsumexp error message and docs (#27713)
zhupengyang Oct 9, 2020
0a7bab4
fix error mesage for negative_positive_pair_op and nce_op (#27779)
Oct 9, 2020
061240b
remove beam_search and beam_search_decode api in paddle.nn (#27660)
FrostML Oct 9, 2020
631c1f3
- Fix to 27398 (#27770)
jczaja Oct 9, 2020
836ee3b
Polish the english documentation and example of paddle.nn.Linear and …
Xreki Oct 10, 2020
c52b6bb
add alias for RNN APIs from paddle.nn.layer.rnn explicitly (#27784)
Oct 10, 2020
b53970e
Fix cross, cumsum op docs test=document_fix
LutaoChu Oct 10, 2020
d3b98f0
Fix dynamic parallel train mode for hapi (#27787)
LielinJiang Oct 10, 2020
c4b1faa
modified sample code of add_position_encoding to use paddle.randn, te…
Oct 10, 2020
b8d2a02
fix ut error of test_recognize_digits, test=develop (#27791)
qili93 Oct 10, 2020
00d401e
Add api of constant in paddle.nn.initializer (#27786)
Ray2020BD Oct 10, 2020
0d27591
save operator version infomation to program desc, test=develop (#27668)
Shixiaowei02 Oct 10, 2020
f6ad237
fix pool3d bug, test=develop (#27718)
LDOUBLEV Oct 10, 2020
65c0614
disable_fuse_all_reduce (#27746)
zhiqiu Oct 10, 2020
5098891
add softmax xpu kernel (#27700)
zhupengyang Oct 10, 2020
0025e0d
refine APIs: brelu, hardsigmoid, hardswish, maxout (#27658)
zhupengyang Oct 10, 2020
bf187c7
Polish the documentation and examples of paddle.static.nn.fc. (#27768)
Xreki Oct 10, 2020
1bada98
Modify the output information of the shell script,test=document_fix (…
iducn Oct 10, 2020
c425cf1
[API 2.0]Update 2.0 api from fluid to paddle (#27802)
jiweibo Oct 10, 2020
ad99e63
add double grad op for matmul (#27776)
wangxinxin08 Oct 10, 2020
a2d08aa
update for windows compile. (#27813)
jiweibo Oct 11, 2020
74d3a55
Add Swish and ThresholdedReLU for API 2.0 (#27758)
hong19860320 Oct 11, 2020
9b49f02
Polish jit.save/load design & remove paddle.SaveLoadConfig (#27623)
chenwhql Oct 11, 2020
81d3992
Fix docker build error (#27735)
tianshuo78520a Oct 12, 2020
8fabb1c
Add test attribute in channelwise_quant op, test=develop (#27742)
juncaipeng Oct 12, 2020
0a1862d
fleet combine amp dgc recompute meta optimizer (#27643)
wangxicoding Oct 12, 2020
840d54d
add XPU support for shape op and reshape op (#27804)
mapingshuo Oct 12, 2020
4676f03
fix summary (#27820)
LielinJiang Oct 12, 2020
d4359b0
add the kunlun kernel for the paddle 2.0
joey12300 Oct 12, 2020
070ac95
Add double grad in Squeeze and Unsqueeze (#27810)
TeslaZhao Oct 12, 2020
f3e2580
Fix the param of swish (#27824)
hong19860320 Oct 12, 2020
b84d4ae
Fix bug of Model.save (#27815)
LiuChiachi Oct 12, 2020
659d04d
hsigmoid -> hsigmoid_loss/HSigmoidLoss; refine docs (#27745)
zhupengyang Oct 12, 2020
7779790
error message optimization in softmax_with_cross_entropy_op (#27772)
yghstill Oct 12, 2020
36bb056
Add flattern weight of lstm (#27192)
GaoWei8 Oct 12, 2020
16999ae
use IndexList to improve performance of instance_norm op (#25132)
zhangting2020 Oct 12, 2020
e8a5aef
update CUDAPlace doc. test=document_fix (#27711)
yongqiangma Oct 12, 2020
6335e6a
add musl option (#27798)
chen-zhiyu Oct 12, 2020
55e6376
[oneDNN] adaptive pool support (#27747)
jczaja Oct 12, 2020
2bcb7c0
Mutiply allows non-tensor data input (#27690)
Joejiong Oct 12, 2020
9005c5a
Lite subgraph support arm cpu. (#27827)
jiweibo Oct 12, 2020
e96fc6a
Fix/embedding doc (#27816)
seiriosPlus Oct 12, 2020
84d8e49
refine adam/strided_slice && fix doc for rmsprop/unstack (#27740)
MRXLT Oct 12, 2020
8fa4c09
add load_op_xpu for Baidu Kunlun (#27817)
wanghuancoder Oct 12, 2020
2e1bca9
Refine the gradient calculation errors caused by renaming in while_gr…
gfwm2013 Oct 12, 2020
e388e60
Refine cond API English Doc for 2.0RC (#27708)
zhhsplendid Oct 12, 2020
6cdf2c9
mig deformable_conv to deform_conv2d (#27841)
baiyfbupt Oct 12, 2020
445634f
polish Return doc of DataLoader (#27808)
heavengate Oct 12, 2020
bbc837e
add info log for trt input dynamic shape check (#27796)
shangzhizhou Oct 13, 2020
c5f2802
【paddle.fleet】Update fleetrun & ps-heter (#27472)
MrChengmo Oct 13, 2020
af57537
remove dy2static test_lac predictor run case (#27844)
OliverLPH Oct 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
option(WITH_CRYPTO "Compile PaddlePaddle with crypto support" ON)
option(WITH_ARM "Compile PaddlePaddle with arm support" OFF)
option(WITH_MUSL "Compile with musl libc instead of gblic" OFF)

# PY_VERSION
if(NOT PY_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pip install paddlepaddle
# Linux GPU cuda10cudnn7
pip install paddlepaddle-gpu
# Linux GPU cuda9cudnn7
pip install paddlepaddle-gpu==1.8.4.post97
pip install paddlepaddle-gpu==1.8.5.post97

```
It is recommended to read [this doc](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/install/index_en.html) on our website.
Expand Down
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pip install paddlepaddle
# Linux GPU cuda10cudnn7
pip install paddlepaddle-gpu
# Linux GPU cuda9cudnn7
pip install paddlepaddle-gpu==1.8.4.post97
pip install paddlepaddle-gpu==1.8.5.post97

```
更多安装信息详见官网 [安装说明](http://www.paddlepaddle.org.cn/documentation/docs/zh/1.8/beginners_guide/install/index_cn.html)
Expand Down
10 changes: 10 additions & 0 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ if(WIN32)
endif(NOT MSVC)
endif(WIN32)

if(WITH_MUSL)
add_definitions(-DPADDLE_WITH_MUSL)

message(STATUS, "Set compile option WITH_MKL=OFF when WITH_MUSL=ON")
SET(WITH_MKL OFF)

message(STATUS, "Set compile option WITH_GPU=OFF when WITH_MUSL=ON")
SET(WITH_GPU OFF)
endif()

if(WITH_PSLIB)
add_definitions(-DPADDLE_WITH_PSLIB)
endif()
Expand Down
92 changes: 68 additions & 24 deletions cmake/external/lite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if(NOT LINUX OR NOT WITH_MKL)
message("Paddle-lite will not build because the required Linux and MKL do not exist.")
if(NOT LINUX)
message("Paddle-lite will not build because the required Linux do not exist.")
set(WITH_LITE OFF)
return()
endif()
Expand Down Expand Up @@ -42,30 +42,30 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
endif()

# No quotes, so cmake can resolve it as a command with arguments.
set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j)
set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON
-DLITE_WITH_CUDA=${WITH_GPU}
-DWITH_MKLDNN=OFF
-DLITE_WITH_X86=ON
-DLITE_WITH_PROFILE=OFF
-DWITH_LITE=OFF
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF
-DWITH_PYTHON=OFF
-DWITH_TESTING=OFF
-DLITE_BUILD_EXTRA=ON
-DCUDNN_ROOT=${CUDNN_ROOT}
-DLITE_WITH_STATIC_CUDA=OFF
-DCUDA_ARCH_NAME=${CUDA_ARCH_NAME}
-DLITE_WITH_XPU=${LITE_WITH_XPU}
-DXPU_SDK_ROOT=${XPU_SDK_ROOT}
-DLITE_WITH_ARM=OFF)

ExternalProject_Add(
if(WITH_ARM)
set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j)
message(WARNING "BUILD_COMMAND: ${LITE_BUILD_COMMAND}")
set(LITE_OPTIONAL_ARGS -DWITH_MKL=OFF
-DLITE_WITH_CUDA=OFF
-DWITH_MKLDNN=OFF
-DLITE_WITH_X86=OFF
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON
-DLITE_WITH_PROFILE=OFF
-DARM_TARGET_OS=armlinux
-DWITH_LITE=ON
-DWITH_PYTHON=OFF
-DWITH_TESTING=OFF
-DLITE_BUILD_EXTRA=ON
-DLITE_WITH_XPU=${LITE_WITH_XPU}
-DXPU_SDK_ROOT=${XPU_SDK_ROOT}
-DLITE_WITH_ARM=ON)
ExternalProject_Add(
${LITE_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git"
GIT_TAG ${LITE_GIT_TAG}
PREFIX ${LITE_SOURCES_DIR}
PATCH_COMMAND mkdir -p ${LITE_SOURCES_DIR}/src/extern_lite-build/lite/gen_code && touch ${LITE_SOURCES_DIR}/src/extern_lite-build/lite/gen_code/__generated_code__.cc
UPDATE_COMMAND ""
BUILD_COMMAND ${LITE_BUILD_COMMAND}
INSTALL_COMMAND ""
Expand All @@ -81,7 +81,51 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
-DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
${EXTERNAL_OPTIONAL_ARGS}
${LITE_OPTIONAL_ARGS}
)
)
set(LITE_OUTPUT_BIN_DIR inference_lite_lib.armlinux.armv8)
else()
set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j)
set(LITE_OUTPUT_BIN_DIR inference_lite_lib)
set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON
-DLITE_WITH_CUDA=${WITH_GPU}
-DWITH_MKLDNN=OFF
-DLITE_WITH_X86=ON
-DLITE_WITH_PROFILE=OFF
-DWITH_LITE=OFF
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF
-DWITH_PYTHON=OFF
-DWITH_TESTING=OFF
-DLITE_BUILD_EXTRA=ON
-DCUDNN_ROOT=${CUDNN_ROOT}
-DLITE_WITH_STATIC_CUDA=OFF
-DCUDA_ARCH_NAME=${CUDA_ARCH_NAME}
-DLITE_WITH_XPU=${LITE_WITH_XPU}
-DXPU_SDK_ROOT=${XPU_SDK_ROOT}
-DLITE_WITH_ARM=OFF)

ExternalProject_Add(
${LITE_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git"
GIT_TAG ${LITE_GIT_TAG}
PREFIX ${LITE_SOURCES_DIR}
UPDATE_COMMAND ""
BUILD_COMMAND ${LITE_BUILD_COMMAND}
INSTALL_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_FLAGS=${LITE_CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
${EXTERNAL_OPTIONAL_ARGS}
${LITE_OPTIONAL_ARGS}
)
endif()
ExternalProject_Get_property(${LITE_PROJECT} BINARY_DIR)
ExternalProject_Get_property(${LITE_PROJECT} SOURCE_DIR)
set(LITE_BINARY_DIR ${BINARY_DIR})
Expand All @@ -103,8 +147,8 @@ function(external_lite_libs alias path)
endif()
endfunction()

external_lite_libs(lite_full_static ${LITE_BINARY_DIR}/inference_lite_lib/cxx/lib/libpaddle_full_api_shared.so)
set(LITE_SHARED_LIB ${LITE_BINARY_DIR}/inference_lite_lib/cxx/lib/libpaddle_full_api_shared.so)
external_lite_libs(lite_full_static ${LITE_BINARY_DIR}/${LITE_OUTPUT_BIN_DIR}/cxx/lib/libpaddle_full_api_shared.so)
set(LITE_SHARED_LIB ${LITE_BINARY_DIR}/${LITE_OUTPUT_BIN_DIR}/cxx/lib/libpaddle_full_api_shared.so)

add_definitions(-DPADDLE_WITH_LITE)
add_definitions(-DLITE_WITH_LOG)
2 changes: 1 addition & 1 deletion cmake/external/mkldnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SET(MKLDNN_SOURCE_DIR ${THIRD_PARTY_PATH}/mkldnn/src/extern_mkldnn)
SET(MKLDNN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mkldnn)
SET(MKLDNN_INC_DIR "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE)
SET(MKLDNN_REPOSITORY https://github.com/oneapi-src/oneDNN.git)
SET(MKLDNN_TAG 64a48f9565aa72f6359917b3406328075a409939)
SET(MKLDNN_TAG 361725600224f41b7347a1c6bee9b04d1e6c14d7)

# Introduce variables:
# * CMAKE_INSTALL_LIBDIR
Expand Down
2 changes: 1 addition & 1 deletion cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function(copy_part_of_thrid_party TARGET DST)
if (LITE_BINARY_DIR)
set(dst_dir "${DST}/third_party/install/lite")
copy(${TARGET}
SRCS ${LITE_BINARY_DIR}/inference_lite_lib/*
SRCS ${LITE_BINARY_DIR}/${LITE_OUTPUT_BIN_DIR}/*
DSTS ${dst_dir})
endif()
endfunction()
Expand Down
1 change: 1 addition & 0 deletions cmake/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ endif()

if(WIN32)
set(WIN_PROPS ${CMAKE_SOURCE_DIR}/cmake/paddle_win.props)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Os -DNDEBUG")
endif()

4 changes: 3 additions & 1 deletion paddle/fluid/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ cc_library(attribute SRCS attribute.cc DEPS framework_proto boost enforce)
cc_test(program_desc_test SRCS program_desc_test.cc DEPS proto_desc
device_context)

cc_library(op_version_registry SRCS op_version_registry.cc DEPS framework_proto boost)
cc_library(op_version_proto SRCS op_version_proto.cc DEPS framework_proto boost)

cc_library(op_version_registry SRCS op_version_registry.cc DEPS op_version_proto framework_proto boost)
cc_test(op_version_registry_test SRCS op_version_registry_test.cc DEPS op_version_registry)

cc_library(op_proto_maker SRCS op_proto_maker.cc DEPS framework_proto attribute glog)
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/data_layout_transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void innerTransDataLayoutFromMKLDNN(DataLayout in_layout, DataLayout out_layout,
// As MKL-DNN description was in NCHW and paddle is expecting NHWC
platform::MatchShapeToLayout(out, in_layout, out_layout);

out->set_layout(out_layout);
out->set_layout(DataLayout::kNCHW);
// reset format since the out tensor will be feed to non-MKLDNN OPkernel
out->set_format(MKLDNNMemoryFormat::undef);
}
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/data_transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ void SetTensorToVariable(const Variable &in_var, const Tensor &tensor,
auto *tran_lod_tensor = out_var->GetMutable<LoDTensor>();
tran_lod_tensor->set_lod(in_lod_tensor.lod());
tran_lod_tensor->set_layout(in_lod_tensor.layout());
#ifdef PADDLE_WITH_MKLDNN
tran_lod_tensor->set_format(in_lod_tensor.format());
#endif
tran_lod_tensor->ShareDataWith(tensor);
} else if (in_var.IsType<SelectedRows>()) {
auto &in_selected_rows = in_var.Get<SelectedRows>();
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/framework/distributed_strategy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ message AsyncConfig {
optional int32 send_wait_times = 7 [ default = 1 ];
optional bool runtime_split_send_recv = 8 [ default = false ];
optional bool launch_barrier = 9 [ default = true ];
optional string heter_worker_device_guard = 10 [ default = 'cpu' ];
}

message PipelineConfig { optional int32 micro_batch = 1 [ default = 1 ]; }
Expand Down
32 changes: 9 additions & 23 deletions paddle/fluid/framework/framework.proto
Original file line number Diff line number Diff line change
Expand Up @@ -179,29 +179,15 @@ message BlockDesc {
optional int32 forward_block_idx = 5 [ default = -1 ];
}

// CompatibleInfo is used to determine if a feature is compatible and
// provides the information.
message CompatibleInfo {
enum Type {
COMPATIBLE = 0;
DEFINITELY_NOT = 1;
POSSIBLE = 2;
BUG_FIX = 3;
PRECISION_CHANGE = 4;
}
required string version = 1;
required Type type = 2;
}

// In some cases, Paddle Fluid may perform operator definition iterations,
// and the operator uses OpCompatibleMap for compatibility testing.
message OpCompatibleMap {
message OpCompatiblePair {
// In some cases, Paddle may perform operator definition iterations,
// and the operator uses OpVersionMap for compatibility testing.
message OpVersion { required int32 version = 1; }
message OpVersionMap {
message OpVersionPair {
required string op_name = 1;
required CompatibleInfo compatible_info = 2;
required OpVersion op_version = 2;
}
repeated OpCompatiblePair pair = 1;
optional string default_required_version = 2;
repeated OpVersionPair pair = 1;
}

// Please refer to
Expand All @@ -210,8 +196,8 @@ message OpCompatibleMap {
// TODO(panyx0718): A model can have multiple programs. Need a
// way to distinguish them. Maybe ID or name?
message ProgramDesc {
reserved 2; // For backward compatibility.
reserved 2, 3; // For backward compatibility.
repeated BlockDesc blocks = 1;
optional Version version = 4;
optional OpCompatibleMap op_compatible_map = 3;
optional OpVersionMap op_version_map = 5;
}
26 changes: 22 additions & 4 deletions paddle/fluid/framework/ir/graph_pattern_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1882,9 +1882,9 @@ PDNode *patterns::MultipleQuantize::operator()() {
PDNode *patterns::QuantizePlacement::operator()(
const std::unordered_set<std::string> &quantize_enabled_op_types) {
std::unordered_set<std::string> supported_op_types =
std::unordered_set<std::string>({"concat", "conv2d", "elementwise_add",
"fc", "matmul", "pool2d", "prior_box",
"relu", "reshape2", "transpose2"});
std::unordered_set<std::string>(
{"concat", "conv2d", "elementwise_add", "fc", "matmul", "pool2d",
"prior_box", "relu", "reshape2", "transpose2", "fusion_gru"});
if (!quantize_enabled_op_types.empty()) {
supported_op_types = quantize_enabled_op_types;
}
Expand All @@ -1894,7 +1894,8 @@ PDNode *patterns::QuantizePlacement::operator()(

PDNode *patterns::Bfloat16Placement::operator()(
const std::unordered_set<std::string> &bfloat16_enabled_op_types) {
std::unordered_set<std::string> supported_op_types{"conv2d"};
std::unordered_set<std::string> supported_op_types =
std::unordered_set<std::string>({"conv2d", "fusion_gru"});
if (!bfloat16_enabled_op_types.empty()) {
supported_op_types = bfloat16_enabled_op_types;
}
Expand Down Expand Up @@ -2280,6 +2281,23 @@ PDNode *patterns::MatmulTransposeReshapePattern::operator()() {
return reshape_out;
}

PDNode *patterns::FusionGru::operator()() {
auto op = pattern->NewNode(op_repr())->assert_is_op("fusion_gru");
auto x = pattern->NewNode(x_repr())->AsInput()->assert_is_op_input(
"fusion_gru", "X");
auto weight_h = pattern->NewNode(weight_h_repr())
->AsInput()
->assert_is_op_input("fusion_gru", "WeightH");
auto weight_x = pattern->NewNode(weight_x_repr())
->AsInput()
->assert_is_op_input("fusion_gru", "WeightX");
auto out = pattern->NewNode(out_repr())
->AsOutput()
->assert_is_op_output("fusion_gru", "Hidden");
op->LinksFrom({x, weight_h, weight_x}).LinksTo({out});
return out;
}

} // namespace ir
} // namespace framework
} // namespace paddle
15 changes: 15 additions & 0 deletions paddle/fluid/framework/ir/graph_pattern_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,21 @@ struct MatmulTransposeReshapePattern : public PatternBase {
PATTERN_DECL_NODE(reshape_out_xshape);
};

// fusion_gru op
// Forward pass for fusion_gru.
// fusion_gru out is a result of the operator.
struct FusionGru : public PatternBase {
FusionGru(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "fusion_gru") {}

PDNode* operator()();
PATTERN_DECL_NODE(op);
PATTERN_DECL_NODE(x);
PATTERN_DECL_NODE(weight_h);
PATTERN_DECL_NODE(weight_x);
PATTERN_DECL_NODE(out);
};

} // namespace patterns

// Link two ir::Nodes from each other.
Expand Down
Loading