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

[WIP] For printing more logs 6148 CI failures #21802

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
bc6372e
For printing more logs in issue 21594
lidanqing-intel Dec 17, 2019
ddc6b88
add dmesg to generate memory info
lidanqing-intel Dec 18, 2019
d97e28f
move position of dmesg
lidanqing-intel Dec 19, 2019
28a1e21
only leave one test
lidanqing-intel Dec 19, 2019
2745075
one test failed in printing memory status
lidanqing-intel Dec 19, 2019
821b910
check the docker status
lidanqing-intel Dec 20, 2019
5248a88
Merge branch 'develop' into log-ci-failures
lidanqing-intel Dec 20, 2019
bee812d
change qat_performance with mobilenet, change batch_size of qat2_resn…
lidanqing-intel Dec 21, 2019
c134ef8
check 5117 docker memory
lidanqing-intel Dec 23, 2019
abb8fd1
Merge branch 'develop' into log-ci-failures
lidanqing-intel Dec 26, 2019
911e4c7
Fix the bug in sequence_scatter unitest (#21960)
xyzhou-puck Dec 27, 2019
4bb8df9
check api approveals (#21964)
tianshuo78520a Dec 27, 2019
0347946
fix multi-thread error of fc_gru_fuse_pass.cc, test=develop (#21841)
Shixiaowei02 Dec 27, 2019
c3e1954
make reverse op support negative axis (#21925)
mapingshuo Dec 27, 2019
dca0758
remove params in Tracer object (in dygraph) (#20815)
JepsonWong Dec 27, 2019
cee2ccb
add shuffle batch op (#21674)
wilhelmzh Dec 27, 2019
ba51043
remove parameter block in to_variable, test=develop (#21933)
zhiqiu Dec 27, 2019
fd9b00d
test=develop, remove unused variable (#21974)
silingtong123 Dec 27, 2019
8859ddd
Refine multihead kernel, align block to 32 (#21961)
zhaoyuchen2018 Dec 27, 2019
196e20d
Fix multi-threads memory out of bounds error for passes (#21920)
FrostML Dec 29, 2019
362bfec
add xly py35 dockerfile (#21861)
tianshuo78520a Dec 30, 2019
e0d8b8f
use large input size in test_add_position_encoding_op.py (#21962)
lfchener Dec 30, 2019
b7697f6
fix broadcast bug;test=develop (#21898)
danleifeng Dec 30, 2019
c15d420
fix no grad check for pool_max & spectral_norm (#21971)
heavengate Dec 30, 2019
f4013ec
enable kldiv_loss_op unittests (#21990)
heavengate Dec 30, 2019
cf7b325
fix conv2d_transpose op unittest (#21927)
FDInSky Dec 30, 2019
fa8bab9
add fp64 check_grad for conv2d, conv3d (#21931)
FDInSky Dec 30, 2019
c3527f5
Annotate NormOP test to skip grad check (#21894)
willthefrog Dec 30, 2019
e66f92d
Modify demo_ci to support Windows, prepare for PR_Windows_Inference (…
zhwesky2010 Dec 30, 2019
fbb4217
fix no hint problem when use ENFORCE for cuda, test=develop (#21994)
chenwhql Dec 30, 2019
35ff156
Add error message for cublas inItizalize failed (#21995)
chenwhql Dec 30, 2019
64baee4
polish code test=develop (#22014)
wangchaochaohu Dec 31, 2019
33f1306
update layers used in mnist dygraph model, test=develop (#21947)
zhiqiu Dec 31, 2019
911eef4
enhance checking validity of apply_gradient (#21870)
Aurelius84 Dec 31, 2019
86c40e2
Expose fluid.dygraph.TracedLayer API (#21518)
sneaxiy Dec 31, 2019
a0b5337
increase data shape in topk_avg_pooling unittest (#22010)
Aurelius84 Dec 31, 2019
3ec289a
fix sync_batch_norm hang in fleet (#21838)
wangxicoding Dec 31, 2019
b68f4e0
Fix the doc of scatter_nd (#22015)
ForFishes Dec 31, 2019
34e26c9
remove @unittest.skip in test_parallel_executor_mnist.py (#22019)
silingtong123 Dec 31, 2019
835ba4e
add is_empty_grad_op for OpTest (#22022)
Dec 31, 2019
6b4c33e
fix decay param in DecayAdagrad test=develop (#22026)
Aurelius84 Dec 31, 2019
9a2204e
Uniform append_backward & gradients parameter_list type to Variable (…
chenwhql Jan 1, 2020
2e90822
polish default error msg & cublas error hint, test=develop (#22032)
chenwhql Jan 1, 2020
0aab257
fix scipy bug (#22024)
tianshuo78520a Jan 1, 2020
c7b03d3
open test_parallel_executor_fetch_feed for PR_Windows_CI. test=develo…
liym27 Jan 2, 2020
3e6b1db
fix bug of checking op desc: not DUPLICABLE but DISPENSABLE (#22039)
liym27 Jan 2, 2020
b852ef7
add no_check_set check for op unittests (#21611)
cryoco Jan 2, 2020
56414c7
move private weight fields to public ones (#21982)
songyouwei Jan 2, 2020
c53b62e
fix integer overflow in match_matrix (#22036)
Aurelius84 Jan 2, 2020
985e4ba
fix unittest for spp op, test=develop (#22030)
dyning Jan 2, 2020
95d79b6
update error log for batch_norm_grad (#22017)
ceci3 Jan 2, 2020
8103012
convert input vars' dtype for range op (#22028)
mapingshuo Jan 3, 2020
aa2ed0d
fix generate_proposal_labesl op (#21793)
FDInSky Jan 3, 2020
f5f65a7
OP unit test specification: compiletime-runtime consistency check (#2…
DannyIsFunny Jan 3, 2020
c1fea3e
Fix example in log_loss doc (#22052)
Jan 3, 2020
6192108
[DNNL] 3D Fully-Connected (#21746)
Sand3r- Jan 3, 2020
d483207
Add the first implememtation of fusion_group op (#19621)
Xreki Jan 3, 2020
5b88378
add shape description in accuracy api doc (#22011)
slf12 Jan 3, 2020
3f653c8
register NoNeedBufferVarsInference for max_pool_grad_op, test=develop…
zhiqiu Jan 3, 2020
7f4abaf
register int/int64_t/float16 in pow/square kernel,test=develop (#22023)
SunAhong1993 Jan 3, 2020
c112b64
Update MKL-DNN to 1.1 (#21754)
grygielski Jan 4, 2020
1c39efb
Enable test conv2d ngraph (#22074)
LeoZhao-Intel Jan 4, 2020
34c5712
polish cross_entropy ENFORCE (#22056)
heavengate Jan 4, 2020
3fab86f
add package for centerloss (#21806)
ForFishes Jan 4, 2020
12b2b4b
Add gradient check to reduce_max and reduce_min ops (#21985)
qjing666 Jan 4, 2020
7d8d459
control flow: support optimizer called (#21851)
liym27 Jan 4, 2020
bf978ff
all cases use large shape (#22084)
zhupengyang Jan 4, 2020
e1d666f
Hotfix to MKL-DNN pool2d tests (#22086)
grygielski Jan 5, 2020
ad8a9cb
[MKL-DNN] Pool & LRN Grad Ops NHWC support (#21747)
jczaja Jan 5, 2020
7fb817d
add distributed_strategy (#21710)
123malin Jan 5, 2020
85ba527
all cases use large shape (#22065)
zhupengyang Jan 6, 2020
8b3ef2a
all cases use large shape (#22091)
zhupengyang Jan 6, 2020
e519a1f
add bigger shape test example for elementwise_pow OP (#22063)
cjt222 Jan 6, 2020
d9f5d1e
ag allocator by default, test=develop (#21837)
sneaxiy Jan 6, 2020
370a8e9
Remove unit tests that are no longer maintained (#22081)
silingtong123 Jan 6, 2020
385ed8a
fix warning in test_install_check.py, test=develop (#22087)
JepsonWong Jan 6, 2020
288b1e7
Fix segmentation fault bug in reduce ops (#22079)
qjing666 Jan 6, 2020
700fdb1
MKL-DNN 1.1 for Windows (#22089)
grygielski Jan 6, 2020
2a47cc5
dygraph LayerList container (#21734)
songyouwei Jan 6, 2020
9587249
polish allocator strategy doc, test=develop, test=document_fix (#22095)
sneaxiy Jan 6, 2020
dd43615
Add ParallelExecutor Test for Cond API and Fix PE Checks Shape Bug (#…
zhhsplendid Jan 6, 2020
1ce6ab9
Refine doc of data based on requirement. (#22098)
zhhsplendid Jan 6, 2020
b0b27ff
[MKL-DNN] Conv grad and Batch Norm grad NHWC support (#22088)
jczaja Jan 6, 2020
0a51098
Add TRT support for BERT (#21135)
cryoco Jan 6, 2020
fab4b07
support elu_op double grad (#21822)
LDOUBLEV Jan 6, 2020
6c20e7c
test=develop, remove unused parameter from class RuntimeInferShapeCon…
silingtong123 Jan 6, 2020
cce9af0
all cases use large shape (#22106)
zhupengyang Jan 7, 2020
ba8414d
replace CUDNN_ENFORCE with PADDLE_ENFORCE_CUDA_SUCCESS, test=develop …
chenwhql Jan 7, 2020
f385c34
fix fleet collective api run on cpu, test=develop (#22064)
wangxicoding Jan 7, 2020
14aebc7
add erf op (#21785)
Jan 7, 2020
5c33919
Fix grad clip (#21784)
MrChengmo Jan 7, 2020
de56887
add Note in the doc of old control flow ops. test=develop,test=docume…
liym27 Jan 7, 2020
5de6a19
fix test_bilinear_tensor_product_op timeout (#22120)
zhupengyang Jan 7, 2020
434f7b9
Fix the global_step & continuous applying error in EMA (#22090)
Jan 7, 2020
4b4a9cc
fix format in operator.cc (#22101)
bingyanghuang Jan 7, 2020
3b84584
fix Variable's gradient api in framework.py, test=develop (#21577)
JepsonWong Jan 7, 2020
418abc9
Update pyramid related OP (#21372)
MrChengmo Jan 7, 2020
b9a6354
Solve elu unitest fail (#22123)
LDOUBLEV Jan 7, 2020
f220be4
Enable CI check to match PADDLE_ENFORCE_CUDA_SUCCESS (#22122)
chenwhql Jan 7, 2020
88cd52a
For printing more logs in issue 21594
lidanqing-intel Dec 17, 2019
82f7d5e
add dmesg to generate memory info
lidanqing-intel Dec 18, 2019
4abac31
move position of dmesg
lidanqing-intel Dec 19, 2019
3896ca8
only leave one test
lidanqing-intel Dec 19, 2019
682bc77
one test failed in printing memory status
lidanqing-intel Dec 19, 2019
02d320d
check the docker status
lidanqing-intel Dec 20, 2019
ad041e9
check 5117 docker memory
lidanqing-intel Dec 23, 2019
10e9463
Merge branch 'log-ci-failures' of https://github.com/lidanqing-intel/…
lidanqing-intel Jan 7, 2020
1f1768e
For checking vgg16, vgg19 time out failure
lidanqing-intel Jan 7, 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
22 changes: 17 additions & 5 deletions cmake/external/mkldnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SET(MKLDNN_PREFIX_DIR ${THIRD_PARTY_PATH}/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/intel/mkl-dnn.git)
SET(MKLDNN_TAG 518a316a8cd6deb82dc7866bc04bd0355a25c3a4)
SET(MKLDNN_TAG 52c3052df8ec1d5b8b45cb6c350a952840eabd42)

# Introduce variables:
# * CMAKE_INSTALL_LIBDIR
Expand Down Expand Up @@ -71,13 +71,13 @@ ExternalProject_Add(
-DMKLROOT=${MKLML_ROOT}
-DCMAKE_C_FLAGS=${MKLDNN_CFLAG}
-DCMAKE_CXX_FLAGS=${MKLDNN_CXXFLAG}
-DMKLDNN_BUILD_TESTS=OFF -DMKLDNN_BUILD_EXAMPLES=OFF
-DDNNL_BUILD_TESTS=OFF -DDNNL_BUILD_EXAMPLES=OFF
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${MKLDNN_INSTALL_DIR}
)
if(WIN32)
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/bin/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
else(WIN32)
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/libmkldnn.so" CACHE FILEPATH "mkldnn library." FORCE)
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/libdnnl.so" CACHE FILEPATH "mkldnn library." FORCE)
endif(WIN32)

ADD_LIBRARY(shared_mkldnn SHARED IMPORTED GLOBAL)
Expand All @@ -98,9 +98,21 @@ ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT})
# it can be directly contained in wheel or capi
if(WIN32)
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/bin/mkldnn.dll)
ADD_CUSTOM_COMMAND(TARGET ${MKLDNN_PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${MKLDNN_INSTALL_DIR}/bin/dnnl.dll ${MKLDNN_SHARED_LIB})
add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM
COMMAND dumpbin /exports ${MKLDNN_INSTALL_DIR}/bin/mkldnn.dll > ${MKLDNN_INSTALL_DIR}/bin/exports.txt)
add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM
COMMAND echo LIBRARY mkldnn > ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def)
add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM
COMMAND echo EXPORTS >> ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def)
add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM
COMMAND for /f "skip=19 tokens=4" %A in (${MKLDNN_INSTALL_DIR}/bin/exports.txt) do echo %A >> ${MKLDNN_INSTALL_DIR}/bin/mkldnn.def)
add_custom_command(TARGET ${MKLDNN_PROJECT} POST_BUILD VERBATIM
COMMAND lib /def:${MKLDNN_INSTALL_DIR}/bin/mkldnn.def /out:${MKLDNN_INSTALL_DIR}/bin/mkldnn.lib /machine:x64)
else(WIN32)
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/libmkldnn.so.0)
SET(MKLDNN_SHARED_LIB_1 ${MKLDNN_INSTALL_DIR}/libmkldnn.so.1)
SET(MKLDNN_SHARED_LIB_1 ${MKLDNN_INSTALL_DIR}/libdnnl.so.1)
ADD_CUSTOM_COMMAND(TARGET ${MKLDNN_PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${MKLDNN_LIB} ${MKLDNN_SHARED_LIB})
ADD_CUSTOM_COMMAND(TARGET ${MKLDNN_PROJECT} POST_BUILD
Expand Down
4 changes: 2 additions & 2 deletions cmake/generic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function(cc_test_run TARGET_NAME)
set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true)
set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
# No unit test should exceed 10 minutes.
set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 1800)
endif()
endfunction()

Expand Down Expand Up @@ -743,7 +743,7 @@ function(py_test TARGET_NAME)
endif()

# No unit test should exceed 10 minutes.
set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 1800)
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function(copy_part_of_thrid_party TARGET DST)
set(dst_dir "${DST}/third_party/install/mkldnn")
if(WIN32)
copy(${TARGET}
SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB} ${MKLDNN_LIB}
SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB} ${MKLDNN_LIB}
DSTS ${dst_dir} ${dst_dir}/lib ${dst_dir}/lib)
else()
copy(${TARGET}
Expand Down
4 changes: 3 additions & 1 deletion cmake/operators.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ function(op_library TARGET)
# Define operators that don't need pybind here.
foreach(manual_pybind_op "compare_op" "logical_op" "nccl_op"
"tensor_array_read_write_op" "tensorrt_engine_op" "conv_fusion_op"
"fusion_transpose_flatten_concat_op" "fusion_conv_inception_op" "sync_batch_norm_op" "dgc_op" "fused_fc_elementwise_layernorm_op" "multihead_matmul_op")
"fusion_transpose_flatten_concat_op" "fusion_conv_inception_op"
"sync_batch_norm_op" "dgc_op" "fused_fc_elementwise_layernorm_op"
"multihead_matmul_op" "fusion_group_op")
if ("${TARGET}" STREQUAL "${manual_pybind_op}")
set(pybind_flag 1)
endif()
Expand Down
6 changes: 2 additions & 4 deletions paddle/fluid/framework/data_layout_transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ void innerTransDataLayoutFromMKLDNN(DataLayout in_layout, DataLayout out_layout,
}
// For exepected NHWC data format we need to reshape the Output tensor
// As MKL-DNN description was in NCHW and paddle is expecting NHWC
if (out_layout == DataLayout::kNHWC) {
std::rotate(out_tz.begin() + 1, out_tz.begin() + 2, out_tz.end());
out->Resize(framework::make_ddim(out_tz));
}
platform::MatchShapeToLayout(out, in_layout, out_layout);

out->set_layout(out_layout);
// reset format since the out tensor will be feed to non-MKLDNN OPkernel
out->set_format(MKLDNNMemoryFormat::undef);
Expand Down
9 changes: 2 additions & 7 deletions paddle/fluid/framework/data_transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,8 @@ void TransformData(const OpKernelType &expected_kernel_type,
out.ShareDataWith(input_tensor);
// For NHWC data we need reshape of tensors as MKL-DNN
// is expecting NHWC dims description order
if (lin == DataLayout::kNHWC) {
auto nchw_dims = paddle::framework::vectorize<int>(out.dims());
std::rotate(nchw_dims.begin() + 1, nchw_dims.end() - 1,
nchw_dims.end());
out.Resize(framework::make_ddim(nchw_dims));
paddle::platform::set_cur_paddle_data_layout(lin);
}
platform::MatchShapeToLayout(&out, lin, lout);
paddle::platform::set_cur_paddle_data_layout(lin);
out.set_layout(DataLayout::kMKLDNN);
out.set_format(out_format);
} else {
Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/framework/data_transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ void TransformData(const OpKernelType &expected_kernel_type,
*/
void SetTensorToVariable(const Variable &in_var, const Tensor &tensor,
Variable *out_var);

} // namespace framework
} // namespace paddle
27 changes: 18 additions & 9 deletions paddle/fluid/framework/ir/attention_lstm_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Param {
std::string LSTMOUT = "at.lstmout.new";
};

void PrepareParameters(Graph* graph, const Param& param);
void PrepareParameters(Graph* graph, const Param& param, ir::Node* lstm_op);

void FindWhileOp(Graph* graph) {
GraphPatternDetector gpd;
Expand Down Expand Up @@ -98,7 +98,7 @@ void FindWhileOp(Graph* graph) {
auto* hidden_init = graph->RetrieveNode(8);

auto* lstm_op = graph->CreateOpNode(&op_desc);
PrepareParameters(graph, param);
PrepareParameters(graph, param, lstm_op);

IR_NODE_LINK_TO(X, lstm_op);
IR_NODE_LINK_TO(cell_init, lstm_op);
Expand Down Expand Up @@ -133,20 +133,29 @@ void PrepareLSTMBias(const LoDTensor& B_forget, const LoDTensor& B_input,
const LoDTensor& B_output, const LoDTensor& B_cell,
LoDTensor* out);

void PrepareParameters(Graph* graph, const Param& param) {
void PrepareParameters(Graph* graph, const Param& param, ir::Node* lstm_op) {
// Check parameters
PADDLE_ENFORCE(graph->Has(kParamScopeAttr));
auto& scope = graph->Get<Scope>(kParamScopeAttr);

// Create new parameters.
// AddInput
scope.Var(param.LSTMWeight)->GetMutable<LoDTensor>();
scope.Var(param.LSTMBias)->GetMutable<LoDTensor>();
scope.Var(param.Hidden)->GetMutable<LoDTensor>();
scope.Var(param.Cell)->GetMutable<LoDTensor>();
scope.Var(param.AttentionedX)->GetMutable<LoDTensor>();
scope.Var(param.AttentionFCOut)->GetMutable<LoDTensor>();
scope.Var(param.LSTMX)->GetMutable<LoDTensor>();
scope.Var(param.LSTMOUT)->GetMutable<LoDTensor>();
// AddOutput
#define IR_NODE(x) \
VarDesc key_##x(param.x); \
key_##x.SetPersistable(false); \
auto* node_##x = graph->CreateVarNode(&key_##x); \
IR_NODE_LINK_TO(lstm_op, node_##x);

IR_NODE(Hidden);
IR_NODE(Cell);
IR_NODE(AttentionedX);
IR_NODE(AttentionFCOut);
IR_NODE(LSTMX);
IR_NODE(LSTMOUT);
#undef IR_NODE

#define GATE_W(name__) \
auto* W_##name__##_w0 = scope.FindVar(#name__ ".w_0"); \
Expand Down
40 changes: 23 additions & 17 deletions paddle/fluid/framework/ir/embedding_fc_lstm_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,47 +127,53 @@ static int BuildFusion(Graph* graph, const std::string& name_scope,
embedding_data, k, weightx_data, n, beta, embeddings_data, n);
op_desc.SetInput("Embeddings", {embeddings});

// Create temp variables.
const std::string BatchedInput = patterns::UniqueKey("BatchedInput");
const std::string BatchedCellPreAct =
patterns::UniqueKey("BatchedCellPreAct");
const std::string BatchedGate = patterns::UniqueKey("BatchedGate");

scope->Var(BatchedInput)->GetMutable<framework::LoDTensor>();
scope->Var(BatchedCellPreAct)->GetMutable<framework::LoDTensor>();
scope->Var(BatchedGate)->GetMutable<framework::LoDTensor>();

op_desc.SetInput("H0", {});
op_desc.SetInput("C0", {});
op_desc.SetOutput("Hidden", {hidden->Name()});
op_desc.SetOutput("Cell", {cell->Name()});
op_desc.SetOutput("XX", {xx->Name()});
op_desc.SetOutput("BatchedGate", {BatchedGate});
op_desc.SetOutput("BatchCellPreAct", {BatchedCellPreAct});
op_desc.SetOutput("BatchedInput", {BatchedInput});
op_desc.SetAttr("is_reverse", lstm->Op()->GetAttr("is_reverse"));
op_desc.SetAttr("use_peepholes", lstm->Op()->GetAttr("use_peepholes"));
// TODO(TJ): get from attr
op_desc.SetAttr("use_seq", true);

PADDLE_ENFORCE(graph->Has(kParamScopeAttr));
auto& scope = graph->Get<Scope>(kParamScopeAttr);
// Create temp variables.
#define OP_SET_OUT(x) \
const std::string x = patterns::UniqueKey(#x); \
op_desc.SetOutput(#x, {x}); \
scope.Var(x)->GetMutable<LoDTensor>()
op_desc.SetOutput(#x, {x});

OP_SET_OUT(BatchedGate);
OP_SET_OUT(BatchCellPreAct);
OP_SET_OUT(BatchedInput);
OP_SET_OUT(BatchedCell);
OP_SET_OUT(BatchedHidden);
OP_SET_OUT(ReorderedH0);
OP_SET_OUT(ReorderedC0);
#undef OP_SET_OUT

auto* op = graph->CreateOpNode(&op_desc);

IR_NODE_LINK_TO(input, op);
IR_NODE_LINK_TO(weight_x, op);
IR_NODE_LINK_TO(weight_h, op);
IR_NODE_LINK_TO(bias, op);
IR_NODE_LINK_TO(op, hidden);

#define IR_NODE(x) \
VarDesc key_##x(x); \
key_##x.SetPersistable(false); \
auto* node_##x = graph->CreateVarNode(&key_##x); \
IR_NODE_LINK_TO(op, node_##x);

IR_NODE(BatchedGate);
IR_NODE(BatchCellPreAct);
IR_NODE(BatchedInput);
IR_NODE(BatchedCell);
IR_NODE(BatchedHidden);
IR_NODE(ReorderedH0);
IR_NODE(ReorderedC0);
#undef IR_NODE

return op;
};

Expand Down
7 changes: 4 additions & 3 deletions paddle/fluid/framework/ir/fc_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ int FCFusePass::ApplyFCPattern(Graph* graph, bool with_relu) const {
// This is to add padding for dimension 128 on concern of MKL performance
auto* scope = param_scope();
auto* weight = scope->FindVar(w->Name())->GetMutable<LoDTensor>();
auto place = weight->place();
bool use_gpu = Get<bool>("use_gpu");
auto* weight_data = weight->data<float>();
auto weight_dims = weight->dims();
int weight_num = product(weight_dims);
int w_h = weight_dims[0];
int w_w = weight_dims[1];
if (!use_gpu) {
bool use_gpu = Has("use_gpu") ? Get<bool>("use_gpu") : false;
bool use_fc_padding =
Has("use_fc_padding") ? Get<bool>("use_fc_padding") : true;
if (!use_gpu && use_fc_padding) {
if (w_h % 128 == 0 && w_w % 128 == 0) {
auto* weight_data_tmp = new float[weight_num];
for (int i = 0; i < w_h; i++) {
Expand Down
8 changes: 6 additions & 2 deletions paddle/fluid/framework/ir/fc_gru_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ static int BuildFusion(Graph* graph, const std::string& name_scope,
}
#undef GET_NODE

#define NEW_IMTERMEDIATE_OUT(key) \
scope.Var(NEW_NAME(key))->GetMutable<framework::LoDTensor>()
#define NEW_IMTERMEDIATE_OUT(key) \
VarDesc key(NEW_NAME(key)); \
key.SetPersistable(false); \
auto* key##_node = graph->CreateVarNode(&key); \
IR_NODE_LINK_TO(op, key##_node);

NEW_IMTERMEDIATE_OUT(ReorderedH0);
NEW_IMTERMEDIATE_OUT(XX);
NEW_IMTERMEDIATE_OUT(BatchedInput);
Expand Down
45 changes: 25 additions & 20 deletions paddle/fluid/framework/ir/fc_lstm_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,50 +74,55 @@ int BuildFusion(Graph* graph, const std::string& name_scope, Scope* scope,
op_desc.SetInput("Bias", {new_bias_var});
}

// Create temp variables.
const std::string BatchedInput = patterns::UniqueKey("BatchedInput");
const std::string BatchedCellPreAct =
patterns::UniqueKey("BatchedCellPreAct");
const std::string BatchedGate = patterns::UniqueKey("BatchedGate");
const std::string CheckedCell = patterns::UniqueKey("CheckedCell");

scope->Var(BatchedInput)->GetMutable<framework::LoDTensor>();
scope->Var(BatchedCellPreAct)->GetMutable<framework::LoDTensor>();
scope->Var(BatchedGate)->GetMutable<framework::LoDTensor>();
scope->Var(CheckedCell)->GetMutable<framework::LoDTensor>();

op_desc.SetInput("H0", {});
op_desc.SetInput("C0", {});
op_desc.SetOutput("Hidden", {hidden->Name()});
op_desc.SetOutput("Cell", {cell->Name()});
op_desc.SetOutput("XX", {xx->Name()});
op_desc.SetOutput("BatchedGate", {BatchedGate});
op_desc.SetOutput("BatchCellPreAct", {BatchedCellPreAct});
op_desc.SetOutput("BatchedInput", {BatchedInput});
op_desc.SetOutput("CheckedCell", {CheckedCell});
op_desc.SetAttr("is_reverse", lstm->Op()->GetAttr("is_reverse"));
op_desc.SetAttr("use_peepholes", lstm->Op()->GetAttr("use_peepholes"));
// TODO(TJ): get from attr
op_desc.SetAttr("use_seq", true);

PADDLE_ENFORCE(graph->Has(kParamScopeAttr));
auto& scope = graph->Get<Scope>(kParamScopeAttr);
// Create temp variables.
#define OP_SET_OUT(x) \
const std::string x = patterns::UniqueKey(#x); \
op_desc.SetOutput(#x, {x}); \
scope.Var(x)->GetMutable<LoDTensor>()
op_desc.SetOutput(#x, {x});

OP_SET_OUT(BatchedGate);
OP_SET_OUT(BatchedCellPreAct);
OP_SET_OUT(BatchedInput);
OP_SET_OUT(CheckedCell);
OP_SET_OUT(BatchedCell);
OP_SET_OUT(BatchedHidden);
OP_SET_OUT(ReorderedH0);
OP_SET_OUT(ReorderedC0);
#undef OP_SET_OUT

auto* op = graph->CreateOpNode(&op_desc);

IR_NODE_LINK_TO(input, op);
IR_NODE_LINK_TO(weight_x, op);
IR_NODE_LINK_TO(weight_h, op);
IR_NODE_LINK_TO(bias, op);
IR_NODE_LINK_TO(op, hidden);

#define IR_NODE(x) \
VarDesc key_##x(x); \
key_##x.SetPersistable(false); \
auto* node_##x = graph->CreateVarNode(&key_##x); \
IR_NODE_LINK_TO(op, node_##x);

IR_NODE(BatchedGate);
IR_NODE(BatchedCellPreAct);
IR_NODE(BatchedInput);
IR_NODE(CheckedCell);
IR_NODE(BatchedCell);
IR_NODE(BatchedHidden);
IR_NODE(ReorderedH0);
IR_NODE(ReorderedC0);
#undef IR_NODE

return op;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void FusionGroupPass::InsertFusionGroupOp(
input_names.push_back(n->Name());
external_nodes.insert(n);
}
op_desc.SetInput("Xs", input_names);
op_desc.SetInput("Inputs", input_names);

std::vector<std::string> output_names;
for (auto* n : output_vars_of_subgraph) {
Expand Down
5 changes: 4 additions & 1 deletion paddle/fluid/framework/ir/seq_concat_fc_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ void SeqConcatFcFusePass::ApplyImpl(ir::Graph* graph) const {
op_desc.SetInput("FCWeight", {fc_w->Name()});
op_desc.SetInput("FCBias", {fc_bias->Name()});
const std::string fc_out_tmp = fc_out->Name() + ".tmp";
param_scope()->Var(fc_out_tmp)->GetMutable<framework::LoDTensor>();
VarDesc fc_out_key(fc_out_tmp);
fc_out_key.SetPersistable(false);
auto* fc_out_node = graph->CreateVarNode(&fc_out_key);
op_desc.SetOutput("FCOut", {fc_out_tmp});
op_desc.SetOutput("Out", {fc_out->Name()});
op_desc.SetAttr("fc_activation", act->Op()->Type());
Expand All @@ -227,6 +229,7 @@ void SeqConcatFcFusePass::ApplyImpl(ir::Graph* graph) const {
IR_NODE_LINK_TO(sequence_expand0_in, op_node);
IR_NODE_LINK_TO(sequence_expand1_in, op_node);
IR_NODE_LINK_TO(op_node, fc_out);
IR_NODE_LINK_TO(op_node, fc_out_node);

// Clean nodes.
std::unordered_set<const Node*> marked_nodes;
Expand Down
Loading