未验证 提交 1e1600eb 编写于 作者: 石晓伟 提交者: GitHub

fix the jetson allocator strategy, test=develop (#32932)

上级 aa4a56fc
...@@ -650,13 +650,6 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor< ...@@ -650,13 +650,6 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
gflags.push_back("--cudnn_deterministic=True"); gflags.push_back("--cudnn_deterministic=True");
} }
if (config.thread_local_stream_enabled()) {
gflags.push_back("--allocator_strategy=thread_local");
process_level_allocator_enabled = false;
} else {
process_level_allocator_enabled = true;
}
// TODO(wilber): jetson tx2 may fail to run the model due to insufficient memory // 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 // under the native_best_fit strategy. Modify the default allocation strategy to
// auto_growth. todo, find a more appropriate way to solve the problem. // auto_growth. todo, find a more appropriate way to solve the problem.
...@@ -664,6 +657,15 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor< ...@@ -664,6 +657,15 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
gflags.push_back("--allocator_strategy=auto_growth"); gflags.push_back("--allocator_strategy=auto_growth");
#endif #endif
// TODO(Shixiaowei02): Add a mandatory scheme to use the thread local
// allocator when multi-stream is enabled.
if (config.thread_local_stream_enabled()) {
gflags.push_back("--allocator_strategy=thread_local");
process_level_allocator_enabled = false;
} else {
process_level_allocator_enabled = true;
}
if (framework::InitGflags(gflags)) { if (framework::InitGflags(gflags)) {
VLOG(3) << "The following gpu analysis configurations only take effect " VLOG(3) << "The following gpu analysis configurations only take effect "
"for the first predictor: "; "for the first predictor: ";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册