提交 5504425e 编写于 作者: L luotao1

fix compiler error, use len20 dataset for bert

test=develop
上级 65517908
...@@ -128,10 +128,10 @@ inference_analysis_api_test_with_fake_data(test_analyzer_resnet50 ...@@ -128,10 +128,10 @@ inference_analysis_api_test_with_fake_data(test_analyzer_resnet50
inference_analysis_api_test_with_fake_data(test_analyzer_mobilenet_depthwise_conv inference_analysis_api_test_with_fake_data(test_analyzer_mobilenet_depthwise_conv
"${INFERENCE_DEMO_INSTALL_DIR}/mobilenet_depthwise_conv" analyzer_resnet50_tester.cc "mobilenet_model.tar.gz" SERIAL) "${INFERENCE_DEMO_INSTALL_DIR}/mobilenet_depthwise_conv" analyzer_resnet50_tester.cc "mobilenet_model.tar.gz" SERIAL)
# bert # bert, max_len=20
set(BERT_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/bert") set(BERT_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/bert20")
download_model_and_data(${BERT_INSTALL_DIR} "bert_model.tar.gz" "bert_data.txt.tar.gz") download_model_and_data(${BERT_INSTALL_DIR} "bert_model.tar.gz" "bert_data_len20.txt.tar.gz")
inference_analysis_api_test(test_analyzer_bert ${BERT_INSTALL_DIR} analyzer_bert_tester.cc) inference_analysis_api_test(test_analyzer_bert ${BERT_INSTALL_DIR} analyzer_bert_tester.cc SERIAL)
# anakin # anakin
if (WITH_ANAKIN AND WITH_MKL) # only needed in CI if (WITH_ANAKIN AND WITH_MKL) # only needed in CI
......
...@@ -18,7 +18,6 @@ namespace paddle { ...@@ -18,7 +18,6 @@ namespace paddle {
namespace inference { namespace inference {
using paddle::PaddleTensor; using paddle::PaddleTensor;
using paddle::contrib::AnalysisConfig;
template <typename T> template <typename T>
void GetValueFromStream(std::stringstream *ss, T *t) { void GetValueFromStream(std::stringstream *ss, T *t) {
...@@ -158,12 +157,10 @@ bool LoadInputData(std::vector<std::vector<paddle::PaddleTensor>> *inputs) { ...@@ -158,12 +157,10 @@ bool LoadInputData(std::vector<std::vector<paddle::PaddleTensor>> *inputs) {
return true; return true;
} }
void SetConfig(contrib::AnalysisConfig *config) { void SetConfig(AnalysisConfig *config) { config->SetModel(FLAGS_infer_model); }
config->SetModel(FLAGS_infer_model);
}
void profile(bool use_mkldnn = false) { void profile(bool use_mkldnn = false) {
contrib::AnalysisConfig config; AnalysisConfig config;
SetConfig(&config); SetConfig(&config);
if (use_mkldnn) { if (use_mkldnn) {
...@@ -213,17 +210,14 @@ TEST(Analyzer_bert, compare_mkldnn) { compare(true /* use_mkldnn */); } ...@@ -213,17 +210,14 @@ TEST(Analyzer_bert, compare_mkldnn) { compare(true /* use_mkldnn */); }
#endif #endif
// Compare Deterministic result // Compare Deterministic result
// TODO(luotao): Since each unit-test on CI only have 10 minutes, cancel this to TEST(Analyzer_bert, compare_determine) {
// decrease the CI time. AnalysisConfig cfg;
// TEST(Analyzer_bert, compare_determine) { SetConfig(&cfg);
// AnalysisConfig cfg;
// SetConfig(&cfg); std::vector<std::vector<PaddleTensor>> inputs;
// LoadInputData(&inputs);
// std::vector<std::vector<PaddleTensor>> inputs; CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config *>(&cfg),
// LoadInputData(&inputs); inputs);
// CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config }
// *>(&cfg),
// inputs);
// }
} // namespace inference } // namespace inference
} // namespace paddle } // namespace paddle
...@@ -20,7 +20,6 @@ namespace paddle { ...@@ -20,7 +20,6 @@ namespace paddle {
namespace inference { namespace inference {
using namespace framework; // NOLINT using namespace framework; // NOLINT
using namespace contrib; // NOLINT
struct DataRecord { struct DataRecord {
std::vector<std::vector<std::vector<float>>> link_step_data_all; std::vector<std::vector<std::vector<float>>> link_step_data_all;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册