diff --git a/src/plugins/intel_cpu/src/config.cpp b/src/plugins/intel_cpu/src/config.cpp index 2b9cdcc4ac1203..421dca07747932 100644 --- a/src/plugins/intel_cpu/src/config.cpp +++ b/src/plugins/intel_cpu/src/config.cpp @@ -400,6 +400,12 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) { inferencePrecision = ov::element::undefined; } } + // enable ACL fast math in PERFORMANCE mode +#if defined(OV_CPU_WITH_ACL) + if (executionMode == ov::hint::ExecutionMode::PERFORMANCE) { + aclFastMath = true; + } +#endif // disable dynamic quantization and kv quantization for best accuracy if (executionMode == ov::hint::ExecutionMode::ACCURACY) { if (!fcDynamicQuantizationGroupSizeSetExplicitly) { diff --git a/src/plugins/intel_cpu/src/config.h b/src/plugins/intel_cpu/src/config.h index eeb8e78f5fa91a..79cdf3a5e827ec 100644 --- a/src/plugins/intel_cpu/src/config.h +++ b/src/plugins/intel_cpu/src/config.h @@ -53,6 +53,9 @@ struct Config { uint64_t fcDynamicQuantizationGroupSize = 32; ov::element::Type kvCachePrecision = ov::element::f16; bool fcDynamicQuantizationGroupSizeSetExplicitly = false; +#if defined(OV_CPU_WITH_ACL) + bool aclFastMath = false; +#endif #if defined(OPENVINO_ARCH_X86_64) size_t rtCacheCapacity = 5000ul; #else diff --git a/src/plugins/intel_cpu/src/nodes/deconv.cpp b/src/plugins/intel_cpu/src/nodes/deconv.cpp index 57046a0a06d55b..8a7f95268b4f3a 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/deconv.cpp @@ -219,6 +219,9 @@ Deconvolution::Deconvolution(const std::shared_ptr& op, for (size_t i = 0; i < deconvAttrs.dilation.size(); i++) { deconvAttrs.kernel.push_back(weightDims[withGroups + 2 + i]); } +#if defined(OV_CPU_WITH_ACL) + deconvAttrs.aclFastMath = context->getConfig().aclFastMath; +#endif externOutShape = inputShapes.size() == 3; biasPort = externOutShape ? 3 : 2; diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp index 1345451669bdec..7d400bf96d7cb0 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp @@ -99,7 +99,7 @@ bool AclDeconvExecutor::init(const DeconvAttrs& deconvAttrs, deconv = std::make_unique(); configureThreadSafe([&] { - deconv->configure(&srcTensor, &weiTensor, deconvAttrs.withBiasesParam ? &biasTensor : nullptr, &dstTensor, deconv_info); + deconv->configure(&srcTensor, &weiTensor, deconvAttrs.withBiasesParam ? &biasTensor : nullptr, &dstTensor, deconv_info, deconvAttrs.aclFastMath); }); return true; } @@ -271,7 +271,8 @@ bool AclDeconvExecutorBuilder::customIsSupported(const DeconvAttrs &deconvAttrs, &weiTensorInfo, deconvAttrs.withBiasesParam ? &biasTensorInfo : nullptr, &dstTensorInfo, - deconv_info); + deconv_info, + deconvAttrs.aclFastMath); if (!status) { DEBUG_LOG("NEDeconvolutionLayer validation failed: ", status.error_description()); return false; diff --git a/src/plugins/intel_cpu/src/nodes/executors/deconv.hpp b/src/plugins/intel_cpu/src/nodes/executors/deconv.hpp index 9528e5a5ef03e0..c632cc0cf99ad1 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/deconv.hpp +++ b/src/plugins/intel_cpu/src/nodes/executors/deconv.hpp @@ -22,6 +22,9 @@ struct DeconvAttrs { std::vector paddingR; ov::CoordinateDiff outputPadding; bool withBiasesParam = false; +#if defined(OV_CPU_WITH_ACL) + bool aclFastMath = false; +#endif }; class DeconvExecutor {