From cb7551fd6633a68e2d24f0168ba656f28a0f041a Mon Sep 17 00:00:00 2001 From: Zhang Jun Date: Fri, 8 Apr 2022 10:41:45 +0800 Subject: [PATCH] [cherrypick-2.3] modify infer gpu memory strategy (#41427), remove cudnn_deterministic=True (#41341) (#41491) Co-authored-by: JingZhuangzhuang <75348594+JZZ-NOTE@users.noreply.github.com> --- paddle/fluid/inference/api/analysis_predictor.cc | 8 -------- paddle/fluid/platform/flags.cc | 4 ---- 2 files changed, 12 deletions(-) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 820cf4cac07..b7e811e4c64 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -1058,16 +1058,8 @@ std::unique_ptr CreatePaddlePredictor< std::to_string(fraction_of_gpu_memory); VLOG(3) << "set flag: " << flag; gflags.push_back(flag); - gflags.push_back("--cudnn_deterministic=True"); } -// TODO(wilber): jetson tx2 may fail to run the model due to insufficient memory -// under the native_best_fit strategy. Modify the default allocation strategy to -// auto_growth. todo, find a more appropriate way to solve the problem. -#ifdef WITH_NV_JETSON - gflags.push_back("--allocator_strategy=auto_growth"); -#endif - // TODO(Shixiaowei02): Add a mandatory scheme to use the thread local // allocator when multi-stream is enabled. if (config.thread_local_stream_enabled()) { diff --git a/paddle/fluid/platform/flags.cc b/paddle/fluid/platform/flags.cc index e417b4fd869..4e47c130c72 100644 --- a/paddle/fluid/platform/flags.cc +++ b/paddle/fluid/platform/flags.cc @@ -364,11 +364,7 @@ PADDLE_DEFINE_EXPORTED_double( * Example: * Note: For selecting allocator policy of PaddlePaddle. */ -#ifdef PADDLE_ON_INFERENCE -static constexpr char kDefaultAllocatorStrategy[] = "naive_best_fit"; -#else static constexpr char kDefaultAllocatorStrategy[] = "auto_growth"; -#endif PADDLE_DEFINE_EXPORTED_string( allocator_strategy, kDefaultAllocatorStrategy, "The allocation strategy, enum in [naive_best_fit, auto_growth]. " -- GitLab