From b7c14a8e0e8f091331ba3569fd3dac209a58836d Mon Sep 17 00:00:00 2001 From: Aleksandr Voron Date: Thu, 22 Feb 2024 12:04:03 +0100 Subject: [PATCH] adedd debug logs in ACL eltwise executor --- cmake/features.cmake | 4 +-- .../src/nodes/executors/acl/acl_eltwise.cpp | 34 +++++++++++++++++-- .../transformation_pipeline.cpp | 9 +++-- .../src/utils/debug_capabilities.cpp | 2 +- .../intel_cpu/src/utils/precision_support.cpp | 2 ++ 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index 9e4e507600e1af..d2847fc92ac3ce 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -44,9 +44,9 @@ endif() ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ${ENABLE_ONEDNN_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF) -ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF) +ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" ON) ov_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_GPU" OFF) -ov_dependent_option (ENABLE_CPU_DEBUG_CAPS "enable CPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_CPU" OFF) +ov_dependent_option (ENABLE_CPU_DEBUG_CAPS "enable CPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_CPU" ON) ov_dependent_option (ENABLE_SNIPPETS_DEBUG_CAPS "enable Snippets debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS" OFF) ov_option (ENABLE_PROFILING_ITT "Build with ITT tracing. Optionally configure pre-built ittnotify library though INTEL_VTUNE_DIR variable." OFF) diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp index cdc038fbf9155d..234511027c2310 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp @@ -4,6 +4,7 @@ #include "acl_eltwise.hpp" #include "acl_utils.hpp" +#include "utils/debug_capabilities.h" namespace ov { namespace intel_cpu { @@ -94,6 +95,10 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, case Algorithm::EltwiseHswish: if (!(checkPrecision({ov::element::f16, ov::element::f16}, ov::element::f16) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::f32))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; @@ -103,6 +108,10 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, if (!(checkPrecision({ov::element::i32, ov::element::i32}, ov::element::i32) || checkPrecision({ov::element::f16, ov::element::f16}, ov::element::f16) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::f32))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; @@ -113,6 +122,10 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, checkPrecision({ov::element::i32, ov::element::i32}, ov::element::i32) || checkPrecision({ov::element::f16, ov::element::f16}, ov::element::f16) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::f32))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; @@ -123,6 +136,10 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, checkPrecision({ov::element::i32, ov::element::i32}, ov::element::i32) || checkPrecision({ov::element::f16, ov::element::f16}, ov::element::f16) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::f32))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; @@ -134,6 +151,10 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, checkPrecision({ov::element::i16, ov::element::i16}, ov::element::i16) || checkPrecision({ov::element::f16, ov::element::f16}, ov::element::f16) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::f32))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; @@ -149,20 +170,29 @@ bool AclEltwiseExecutorBuilder::isSupported(const EltwiseAttrs& eltwiseAttrs, checkPrecision({ov::element::i32, ov::element::i32}, ov::element::u8) || checkPrecision({ov::element::f16, ov::element::f16}, ov::element::u8) || checkPrecision({ov::element::f32, ov::element::f32}, ov::element::u8))) { + std::string srcPrec; + for (size_t i = 0; i < srcDescs.size(); i++) srcPrec += srcDescs[i]->getPrecision().to_string() + " "; + DEBUG_LOG(algToString(eltwiseAttrs.algorithm), ": provided combination of src precisions: [", srcPrec, + "] and dst precision: ", dstDescs[0]->getPrecision().to_string(), " is not supported"); return false; } break; default: + DEBUG_LOG("Eltwise algorithm ", algToString(eltwiseAttrs.algorithm), " is not supported"); return false; } for (const auto & srcDesc : srcDescs) { - if (getAclDataLayoutByMemoryDesc(srcDesc) == arm_compute::DataLayout::UNKNOWN) + if (getAclDataLayoutByMemoryDesc(srcDesc) == arm_compute::DataLayout::UNKNOWN) { + DEBUG_LOG("src descriptor layout is unknown"); return false; + } } for (const auto & dstDesc : dstDescs) { - if (getAclDataLayoutByMemoryDesc(dstDesc) == arm_compute::DataLayout::UNKNOWN) + if (getAclDataLayoutByMemoryDesc(dstDesc) == arm_compute::DataLayout::UNKNOWN) { + DEBUG_LOG("dst descriptor layout is unknown"); return false; + } } return true; diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index 05171802fd462b..337a90ffab1e38 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -317,14 +317,13 @@ void Transformations::PreLpt(const std::vector& defaultPrecis if (!hasHardwareSupport(ov::element::bf16)) map.insert({ov::element::bf16, ov::element::f32}); #if defined(OPENVINO_ARCH_ARM) || defined(OPENVINO_ARCH_ARM64) - if (hasHardwareSupport(ov::element::f16)) { - if (inferencePrecision != ov::element::f16) { + if (!hasHardwareSupport(ov::element::f16) || + (hasHardwareSupport(ov::element::f16) && inferencePrecision != ov::element::f16)) { map.insert({ov::element::f16, ov::element::f32}); - } - return map; } -#endif +#else map.insert({ov::element::f16, ov::element::f32}); +#endif return map; }; diff --git a/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp b/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp index 6e29e04c8aa8d8..c393ee4ad3fea7 100644 --- a/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp +++ b/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp @@ -44,7 +44,7 @@ namespace { DebugLogEnabled::DebugLogEnabled(const char* file, const char* func, int line, const char* name) { // check ENV - const char* p_filters = std::getenv("OV_CPU_DEBUG_LOG"); + const char* p_filters = "-";//std::getenv("OV_CPU_DEBUG_LOG"); if (!p_filters) { enabled = false; return; diff --git a/src/plugins/intel_cpu/src/utils/precision_support.cpp b/src/plugins/intel_cpu/src/utils/precision_support.cpp index ecb6d8eb82570b..b56a2356bbb2b5 100644 --- a/src/plugins/intel_cpu/src/utils/precision_support.cpp +++ b/src/plugins/intel_cpu/src/utils/precision_support.cpp @@ -12,6 +12,7 @@ #if defined(OV_CPU_WITH_ACL) #include "arm_compute/core/CPP/CPPTypes.h" +#include "debug_capabilities.h" #endif namespace ov { @@ -24,6 +25,7 @@ static bool hasFP16HardwareSupport(const ov::element::Type& precision) { return true; return false; #elif defined(OV_CPU_WITH_ACL) + DEBUG_LOG("hasFP16HardwareSupport: ", arm_compute::CPUInfo::get().has_fp16()); return arm_compute::CPUInfo::get().has_fp16(); #else return false;