[Other] Deprecate some option api and parameters (#1243)

* Optimize Poros backend

* fix error

* Add more pybind

* fix conflicts

* add some deprecate notices

* [Other] Deprecate some apis in RuntimeOption (#1240)

* Deprecate more options

* modify serving

* Update option.h

* fix tensorrt error

* Update option_pybind.cc

* Update option_pybind.cc

* Fix error in serving

* fix word spell error
This commit is contained in:
Jason
2023-02-07 17:57:46 +08:00
committed by GitHub
parent a18cc0f94c
commit 713afe7f1c
15 changed files with 380 additions and 229 deletions

View File

@@ -211,12 +211,6 @@ struct FASTDEPLOY_DECL RuntimeOption {
void SetLiteSubgraphPartitionConfigBuffer(
const std::string& nnadapter_subgraph_partition_config_buffer);
/**
* @brief Set device name for Paddle Lite backend.
*/
void
SetLiteDeviceNames(const std::vector<std::string>& nnadapter_device_names);
/**
* @brief Set context properties for Paddle Lite backend.
*/
@@ -347,21 +341,21 @@ struct FASTDEPLOY_DECL RuntimeOption {
void SetIpuConfig(bool enable_fp16 = false, int replica_num = 1,
float available_memory_proportion = 1.0,
bool enable_half_partial = false);
/** \brief Set the profile mode as 'true'.
*
* \param[in] inclue_h2d_d2h Whether to include time of H2D_D2H for time of runtime.
* \param[in] repeat Repeat times for runtime inference.
* \param[in] warmup Warmup times for runtime inference.
*/
void EnableProfiling(bool inclue_h2d_d2h = false,
void EnableProfiling(bool inclue_h2d_d2h = false,
int repeat = 100, int warmup = 50) {
benchmark_option.enable_profile = true;
benchmark_option.warmup = warmup;
benchmark_option.repeats = repeat;
benchmark_option.include_h2d_d2h = inclue_h2d_d2h;
}
/** \brief Set the profile mode as 'false'.
*/
void DisableProfiling() {
@@ -381,6 +375,7 @@ struct FASTDEPLOY_DECL RuntimeOption {
bool enable_pinned_memory = false;
/// Option to configure ONNX Runtime backend
OrtBackendOption ort_option;
// ======Only for Paddle Backend=====
@@ -401,20 +396,16 @@ struct FASTDEPLOY_DECL RuntimeOption {
float ipu_available_memory_proportion = 1.0;
bool ipu_enable_half_partial = false;
// ======Only for Trt Backend=======
std::map<std::string, std::vector<int32_t>> trt_max_shape;
std::map<std::string, std::vector<int32_t>> trt_min_shape;
std::map<std::string, std::vector<int32_t>> trt_opt_shape;
std::string trt_serialize_file = "";
bool trt_enable_fp16 = false;
bool trt_enable_int8 = false;
size_t trt_max_batch_size = 1;
size_t trt_max_workspace_size = 1 << 30;
/// Option to configure TensorRT backend
TrtBackendOption trt_option;
// ======Only for PaddleTrt Backend=======
std::vector<std::string> trt_disabled_ops_{};
/// Option to configure Poros backend
PorosBackendOption poros_option;
/// Option to configure OpenVINO backend
OpenVINOBackendOption openvino_option;
// ======Only for RKNPU2 Backend=======
@@ -433,11 +424,11 @@ struct FASTDEPLOY_DECL RuntimeOption {
std::string model_file = "";
std::string params_file = "";
bool model_from_memory_ = false;
// format of input model
/// format of input model
ModelFormat model_format = ModelFormat::PADDLE;
// Benchmark option
benchmark::BenchmarkOption benchmark_option;
/// Benchmark option
benchmark::BenchmarkOption benchmark_option;
};
} // namespace fastdeploy