Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPU][DEBUG_CAPS] Bring back an execution of all nodes for debug caps #28597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/plugins/intel_cpu/src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,16 @@ static std::tuple<std::vector<NodePtr>, std::vector<size_t>> ExtractExecutableNo
std::unordered_map<size_t, size_t> graphIdToExecutableId;
std::vector<NodePtr> executableGraphNodes;
for (size_t i = 0; i < graphNodes.size(); i++) {
const auto& graphNode = graphNodes[i];
if ((!graphNode->isConstant() && graphNode->isExecutable()) || // non-constant executable or
(graphNode->isDynamicNode() &&
!one_of(graphNode->getType(), Type::Input, Type::Output))) { // dynamic, except inputs / outputs
const auto& node = graphNodes[i];
const bool staticZeroDims = !node->isDynamicNode() && !node->isExecutable() && !node->isInPlace();
maxnick marked this conversation as resolved.
Show resolved Hide resolved
const bool dynamicNonInputOutput = node->isDynamicNode() && !one_of(node->getType(), Type::Input, Type::Output);

if (!node->isConstant() && // constants are executed once in scope of compile_model
!staticZeroDims && // never execute static nodes with zero dim input / output tensors
(CPU_DEBUG_CAPS_ALWAYS_TRUE(node->isExecutable()) || // execute all executable nodes
dynamicNonInputOutput)) { // plus dynamic ones, except inputs / outputs
graphIdToExecutableId[i] = executableGraphNodes.size();
executableGraphNodes.emplace_back(graphNode);
executableGraphNodes.emplace_back(node);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/intel_cpu/src/utils/debug_capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ static inline std::ostream& _write_all_to_stream(std::ostream& os, const T& arg,

# define CREATE_DEBUG_TIMER(x) PrintableTimer x

# define CPU_DEBUG_CAPS_ALWAYS_TRUE(x) true

/*
* important debugging tools for accuracy issues
* OV_CPU_INFER_PRC_POS_PATTERN : positive regex pattern to filter node type & orgname.
Expand Down Expand Up @@ -286,6 +288,8 @@ bool getEnvBool(const char* name);

# define CREATE_DEBUG_TIMER(x)

# define CPU_DEBUG_CAPS_ALWAYS_TRUE(x) x

#endif // CPU_DEBUG_CAPS

// To avoid "unused variable" warnings `when debug caps
Expand Down
Loading