From b39c01163779db1cdac6741a4aaa6fd18341b653 Mon Sep 17 00:00:00 2001 From: Zhaolong Xing Date: Tue, 3 Dec 2019 13:47:15 +0800 Subject: [PATCH] specify the auto growth allocator for inference. (#21448) test=develop --- paddle/fluid/inference/api/analysis_predictor.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index e0f638aefb..5d05091ad3 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -501,6 +501,8 @@ std::unique_ptr CreatePaddlePredictor< std::string flag = "--fraction_of_gpu_memory_to_use=" + std::to_string(fraction_of_gpu_memory); flags.push_back(flag); + // use auto growth strategy here. + flags.push_back("--allocator_strategy=auto_growth"); flags.push_back("--cudnn_deterministic=True"); VLOG(3) << "set flag: " << flag; framework::InitGflags(flags); -- GitLab