[VPU] Add option to disable preprocessing check inside the model (#4616)
This commit is contained in:
parent
29873c0a1d
commit
66cca724f6
@ -112,6 +112,7 @@ struct CompilationConfig final {
|
||||
bool forcePureTensorIterator = false;
|
||||
bool enableMemoryTypesAnnotation = false;
|
||||
bool enableWeightsAnalysis = true;
|
||||
bool checkPreprocessingInsideModel = true;
|
||||
bool enableCustomReshapeParam = false;
|
||||
|
||||
//
|
||||
|
@ -44,6 +44,15 @@ DECLARE_VPU_CONFIG(MYRIAD_ENABLE_EARLY_ELTWISE_RELU_FUSION);
|
||||
*/
|
||||
DECLARE_VPU_CONFIG(MYRIAD_ENABLE_WEIGHTS_ANALYSIS);
|
||||
|
||||
/**
|
||||
* @brief MyriadPlugin uses heuristic algorithm to avoid accuracy degradations.
|
||||
* This algorithm tries to find the preprocessing at the beginning of the model to adjust its parameters.
|
||||
* This option should be set to "NO" if preprocessing is not a part of the model and performed separately
|
||||
* in order to avoid accuracy degradation.
|
||||
* Default is "YES"
|
||||
*/
|
||||
DECLARE_VPU_CONFIG(MYRIAD_CHECK_PREPROCESSING_INSIDE_MODEL);
|
||||
|
||||
/**
|
||||
* @brief Used to enable reshapeBeforeConvTiling pass in cases where
|
||||
* user have reshape parameter "alt_width" in IR.
|
||||
|
@ -87,6 +87,11 @@ bool isScalable(const Stage& stage) {
|
||||
}
|
||||
|
||||
bool checkGrowingOutput(const Model& model) {
|
||||
const auto& env = CompileEnv::get();
|
||||
if (!env.config.checkPreprocessingInsideModel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static const float SCALE_THRESHOLD = 0.125f;
|
||||
|
||||
for (const auto& stage : model->getStages()) {
|
||||
|
@ -68,6 +68,7 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
ie::MYRIAD_FORCE_PURE_TENSOR_ITERATOR,
|
||||
ie::MYRIAD_DISABLE_CONVERT_STAGES,
|
||||
ie::MYRIAD_ENABLE_WEIGHTS_ANALYSIS,
|
||||
ie::MYRIAD_CHECK_PREPROCESSING_INSIDE_MODEL,
|
||||
ie::MYRIAD_ENABLE_EARLY_ELTWISE_RELU_FUSION,
|
||||
ie::MYRIAD_ENABLE_CUSTOM_RESHAPE_PARAM,
|
||||
|
||||
@ -186,6 +187,7 @@ void ParsedConfig::parse(const std::map<std::string, std::string>& config) {
|
||||
setOption(_compileConfig.forcePureTensorIterator, switches, config, ie::MYRIAD_FORCE_PURE_TENSOR_ITERATOR);
|
||||
setOption(_compileConfig.disableConvertStages, switches, config, ie::MYRIAD_DISABLE_CONVERT_STAGES);
|
||||
setOption(_compileConfig.enableWeightsAnalysis, switches, config, ie::MYRIAD_ENABLE_WEIGHTS_ANALYSIS);
|
||||
setOption(_compileConfig.checkPreprocessingInsideModel, switches, config, ie::MYRIAD_CHECK_PREPROCESSING_INSIDE_MODEL);
|
||||
setOption(_compileConfig.enableEarlyEltwiseReLUFusion, switches, config, ie::MYRIAD_ENABLE_EARLY_ELTWISE_RELU_FUSION);
|
||||
setOption(_compileConfig.enableCustomReshapeParam, switches, config, ie::MYRIAD_ENABLE_CUSTOM_RESHAPE_PARAM);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user