Created by: luotao1
unify ZeroCopy in analysis_test for inference
- Now we only need add following codes in
SetConfig
function, and use--zero_copy=true
to test it.
if (FLAGS_zero_copy) {
cfg->SwitchUseFeedFetchOps(false);
}
- for example, commad
./paddle/fluid/inference/tests/api/test_analyzer_pyramid_dnn --infer_model=third_party/inference_demo/pyramid_dnn/model/ --infer_data=third_party/inference_demo/pyramid_dnn/data.txt --gtest_filter=Analyzer_Pyramid_DNN.profile --repeat=1000 --zero_copy=1
PyramidDNN | 2620 v3 |
---|---|
before | 0.232418ms |
after(use_zero_copy) | 0.208761ms |
speedup | 10% |
- Add
TEST(Analyzer_xxx, compare_zero_copy)
unit-test to ensure the result of AnalysisConfig and AnalysisConfig + ZeroCopy - Simpilfy
analyzer_rnn1_tester.cc
andanalyzer_seq_pool1_tester.cc
.