Skip to content
Open
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
1 change: 0 additions & 1 deletion src/common/itt/include/openvino/itt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ typedef struct handle_ {
* @cond
*/
namespace internal {
bool is_initialized();
domain_t domain(const char* name);
handle_t handle(const char* name);
void taskBegin(domain_t d, handle_t t);
Expand Down
6 changes: 1 addition & 5 deletions src/common/itt/src/itt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace internal {

static __itt_collection_state state = __itt_get_collection_state();

bool is_initialized() {
static inline bool is_initialized() {
return state == __itt_collection_init_successful;
}

Expand Down Expand Up @@ -110,10 +110,6 @@ void regionEnd(domain_t d) {

#else

bool is_initialized() {
return false;
}

domain_t domain(const char*) {
return nullptr;
}
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/intel_cpu/src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,11 +1598,11 @@ class UpdateNodes : public UpdateNodesBase {

/* group all the profiling macros into a single one
* to avoid cluttering a core logic */
#define VERBOSE_PERF_DUMP_ITT_DEBUG_LOG(ittScope, node, config) \
VERBOSE(node, (config).debugCaps.verbose); \
PERF(node, (config).collectPerfCounters); \
DUMP(node, (config).debugCaps, infer_count); \
OV_ITT_SCOPED_TASK(ov::itt::domains::ov_op_exec, (node)->getTypeStr()); \
#define VERBOSE_PERF_DUMP_ITT_DEBUG_LOG(ittScope, node, config) \
VERBOSE(node, (config).debugCaps.verbose); \
PERF(node, (config).collectPerfCounters); \
DUMP(node, (config).debugCaps, infer_count); \
OV_ITT_SCOPED_TASK_BASE(ittScope, (node)->perfCounters().execute); \
DEBUG_LOG(*(node));

inline void Graph::ExecuteNode(const NodePtr& node, SyncInferRequest* request, int numaId) const {
Expand Down
39 changes: 0 additions & 39 deletions src/plugins/intel_cpu/src/itt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,6 @@ OV_ITT_DOMAIN(ov_intel_cpu, "ov::intel_cpu");
OV_ITT_DOMAIN(ov_intel_cpu_LT, "ov::intel_cpu::lt");
} // namespace ov::intel_cpu::itt::domains

namespace ov::intel_cpu::itt {

class ScopedOpExecTask {
public:
explicit ScopedOpExecTask(const char* name) noexcept {
if (openvino::itt::internal::is_initialized()) {
m_handle = openvino::itt::handle(name);
openvino::itt::internal::taskBegin(::ov::itt::domains::ov_op_exec(), m_handle);
}
}
explicit ScopedOpExecTask(const std::string& name) noexcept : ScopedOpExecTask(name.c_str()) {}
~ScopedOpExecTask() noexcept {
if (openvino::itt::internal::is_initialized()) {
openvino::itt::internal::taskEnd(::ov::itt::domains::ov_op_exec());
}
}

ScopedOpExecTask(const ScopedOpExecTask&) = delete;
ScopedOpExecTask& operator=(const ScopedOpExecTask&) = delete;

private:
openvino::itt::handle_t m_handle{};
};

} // namespace ov::intel_cpu::itt

#if defined(SELECTIVE_BUILD_ANALYZER) || defined(SELECTIVE_BUILD)
# define OV_CPU_NODE_SCOPED_TASK(taskName) OV_ITT_SCOPED_TASK(::ov::itt::domains::ov_op_exec, taskName)
# define OV_CPU_NODE_SCOPED_TASK_BASE(taskName) OV_ITT_SCOPED_TASK_BASE(::ov::itt::domains::ov_op_exec, taskName)
#else
# define OV_CPU_NODE_SCOPE_CONCAT_IMPL(x, y) x##y
# define OV_CPU_NODE_SCOPE_CONCAT(x, y) OV_CPU_NODE_SCOPE_CONCAT_IMPL(x, y)
# define OV_CPU_NODE_SCOPED_TASK_INTERNAL(varName, taskName) ::ov::intel_cpu::itt::ScopedOpExecTask varName(taskName)
# define OV_CPU_NODE_SCOPED_TASK(taskName) \
OV_CPU_NODE_SCOPED_TASK_INTERNAL(OV_CPU_NODE_SCOPE_CONCAT(cpuNodeScopedTaskGuard, __LINE__), taskName)
# define OV_CPU_NODE_SCOPED_TASK_BASE(taskName) \
OV_CPU_NODE_SCOPED_TASK_INTERNAL(OV_CPU_NODE_SCOPE_CONCAT(cpuNodeScopedTaskGuardBase, __LINE__), taskName)
#endif

#if defined(SELECTIVE_BUILD_ANALYZER)
# define CPU_LPT_SCOPE(region) OV_SCOPE(intel_cpu, region)
# define CPU_GRAPH_OPTIMIZER_SCOPE(region) OV_SCOPE(intel_cpu, region)
Expand Down
12 changes: 4 additions & 8 deletions src/plugins/intel_cpu/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <utility>
#include <vector>

#include "../../core/src/itt.hpp"
#include "cpu_memory.h"
#include "cpu_types.h"
#include "dnnl_extension_utils.h"
Expand Down Expand Up @@ -77,8 +76,7 @@ Node::Node(const std::shared_ptr<ov::Node>& op, GraphContext::CPtr ctx, const Sh
engine(context->getEngine()),
name(op->get_friendly_name()),
typeStr(op->get_type_name()),
type(TypeFromName(op->get_type_name())),
profiling(op->get_friendly_name()) {
type(TypeFromName(op->get_type_name())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we also need to initialize profiling with type name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

profiling (aka PerfCounters class object) does not accept arguments now

for (size_t i = 0; i < op->get_input_size(); i++) {
const auto& shape = op->get_input_partial_shape(i);
OPENVINO_ASSERT(!shape.rank().is_dynamic(),
Expand Down Expand Up @@ -196,7 +194,7 @@ Node::Node(const std::string& type,
std::vector<Shape> outShapes,
std::vector<ov::element::Type> inputPrecisions,
std::vector<ov::element::Type> outputPrecisions,
const std::string& name,
std::string name,
const GraphContext::CPtr& ctx)
: inputShapes(std::move(inShapes)),
outputShapes(std::move(outShapes)),
Expand All @@ -206,10 +204,9 @@ Node::Node(const std::string& type,
originalOutputPrecisions(std::move(outputPrecisions)),
fusingPort(-1),
engine(ctx->getEngine()),
name(name),
name(std::move(name)),
typeStr(type),
type(TypeFromName(type)),
profiling(name) {
type(TypeFromName(type)) {
parentEdges.reserve(inputShapes.size());
childEdges.reserve(outputShapes.size());
}
Expand Down Expand Up @@ -823,7 +820,6 @@ void Node::updateDynamicParams() {
}

void Node::execute(const dnnl::stream& strm, int numaId) {
OV_CPU_NODE_SCOPED_TASK_BASE(getTypeStr());
if (isDynamicNode()) {
executeDynamic(strm, numaId);
} else {
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/intel_cpu/src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ class Node {
struct Tag {};

struct PerfCounters {
explicit PerfCounters(const std::string& name)
: execute(openvino::itt::handle(name)),
PerfCounters()
: execute(openvino::itt::handle<Tag<Node, -1>>("Node::execute")),
getSupportedDescriptors(openvino::itt::handle<Tag<Node, 0>>("Node::getSupportedDescriptors")),
initSupportedPrimitiveDescriptors(
openvino::itt::handle<Tag<Node, 1>>("Node::initSupportedPrimitiveDescriptors")),
Expand All @@ -202,6 +202,7 @@ class Node {

template <typename NodeType>
void buildClassCounters(const std::string& type_name) {
execute = openvino::itt::handle<Tag<NodeType, -1>>(type_name + "::execute");
getSupportedDescriptors = openvino::itt::handle<Tag<NodeType, 0>>(type_name + "::getSupportedDescriptors");
initSupportedPrimitiveDescriptors =
openvino::itt::handle<Tag<NodeType, 1>>(type_name + "::initSupportedPrimitiveDescriptors");
Expand Down Expand Up @@ -730,7 +731,7 @@ class Node {
std::vector<Shape> outShapes,
std::vector<ov::element::Type> originalInputPrecisions,
std::vector<ov::element::Type> originalOutputPrecisions,
const std::string& name,
std::string name,
const GraphContext::CPtr& ctx);

int selectedPrimitiveDescriptorIndex = -1;
Expand Down
Loading