From 92fcee6c3b1965446a97d11f930440de961805cb Mon Sep 17 00:00:00 2001 From: WJJ1995 Date: Fri, 19 May 2023 11:29:58 +0800 Subject: [PATCH] [Serving] Add trt workspace_size option for serving (#1963) add workspace_size option Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> --- serving/src/fastdeploy_runtime.cc | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100644 => 100755 serving/src/fastdeploy_runtime.cc diff --git a/serving/src/fastdeploy_runtime.cc b/serving/src/fastdeploy_runtime.cc old mode 100644 new mode 100755 index 03536f58b..07715f8d4 --- a/serving/src/fastdeploy_runtime.cc +++ b/serving/src/fastdeploy_runtime.cc @@ -313,6 +313,12 @@ ModelState::ModelState(TRITONBACKEND_Model* triton_model) // THROW_IF_BACKEND_MODEL_ERROR(ParseUnsignedLongLongValue( // value_string, // &runtime_options_->trt_max_workspace_size)); + } else if (param_key == "workspace_size") { + int max_workspace_size = 1 << 30; + THROW_IF_BACKEND_MODEL_ERROR( + ParseIntValue(value_string, &max_workspace_size)); + runtime_options_->trt_option.max_workspace_size = + max_workspace_size; } else if (param_key == "cache_file") { runtime_options_->trt_option.serialize_file = value_string; } else if (param_key == "use_paddle") {