提交 bccb0ba4 编写于 作者: S Sylwester Fraczek 提交者: Tao Luo

fix quantize_squash_pass segfault when no tensor linked to Bias (#17292)

* fix quantize_squash_pass segfault when there is no tensor linked do Bias input

test=develop

* add googlenet test

test=develop

* fix concat CreateKey not using input format

test=develop
上级 3db9c8c9
...@@ -81,6 +81,9 @@ void CPUQuantizeSquashPass::Squash( ...@@ -81,6 +81,9 @@ void CPUQuantizeSquashPass::Squash(
auto quant_out_var_name = quant_out->Name(); auto quant_out_var_name = quant_out->Name();
auto next_op_inputs = next_op_desc->InputNames(); auto next_op_inputs = next_op_desc->InputNames();
for (const auto& name : next_op_inputs) { for (const auto& name : next_op_inputs) {
if (next_op_desc->Inputs().count(name) == 0 ||
next_op_desc->Input(name).size() == 0)
continue;
auto var_name = next_op_desc->Input(name)[0]; auto var_name = next_op_desc->Input(name)[0];
if (var_name.compare(quant_out_var_name) == 0) { if (var_name.compare(quant_out_var_name) == 0) {
next_op_desc->SetInput( next_op_desc->SetInput(
......
...@@ -194,6 +194,13 @@ if(WITH_MKLDNN) ...@@ -194,6 +194,13 @@ if(WITH_MKLDNN)
inference_download_and_uncompress(${INT8_VGG19_MODEL_DIR} "${INFERENCE_URL}/int8" "VGG19_int8_model.tar.gz" ) inference_download_and_uncompress(${INT8_VGG19_MODEL_DIR} "${INFERENCE_URL}/int8" "VGG19_int8_model.tar.gz" )
endif() endif()
inference_analysis_api_int8_test(test_analyzer_int8_vgg19 ${INT8_VGG19_MODEL_DIR} ${INT8_DATA_DIR} analyzer_int8_image_classification_tester.cc) inference_analysis_api_int8_test(test_analyzer_int8_vgg19 ${INT8_VGG19_MODEL_DIR} ${INT8_DATA_DIR} analyzer_int8_image_classification_tester.cc)
#googlenet int8
set(INT8_GOOGLENET_MODEL_DIR "${INT8_DATA_DIR}/googlenet")
if (NOT EXISTS ${INT8_GOOGLENET_MODEL_DIR})
inference_download_and_uncompress(${INT8_GOOGLENET_MODEL_DIR} "${INFERENCE_URL}/int8" "GoogleNet_int8_model.tar.gz" )
endif()
inference_analysis_api_int8_test(test_analyzer_int8_googlenet ${INT8_GOOGLENET_MODEL_DIR} ${INT8_DATA_DIR} analyzer_int8_image_classification_tester.cc SERIAL)
endif() endif()
# bert, max_len=20, embedding_dim=128 # bert, max_len=20, embedding_dim=128
......
...@@ -79,6 +79,8 @@ std::string CreateKey(const paddle::framework::ExecutionContext& ctx, ...@@ -79,6 +79,8 @@ std::string CreateKey(const paddle::framework::ExecutionContext& ctx,
platform::MKLDNNHandler::AppendKey(&key, std::to_string(concat_axis)); platform::MKLDNNHandler::AppendKey(&key, std::to_string(concat_axis));
platform::MKLDNNHandler::AppendKey(&key, ctx.op().Output("Out")); platform::MKLDNNHandler::AppendKey(&key, ctx.op().Output("Out"));
platform::MKLDNNHandler::AppendKey(&key, std::to_string(dt)); platform::MKLDNNHandler::AppendKey(&key, std::to_string(dt));
platform::MKLDNNHandler::AppendKey(&key,
std::to_string(multi_input[0]->format()));
return key; return key;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册