From faeeedf14143ef7c87f8c7199c3e0f7d9a5477c0 Mon Sep 17 00:00:00 2001 From: Egor Duplensky Date: Wed, 6 Oct 2021 11:58:46 +0300 Subject: [PATCH] [CPU] [DEBUG_CAPS] Execute all the nodes to have debug info available (#7809) Otherwise Reshape / Output / etc nodes are missed in verbose log And blobs from Output nodes are node dumped --- inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp | 11 ++++++++--- .../src/mkldnn_plugin/utils/debug_capabilities.h | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp b/inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp index 0d61fd72c8e..1d94f9f50a5 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp +++ b/inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp @@ -75,7 +75,7 @@ void MKLDNNGraph::CreateGraph(NET &net, const MKLDNNExtensionManager::Ptr& extMg status = Ready; - ENABLE_CPU_DEBUG_CAP(serialize(*this)); + CPU_DEBUG_CAP_ENABLE(serialize(*this)); } template void MKLDNNGraph::CreateGraph(const std::shared_ptr&, @@ -320,7 +320,7 @@ void MKLDNNGraph::Replicate(const CNNNetwork &network, const MKLDNNExtensionMana void MKLDNNGraph::InitGraph() { MKLDNNGraphOptimizer optimizer; - ENABLE_CPU_DEBUG_CAP(initNodeDumper(config.debugCaps)); + CPU_DEBUG_CAP_ENABLE(initNodeDumper(config.debugCaps)); SortTopologically(); InitNodes(); @@ -397,7 +397,12 @@ void MKLDNNGraph::ExtractConstantAndExecutableNodes() { for (const auto& graphNode : graphNodes) { if (graphNode->isConstant()) constantGraphNodes.emplace_back(graphNode); - else if (graphNode->isExecutable()) + else if (CPU_DEBUG_CAPS_ALWAYS_TRUE(graphNode->isExecutable())) + /* @todo + * Revise implementation. + * With current way it is possible that with debug_caps enabled + * we execute a node, which is not ready to be executed + */ executableGraphNodes.emplace_back(graphNode); } } diff --git a/inference-engine/src/mkldnn_plugin/utils/debug_capabilities.h b/inference-engine/src/mkldnn_plugin/utils/debug_capabilities.h index abefbe06fe5..fce261b19be 100644 --- a/inference-engine/src/mkldnn_plugin/utils/debug_capabilities.h +++ b/inference-engine/src/mkldnn_plugin/utils/debug_capabilities.h @@ -9,7 +9,9 @@ #include #include -#define ENABLE_CPU_DEBUG_CAP(_x) _x; + +#define CPU_DEBUG_CAP_ENABLE(_x) _x; +#define CPU_DEBUG_CAPS_ALWAYS_TRUE(x) true namespace MKLDNNPlugin { namespace DebugCaps { @@ -47,5 +49,7 @@ private: } // namespace MKLDNNPlugin #else // !CPU_DEBUG_CAPS -#define ENABLE_CPU_DEBUG_CAP(_x) +#define CPU_DEBUG_CAP_ENABLE(_x) +#define CPU_DEBUG_CAPS_ALWAYS_TRUE(x) x + #endif // CPU_DEBUG_CAPS