mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Backend] Add Huawei Ascend NPU deploy using PaddleLite CANN. (#757)
* Add Huawei Ascend NPU deploy through PaddleLite CANN * Add NNAdapter interface for paddlelite * Modify Huawei Ascend Cmake * Update way for compiling Huawei Ascend NPU deployment * remove UseLiteBackend in UseCANN * Support compile python whlee * Change names of nnadapter API * Add nnadapter pybind and remove useless API * Support Python deployment on Huawei Ascend NPU * Add models suppor for ascend * Add PPOCR rec reszie for ascend * fix conflict for ascend * Rename CANN to Ascend * Rename CANN to Ascend * Improve ascend * fix ascend bug * improve ascend docs * improve ascend docs * improve ascend docs * Improve Ascend * Improve Ascend * Move ascend python demo * Imporve ascend * Improve ascend * Improve ascend * Improve ascend * Improve ascend * Imporve ascend * Imporve ascend * Improve ascend
This commit is contained in:
@@ -116,6 +116,9 @@ struct FASTDEPLOY_DECL RuntimeOption {
|
||||
/// Use TimVX to inference
|
||||
void UseTimVX();
|
||||
|
||||
/// Use Huawei Ascend to inference
|
||||
void UseAscend();
|
||||
|
||||
///
|
||||
/// \brief Turn on XPU.
|
||||
///
|
||||
@@ -235,11 +238,48 @@ struct FASTDEPLOY_DECL RuntimeOption {
|
||||
void SetLiteOptimizedModelDir(const std::string& optimized_model_dir);
|
||||
|
||||
/**
|
||||
* @brief Set nnadapter subgraph partition path for Paddle Lite backend.
|
||||
* @brief Set subgraph partition path for Paddle Lite backend.
|
||||
*/
|
||||
void SetLiteSubgraphPartitionPath(
|
||||
const std::string& nnadapter_subgraph_partition_config_path);
|
||||
|
||||
/**
|
||||
* @brief Set subgraph partition path for Paddle Lite backend.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
void SetLiteContextProperties(
|
||||
const std::string& nnadapter_context_properties);
|
||||
|
||||
/**
|
||||
* @brief Set model cache dir for Paddle Lite backend.
|
||||
*/
|
||||
void SetLiteModelCacheDir(
|
||||
const std::string& nnadapter_model_cache_dir);
|
||||
|
||||
/**
|
||||
* @brief Set dynamic shape info for Paddle Lite backend.
|
||||
*/
|
||||
void SetLiteDynamicShapeInfo(
|
||||
const std::map<std::string, std::vector<std::vector<int64_t>>>&
|
||||
nnadapter_dynamic_shape_info);
|
||||
|
||||
/**
|
||||
* @brief Set mixed precision quantization config path for Paddle Lite backend.
|
||||
*/
|
||||
void SetLiteMixedPrecisionQuantizationConfigPath(
|
||||
const std::string& nnadapter_mixed_precision_quantization_config_path);
|
||||
|
||||
/**
|
||||
* @brief enable half precision while use paddle lite backend
|
||||
*/
|
||||
@@ -398,7 +438,17 @@ struct FASTDEPLOY_DECL RuntimeOption {
|
||||
// optimized model dir for CxxConfig
|
||||
std::string lite_optimized_model_dir = "";
|
||||
std::string lite_nnadapter_subgraph_partition_config_path = "";
|
||||
// and other nnadapter settings for CxxConfig
|
||||
std::string lite_nnadapter_subgraph_partition_config_buffer = "";
|
||||
std::string lite_nnadapter_context_properties = "";
|
||||
std::string lite_nnadapter_model_cache_dir = "";
|
||||
std::string lite_nnadapter_mixed_precision_quantization_config_path = "";
|
||||
std::map<std::string, std::vector<std::vector<int64_t>>>
|
||||
lite_nnadapter_dynamic_shape_info = {{"", {{0}}}};
|
||||
std::vector<std::string> lite_nnadapter_device_names = {};
|
||||
|
||||
bool enable_timvx = false;
|
||||
bool enable_ascend = false;
|
||||
bool enable_xpu = false;
|
||||
|
||||
// ======Only for Trt Backend=======
|
||||
|
Reference in New Issue
Block a user