Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU] Use ITT regions API (#31499)

Arseniy Obolenskiyc6d55b9787fd
diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml
index 7ed415c1593..d70cd98a419 100644
--- a/.github/workflows/clang_tidy.yml
+++ b/.github/workflows/clang_tidy.yml
@@ -153,7 +153,7 @@ jobs:
cmake \
-G "${{ env.CMAKE_GENERATOR }}" \
-DENABLE_CLANG_TIDY=ON \
- -DENABLE_PROFILING_ITT=ON \
+ -DENABLE_PROFILING_ITT=FULL \
-DENABLE_DEBUG_CAPS=ON \
-DSELECTIVE_BUILD=COLLECT \
-DENABLE_PYTHON=OFF \
@@ -219,7 +219,7 @@ jobs:
cmake \
-G "${{ env.CMAKE_GENERATOR }}" \
-DENABLE_CLANG_TIDY=ON \
- -DENABLE_PROFILING_ITT=ON \
+ -DENABLE_PROFILING_ITT=FULL \
-DENABLE_DEBUG_CAPS=ON \
-DSELECTIVE_BUILD=COLLECT \
-DENABLE_PYTHON=OFF \
@@ -288,7 +288,7 @@ jobs:
-G "${{ env.CMAKE_GENERATOR }}" \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64-100-xuantie-gnu.toolchain.cmake \
-DENABLE_CLANG_TIDY=ON \
- -DENABLE_PROFILING_ITT=ON \
+ -DENABLE_PROFILING_ITT=FULL \
-DENABLE_DEBUG_CAPS=ON \
-DSELECTIVE_BUILD=COLLECT \
-DENABLE_PYTHON=OFF \
diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml
index ba0992c509a..dc59e598bc8 100644
--- a/.github/workflows/code_style.yml
+++ b/.github/workflows/code_style.yml
@@ -78,10 +78,10 @@ jobs:
submodules: 'true'
# Run cmake with extra options to cover as much source code as possible:
- # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector
+ # - -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector
# - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation
- name: CMake configure
- run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -B build
+ run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -B build
- name: Create code style diff
run: cmake --build build --target clang_format_fix_all -j8
@@ -110,10 +110,10 @@ jobs:
submodules: 'true'
# Run cmake with extra options to cover as much source code as possible:
- # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector
+ # - -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector
# - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation
- name: CMake configure
- run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -DCMAKE_TOOLCHAIN_FILE=cmake/arm64.toolchain.cmake -B build_arm64
+ run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -DCMAKE_TOOLCHAIN_FILE=cmake/arm64.toolchain.cmake -B build_arm64
- name: Create code style diff
run: cmake --build build_arm64 --target clang_format_fix_all -j8
@@ -142,7 +142,7 @@ jobs:
submodules: 'true'
- name: CMake configure
- run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64
+ run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64
- name: Create code style diff
run: cmake --build build_riscv64 --target clang_format_fix_all -j8
diff --git a/.github/workflows/linux_conditional_compilation.yml b/.github/workflows/linux_conditional_compilation.yml
index b88f9acdbb7..cade899693c 100644
--- a/.github/workflows/linux_conditional_compilation.yml
+++ b/.github/workflows/linux_conditional_compilation.yml
@@ -172,7 +172,7 @@ jobs:
-DENABLE_TESTS=ON \
-DENABLE_CPPLINT=OFF \
-DENABLE_NCC_STYLE=OFF \
- -DENABLE_PROFILING_ITT=ON \
+ -DENABLE_PROFILING_ITT=FULL \
-DSELECTIVE_BUILD=COLLECT \
-DENABLE_UNITY_BUILD=ON \
-DENABLE_DEBUG_CAPS=ON \
diff --git a/.github/workflows/windows_conditional_compilation.yml b/.github/workflows/windows_conditional_compilation.yml
index 5160c9a21d1..c5196767c21 100644
--- a/.github/workflows/windows_conditional_compilation.yml
+++ b/.github/workflows/windows_conditional_compilation.yml
@@ -177,7 +177,7 @@ jobs:
-DENABLE_TESTS=ON `
-DENABLE_CPPLINT=OFF `
-DENABLE_NCC_STYLE=OFF `
- -DENABLE_PROFILING_ITT=ON `
+ -DENABLE_PROFILING_ITT=FULL `
-DSELECTIVE_BUILD=COLLECT `
-DENABLE_UNITY_BUILD=ON `
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `
diff --git a/cmake/features.cmake b/cmake/features.cmake
index ebeaca5d3df..6789f5ce8be 100644
--- a/cmake/features.cmake
+++ b/cmake/features.cmake
@@ -54,7 +54,17 @@ ov_dependent_option (ENABLE_SNIPPETS_DEBUG_CAPS "enable Snippets debug capabilit
ov_dependent_option (ENABLE_SNIPPETS_LIBXSMM_TPP "allow Snippets to use LIBXSMM Tensor Processing Primitives" OFF "ENABLE_INTEL_CPU AND (X86_64 OR AARCH64)" OFF)
-ov_option (ENABLE_PROFILING_ITT "Build with ITT tracing. Optionally configure pre-built ittnotify library though INTEL_VTUNE_DIR variable." OFF)
+## ITT tracing level: OFF | BASE | FULL
+# OFF - no ITT backend linked; macros are no-ops
+# BASE - link ITT backend; only top-level API scopes are active (default)
+# FULL - link ITT backend; preserve full instrumentation (default prior behavior)
+if(X86_64)
+ set(ENABLE_PROFILING_ITT_DEFAULT BASE)
+else()
+ set(ENABLE_PROFILING_ITT_DEFAULT OFF)
+endif()
+ov_option_enum(ENABLE_PROFILING_ITT "ITT tracing mode: OFF | BASE | FULL" ${ENABLE_PROFILING_ITT_DEFAULT}
+ ALLOWED_VALUES OFF BASE FULL)
ov_option_enum(ENABLE_PROFILING_FILTER "Enable or disable ITT counter groups.\
Supported values:\
diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in
index 448ac9017e4..86ded0f8d2a 100644
--- a/cmake/templates/OpenVINOConfig.cmake.in
+++ b/cmake/templates/OpenVINOConfig.cmake.in
@@ -361,7 +361,7 @@ macro(_ov_find_itt)
set(_ENABLE_PROFILING_ITT "@ENABLE_PROFILING_ITT@")
# whether 'ittapi' is found via find_package
set(_ENABLE_SYSTEM_ITTAPI "@ittapi_FOUND@")
- if(_ENABLE_PROFILING_ITT AND _ENABLE_SYSTEM_ITTAPI)
+ if(NOT _ENABLE_PROFILING_ITT STREQUAL "OFF" AND _ENABLE_SYSTEM_ITTAPI)
_ov_find_dependency(ittapi)
endif()
unset(_ENABLE_PROFILING_ITT)
diff --git a/docs/articles_en/openvino-workflow/deployment-locally/optimial-binary-size-conditional-compilation.rst b/docs/articles_en/openvino-workflow/deployment-locally/optimial-binary-size-conditional-compilation.rst
index 0747fa87aab..9953a8f9f15 100644
--- a/docs/articles_en/openvino-workflow/deployment-locally/optimial-binary-size-conditional-compilation.rst
+++ b/docs/articles_en/openvino-workflow/deployment-locally/optimial-binary-size-conditional-compilation.rst
@@ -13,7 +13,7 @@ Lean more in the `conditional_compilation_guide <https://github.com/openvinotool
There are two steps to reduce binary size of the OpenVINO runtime library with conditional compilation:
-- Apply ``SELECTIVE_BUILD=COLLECT`` and ``DENABLE_PROFILING_ITT=ON`` build options to enable analysis mode of conditional compilation to collect statistics data using ``itt``.
+- Apply ``SELECTIVE_BUILD=COLLECT`` and ``DENABLE_PROFILING_ITT=FULL`` build options to enable analysis mode of conditional compilation to collect statistics data using ``itt``.
- Apply ``SELECTIVE_BUILD=ON`` and ``SELECTIVE_BUILD_STAT=<statistics_data.csv>`` build options to exclude inactive code region with the help of previous statistics data and get the final OpenVINO package.
@@ -35,7 +35,7 @@ Stage 1: collecting statistics information about code usage
git submodule init
git submodule update
mkdir build && cd build
- cmake -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT ..
+ cmake -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT ..
cmake --build .
- Build ITT collector for code usage analysis
@@ -239,7 +239,7 @@ Build OpenVINO with conditional compilation enabled:
cd %OPENVINO_HOME%
md build_cc
cd build_cc
- cmake -G Ninja -Wno-dev -DCMAKE_BUILD_TYPE=Debug -DENABLE_CPPLINT=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_FASTER_BUILD=ON -DENABLE_SANITIZER=OFF -DTHREADING=TBB -DBUILD_SHARED_LIBS=OFF -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DENABLE_INTEL_GPU=OFF -DENABLE_MULTI=OFF -DENABLE_AUTO=OFF -DENABLE_AUTO_BATCH=OFF -DENABLE_HETERO=OFF -DENABLE_TEMPLATE=OFF -DENABLE_OV_ONNX_FRONTEND=OFF -DENABLE_OV_PADDLE_FRONTEND=OFF -DENABLE_OV_PYTORCH_FRONTEND=OFF -DENABLE_OV_JAX_FRONTEND=OFF -DENABLE_OV_TF_FRONTEND=OFF -DCMAKE_INSTALL_PREFIX=install ..
+ cmake -G Ninja -Wno-dev -DCMAKE_BUILD_TYPE=Debug -DENABLE_CPPLINT=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_FASTER_BUILD=ON -DENABLE_SANITIZER=OFF -DTHREADING=TBB -DBUILD_SHARED_LIBS=OFF -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DENABLE_INTEL_GPU=OFF -DENABLE_MULTI=OFF -DENABLE_AUTO=OFF -DENABLE_AUTO_BATCH=OFF -DENABLE_HETERO=OFF -DENABLE_TEMPLATE=OFF -DENABLE_OV_ONNX_FRONTEND=OFF -DENABLE_OV_PADDLE_FRONTEND=OFF -DENABLE_OV_PYTORCH_FRONTEND=OFF -DENABLE_OV_JAX_FRONTEND=OFF -DENABLE_OV_TF_FRONTEND=OFF -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --config Debug
diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/auto-device-selection/debugging-auto-device.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/auto-device-selection/debugging-auto-device.rst
index eb0718b807f..be45c082638 100644
--- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/auto-device-selection/debugging-auto-device.rst
+++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/auto-device-selection/debugging-auto-device.rst
@@ -69,11 +69,11 @@ in which the ``LOG_LEVEL`` is represented by the first letter of its name (ERROR
Instrumentation and Tracing Technology
######################################
-All major performance calls of both OpenVINO™ Runtime and the AUTO plugin are instrumented with Instrumentation and Tracing Technology (ITT) APIs. To enable ITT in OpenVINO™ Runtime, compile it with the following option:
+All major performance calls of both OpenVINO™ Runtime and the AUTO plugin are instrumented with Instrumentation and Tracing Technology (ITT) APIs. ITT is enabled by default with BASE level tracing. For full instrumentation, compile with the following option:
.. code-block:: sh
- -DENABLE_PROFILING_ITT=ON
+ -DENABLE_PROFILING_ITT=FULL
For more information, you can refer to:
diff --git a/docs/dev/conditional_compilation.md b/docs/dev/conditional_compilation.md
index 64bfdb66ac1..5a3ba385598 100644
--- a/docs/dev/conditional_compilation.md
+++ b/docs/dev/conditional_compilation.md
@@ -19,9 +19,9 @@ However, conditional compilation has a significant drawback - the resulting Open
There are two conditional compilation build stages: `SELECTIVE_BUILD=COLLECT` and `SELECTIVE_BUILD=ON`.
-`SELECTIVE_BUILD=COLLECT` enables analysis mode for annotated code regions. It can be used to collect statistics data using `itt`. Once this stage is completed, run an OpenVINO sample, such as benchmark_app, to generate actual statistic data. Then run `itt_collector tool` to dump the data into csv files. This stage can be enabled during the OpenVINO build with the options `-DSELECTIVE_BUILD=COLLECT -DENABLE_PROFILING_ITT=ON`.
+`SELECTIVE_BUILD=COLLECT` enables analysis mode for annotated code regions. It can be used to collect statistics data using `itt`. Once this stage is completed, run an OpenVINO sample, such as benchmark_app, to generate actual statistic data. Then run `itt_collector tool` to dump the data into csv files. This stage can be enabled during the OpenVINO build with the options `-DSELECTIVE_BUILD=COLLECT -DENABLE_PROFILING_ITT=FULL`.
-`SELECTIVE_BUILD=ON` excludes all inactive annotated code regions from the compiled binaries using `csv files` generated by the `itt_collector tool`. It is done by a header file which generated from the `csv files`. This stage need build OpenVINO with option `-DSELECTIVE_BUILD=ON -DENABLE_PROFILING_ITT=OFF -DSELECTIVE_BUILD_STAT=<cc_data.csv>`. Notice: `-DENABLE_PROFILING_ITT=OFF` is not must, if user wants to have ITT counters in final application, he can set it ON: `-DENABLE_PROFILING_ITT=ON`.
+`SELECTIVE_BUILD=ON` excludes all inactive annotated code regions from the compiled binaries using `csv files` generated by the `itt_collector tool`. It is done by a header file which generated from the `csv files`. This stage need build OpenVINO with option `-DSELECTIVE_BUILD=ON -DENABLE_PROFILING_ITT=OFF -DSELECTIVE_BUILD_STAT=<cc_data.csv>`. Notice: `-DENABLE_PROFILING_ITT=OFF` is not must, if user wants to have ITT counters in final application, he can set it FULL: `-DENABLE_PROFILING_ITT=FULL`.
> **NOTE**: If the above options are not enabled, conditional compilation will be OFF and the default behavior is kept, all OpenVINO features are enabled. You can ignore `SELECTIVE_BUILD` or set option `-DSELECTIVE_BUILD=OFF`.
@@ -39,7 +39,7 @@ Conditional compilation has two stages:
```mermaid
flowchart LR
subgraph collect[Collect statistic]
- cmake_collect[mkdir build\ncd build\ncmake -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT ..]
+ cmake_collect[mkdir build\ncd build\ncmake -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT ..]
build_collect[cmake --build .\ncmake --build . --target sea_itt_lib]
run_collect["python ../thirdparty/itt_collector/runtool/sea_runtool.py --bindir ${OPENVINO_LIBRARY_DIR} \ \n-o ${MY_MODEL_RESULT} ! ./benchmark_app -niter 1 -nireq 1 -m ${MY_MODEL}.xml\n..."]
cmake_collect-->build_collect
@@ -57,7 +57,7 @@ flowchart LR
To apply conditional compilation, follow the steps below:
1. Perform code usage analysis:
- 1. Run the CMake tool with the following options: `-DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT`.
+ 1. Run the CMake tool with the following options: `-DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT`.
2. Select several models to be used in a specific application or target device.
3. Use the `sea_itt_lib` target to build the ITT collector.
4. Run the target application under the ITT collector for code usage analysis for each model. Statistics are generated in the `.csv` format.
diff --git a/src/common/conditional_compilation/docs/develop_cc_for_new_component.md b/src/common/conditional_compilation/docs/develop_cc_for_new_component.md
index 243276817f2..d089072a3f5 100644
--- a/src/common/conditional_compilation/docs/develop_cc_for_new_component.md
+++ b/src/common/conditional_compilation/docs/develop_cc_for_new_component.md
@@ -154,7 +154,7 @@ In the `SELECTIVE_BUILD=COLLECT` stage, or if it was not called, in the `SELECTI
```
cmake \
-DCMAKE_BUILD_TYPE=Release \
- -DENABLE_PROFILING_ITT=ON \
+ -DENABLE_PROFILING_ITT=FULL \
-DSELECTIVE_BUILD=COLLECT \
-B build \
-S .
diff --git a/src/common/itt/CMakeLists.txt b/src/common/itt/CMakeLists.txt
index 6c507e90156..bd6c61f6a7c 100644
--- a/src/common/itt/CMakeLists.txt
+++ b/src/common/itt/CMakeLists.txt
@@ -13,23 +13,32 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME itt)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::util)
-if(ENABLE_PROFILING_ITT)
+if(NOT ENABLE_PROFILING_ITT STREQUAL "OFF")
if(TARGET ittapi::ittnotify)
set(itt_dependency ittapi::ittnotify)
else()
set(itt_dependency ittapi::ittapi)
endif()
target_link_libraries(${TARGET_NAME} PUBLIC ${itt_dependency})
-
- if(ENABLE_PROFILING_FILTER STREQUAL "ALL")
- target_compile_definitions(${TARGET_NAME} PUBLIC
- ENABLE_PROFILING_ALL
- ENABLE_PROFILING_FIRST_INFERENCE)
- elseif(ENABLE_PROFILING_FILTER STREQUAL "FIRST_INFERENCE")
- target_compile_definitions(${TARGET_NAME} PUBLIC
- ENABLE_PROFILING_FIRST_INFERENCE)
- else()
- message(FATAL_ERROR "The ${ENABLE_PROFILING_FILTER} profiling filter isn't supported")
+ # Ensure the backend is compiled in this target when BASE or FULL
+ target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT)
+
+ # Define profiling mode-specific macros
+ if(ENABLE_PROFILING_ITT STREQUAL "BASE")
+ target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT_BASE)
+ elseif(ENABLE_PROFILING_ITT STREQUAL "FULL")
+ target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT_FULL)
+ # Only enable full ITT groups when FULL mode is selected.
+ if(ENABLE_PROFILING_FILTER STREQUAL "ALL")
+ target_compile_definitions(${TARGET_NAME} PUBLIC
+ ENABLE_PROFILING_ALL
+ ENABLE_PROFILING_FIRST_INFERENCE)
+ elseif(ENABLE_PROFILING_FILTER STREQUAL "FIRST_INFERENCE")
+ target_compile_definitions(${TARGET_NAME} PUBLIC
+ ENABLE_PROFILING_FIRST_INFERENCE)
+ else()
+ message(FATAL_ERROR "The ${ENABLE_PROFILING_FILTER} profiling filter isn't supported")
+ endif()
endif()
endif()
diff --git a/src/common/itt/include/openvino/itt.hpp b/src/common/itt/include/openvino/itt.hpp
index 4a22a388227..609f26ac02a 100644
--- a/src/common/itt/include/openvino/itt.hpp
+++ b/src/common/itt/include/openvino/itt.hpp
@@ -46,6 +46,8 @@ handle_t handle(const char* name);
void taskBegin(domain_t d, handle_t t);
void taskEnd(domain_t d);
void threadName(const char* name);
+void regionBegin(domain_t d, handle_t t);
+void regionEnd(domain_t d);
} // namespace internal
/**
* @endcond
@@ -99,7 +101,9 @@ handle_t handle(handle_t h) {
/**
* @class ScopedTask
* @ingroup ov_dev_profiling
- * @brief Used to annotate section of code which would be named at runtime
+ * @brief Used to annotate section of code which would be named at runtime.
+ * @note Uses ITT task begin/end. If a region is active on the
+ * current thread, tasks started within it are recorded as its children.
* @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
*/
template <domain_t (*domain)()>
@@ -122,6 +126,34 @@ struct ScopedTask {
ScopedTask& operator=(const ScopedTask&) = delete;
};
+/**
+ * @class ScopedRegion
+ * @ingroup ov_dev_profiling
+ * @brief Used to annotate region of code which would be named at runtime using RAII.
+ * @note Uses ITT region begin/end. At most one region is active per thread; tasks
+ * started while a region is active attach to it as their parent.
+ * @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
+ */
+template <domain_t (*domain)()>
+struct ScopedRegion {
+ /**
+ * @brief Construct ScopedRegion with defined annotation handle
+ */
+ ScopedRegion(handle_t handle) noexcept {
+ internal::regionBegin(domain(), handle);
+ }
+
+ /**
+ * @brief The ScopedRegion destructor closes or ends the region scope
+ */
+ ~ScopedRegion() noexcept {
+ internal::regionEnd(domain());
+ }
+
+ ScopedRegion(const ScopedRegion&) = delete;
+ ScopedRegion& operator=(const ScopedRegion&) = delete;
+};
+
/**
* @class TaskChain
* @ingroup ov_dev_profiling
@@ -233,6 +265,7 @@ public:
* @ingroup ov_dev_profiling
* @brief Annotate section of code till scope exit to be profiled using known @p handle or @p taskName as section id.
* @details In case if handle or taskName absent, the current function name is used.
+ * @note Implements a task scope
* @param group [in] ITT counter group name used for enabling/disabling at compile time.
* @param domainName [in] Known at compile time name of module or library (the domain name).
* @param handleOrTaskName [in] The annotation name or handle for section of code. Parameter is optional.
@@ -264,11 +297,62 @@ public:
* @ingroup ov_dev_profiling
* @brief Annotate section of code till scope exit to be profiled using known @p handle or @p taskName as section id.
* @details In case if handle or taskName absent, the current function name is used.
+ * @note Implements a task scope
* @param domainName [in] Known at compile time name of module or library (the domain name).
* @param handleOrTaskName [in] The annotation name or handle for section of code. Parameter is optional.
*/
#define OV_ITT_SCOPED_TASK(...) OV_ITT_SCOPE(ALL, __VA_ARGS__)
+/**
+ * @def OV_ITT_SCOPED_TASK_BASE(domain, handleOrTaskName)
+ * @ingroup ov_dev_profiling
+ * @brief Annotate section of code till scope exit for BASE/FULL modes regardless of profiling filter groups.
+ * @details In case if handle or taskName absent, the current function name is used.
+ * @param domain [in] Known at compile time name of module or library (the domain name).
+ * @param handleOrTaskName [in] The annotation name or handle for section of code. Parameter is optional.
+ */
+#define OV_ITT_SCOPED_TASK_BASE(...) OV_PP_OVERLOAD(OV_ITT_SCOPED_TASK_BASE, __VA_ARGS__)
+
+#define OV_ITT_SCOPED_TASK_BASE_1(domain) \
+ openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(ITT_FUNCTION_NAME));
+
+#define OV_ITT_SCOPED_TASK_BASE_2(domain, taskOrTaskName) \
+ openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(taskOrTaskName));
+
+/**
+ * @def OV_ITT_SCOPED_REGION_BASE(domain, handleOrRegionName)
+ * @ingroup ov_dev_profiling
+ * @brief Annotate region of code till scope exit for BASE/FULL modes regardless of profiling filter groups.
+ * @details In case if handle or regionName absent, the current function name is used.
+ * @note Implements a region scope (single-active per thread; tasks started within
+ * the region attach as children).
+ * @param domain [in] Known at compile time name of module or library (the domain name).
+ * @param handleOrRegionName [in] The annotation name or handle for section of code. Parameter is optional.
+ */
+#define OV_ITT_SCOPED_REGION_BASE(...) OV_PP_OVERLOAD(OV_ITT_SCOPED_REGION_BASE, __VA_ARGS__)
+
+#define OV_ITT_SCOPED_REGION_BASE_1(domain) \
+ openvino::itt::ScopedRegion<domain> OV_PP_CAT(ittScopedRegion, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Region, __LINE__)>(ITT_FUNCTION_NAME));
+
+#define OV_ITT_SCOPED_REGION_BASE_2(domain, regionOrRegionName) \
+ openvino::itt::ScopedRegion<domain> OV_PP_CAT(ittScopedRegion, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Region, __LINE__)>(regionOrRegionName));
+
+/**
+ * @def OV_ITT_SCOPED_REGION(group, domain, handleOrRegionName)
+ * @ingroup ov_dev_profiling
+ * @brief Annotate region of code till scope exit to be profiled using known @p handle or @p regionName as section id.
+ * @details In case if handle or regionName absent, the current function name is used.
+ * @param group [in] ITT counter group name used for enabling/disabling at compile time.
+ * @param domainName [in] Known at compile time name of module or library (the domain name).
+ * @param handleOrRegionName [in] The annotation name or handle for section of code. Parameter is optional.
+ */
+#define OV_ITT_SCOPED_REGION(group, ...) \
+ OV_PP_EXPAND(OV_PP_CAT(OV_ITT_SCOPED_REGION_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(__VA_ARGS__))
+
/**
* @def OV_ITT_TASK_CHAIN(chainId, domain, prefix, taskName)
* @ingroup ov_dev_profiling
@@ -391,5 +475,56 @@ public:
*/
#define OV_ITT_TASK_SKIP(chainId) OV_ITT_SCOPE_SKIP(ALL, chainId);
+/**
+ * @def OV_ITT_REGION_BEGIN(group, domain, handleOrRegionName)
+ * @ingroup ov_dev_profiling
+ * @brief Begin a region of code to be profiled using known @p handle or @p regionName as section id.
+ * @param group [in] ITT counter group name used for enabling/disabling at compile time.
+ * @param domain [in] Known at compile time name of module or library (the domain name).
+ * @param handleOrRegionName [in] The annotation name or handle for section of code.
+ */
+#define OV_ITT_REGION_BEGIN(group, domain, handleOrRegionName) \
+ OV_PP_EXPAND( \
+ OV_PP_CAT(OV_ITT_REGION_BEGIN_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(domain, handleOrRegionName))
+
+/**
+ * @def OV_ITT_REGION_END(group, domain, handleOrRegionName)
+ * @ingroup ov_dev_profiling
+ * @brief End a region of code to be profiled using known @p handle or @p regionName as section id.
+ * @param group [in] ITT counter group name used for enabling/disabling at compile time.
+ * @param domain [in] Known at compile time name of module or library (the domain name).
+ * @param handleOrRegionName [in] The annotation name or handle for section of code.
+ */
+#define OV_ITT_REGION_END(group, domain, handleOrRegionName) \
+ OV_PP_EXPAND(OV_PP_CAT(OV_ITT_REGION_END_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(domain, handleOrRegionName))
+
+/**
+ * @cond
+ */
+
+#define OV_ITT_REGION_BEGIN_IMPL_0(domain, handleOrRegionName)
+#define OV_ITT_REGION_BEGIN_IMPL_1(domain, handleOrRegionName) \
+ openvino::itt::internal::regionBegin( \
+ domain(), \
+ openvino::itt::handle<struct OV_PP_CAT(Region, __LINE__)>(handleOrRegionName));
+
+#define OV_ITT_REGION_END_IMPL_0(domain, ...)
+#define OV_ITT_REGION_END_IMPL_1(domain, ...) openvino::itt::internal::regionEnd(domain());
+
+#define OV_ITT_SCOPED_REGION_IMPL_0(...)
+#define OV_ITT_SCOPED_REGION_IMPL_1(...) OV_PP_OVERLOAD(OV_ITT_SCOPED_REGION, __VA_ARGS__)
+
+#define OV_ITT_SCOPED_REGION_1(domain) \
+ openvino::itt::ScopedRegion<domain> OV_PP_CAT(ittScopedRegion, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Region, __LINE__)>(ITT_FUNCTION_NAME));
+
+#define OV_ITT_SCOPED_REGION_2(domain, taskOrRegionName) \
+ openvino::itt::ScopedRegion<domain> OV_PP_CAT(ittScopedRegion, __LINE__)( \
+ openvino::itt::handle<struct OV_PP_CAT(Region, __LINE__)>(taskOrRegionName));
+
+/**
+ * @endcond
+ */
+
} // namespace itt
} // namespace openvino
diff --git a/src/common/itt/src/itt.cpp b/src/common/itt/src/itt.cpp
index 900c9175819..53ac19dcfa7 100644
--- a/src/common/itt/src/itt.cpp
+++ b/src/common/itt/src/itt.cpp
@@ -4,7 +4,10 @@
#include "openvino/itt.hpp"
+#include <atomic>
#include <cstdlib>
+#include <mutex>
+#include <vector>
#ifdef ENABLE_PROFILING_ITT
# include <ittnotify.h>
@@ -16,6 +19,12 @@ namespace internal {
#ifdef ENABLE_PROFILING_ITT
+static __itt_collection_state state = __itt_get_collection_state();
+
+static inline bool is_initialized() {
+ return state == __itt_collection_init_successful;
+}
+
static size_t callStackDepth() {
static const char* env = std::getenv("OPENVINO_TRACE_DEPTH");
static const size_t depth = env ? std::strtoul(env, nullptr, 10) : 0;
@@ -24,6 +33,15 @@ static size_t callStackDepth() {
static thread_local uint32_t call_stack_depth = 0;
+static uint64_t nextRegionId() {
+ static std::atomic<uint64_t> region_id_counter{1};
+ return region_id_counter.fetch_add(1, std::memory_order_relaxed);
+}
+
+static std::mutex region_mutex;
+static thread_local uint64_t current_region_counter = 0;
+static thread_local void* current_region_handle = nullptr;
+
domain_t domain(const char* name) {
return reinterpret_cast<domain_t>(__itt_domain_create(name));
}
@@ -33,22 +51,63 @@ handle_t handle(const char* name) {
}
void taskBegin(domain_t d, handle_t t) {
- if (!callStackDepth() || call_stack_depth++ < callStackDepth())
+ if (!is_initialized() || d == nullptr || t == nullptr) {
+ return;
+ }
+ if (!callStackDepth() || call_stack_depth++ < callStackDepth()) {
+ __itt_id parent_id =
+ current_region_counter != 0 ? __itt_id_make(current_region_handle, current_region_counter) : __itt_null;
__itt_task_begin(reinterpret_cast<__itt_domain*>(d),
__itt_null,
- __itt_null,
+ parent_id,
reinterpret_cast<__itt_string_handle*>(t));
+ }
}
void taskEnd(domain_t d) {
+ if (!is_initialized() || d == nullptr) {
+ return;
+ }
if (!callStackDepth() || --call_stack_depth < callStackDepth())
__itt_task_end(reinterpret_cast<__itt_domain*>(d));
}
void threadName(const char* name) {
+ if (!is_initialized()) {
+ return;
+ }
__itt_thread_set_name(name);
}
+void regionBegin(domain_t d, handle_t t) {
+ if (!is_initialized() || d == nullptr || t == nullptr) {
+ return;
+ }
+ std::lock_guard<std::mutex> lock(region_mutex);
+ auto region_counter = nextRegionId();
+ current_region_counter = region_counter;
+ current_region_handle = reinterpret_cast<void*>(t);
+ __itt_id region_id = __itt_id_make(current_region_handle, current_region_counter);
+ __itt_region_begin(reinterpret_cast<__itt_domain*>(d),
+ region_id,
+ __itt_null,
+ reinterpret_cast<__itt_string_handle*>(t));
+}
+
+void regionEnd(domain_t d) {
+ if (!is_initialized() || d == nullptr) {
+ return;
+ }
+ std::lock_guard<std::mutex> lock(region_mutex);
+ if (current_region_counter == 0)
+ return;
+
+ __itt_id region_id = __itt_id_make(current_region_handle, current_region_counter);
+ __itt_region_end(reinterpret_cast<__itt_domain*>(d), region_id);
+ current_region_counter = 0;
+ current_region_handle = nullptr;
+}
+
#else
domain_t domain(const char*) {
@@ -65,6 +124,10 @@ void taskEnd(domain_t) {}
void threadName(const char*) {}
+void regionBegin(domain_t, handle_t) {}
+
+void regionEnd(domain_t) {}
+
#endif // ENABLE_PROFILING_ITT
} // namespace internal
diff --git a/src/core/shape_inference/include/element_visitor.hpp b/src/core/shape_inference/include/element_visitor.hpp
index 42dcc857184..903dce04e87 100644
--- a/src/core/shape_inference/include/element_visitor.hpp
+++ b/src/core/shape_inference/include/element_visitor.hpp
@@ -15,7 +15,7 @@
namespace ov {
namespace itt {
namespace domains {
-OV_ITT_DOMAIN(ov_eval);
+OV_ITT_DOMAIN(ov_eval, "ov::eval");
} // namespace domains
} // namespace itt
diff --git a/src/core/src/itt.hpp b/src/core/src/itt.hpp
index 31b68de664a..37c6c192377 100644
--- a/src/core/src/itt.hpp
+++ b/src/core/src/itt.hpp
@@ -18,13 +18,13 @@
namespace ov {
namespace itt {
namespace domains {
-OV_ITT_DOMAIN(core);
-OV_ITT_DOMAIN(ov_pass);
-OV_ITT_DOMAIN(ov_op, "ov::Op");
+OV_ITT_DOMAIN(ov_core, "ov::core");
+OV_ITT_DOMAIN(ov_pass, "ov::pass");
+OV_ITT_DOMAIN(ov_op_exec, "ov::Op::exec");
} // namespace domains
} // namespace itt
} // namespace ov
-OV_CC_DOMAINS(ov_op);
+OV_CC_DOMAINS(ov_op_exec);
OV_CC_DOMAINS(ov_opset);
/*
@@ -32,41 +32,41 @@ OV_CC_DOMAINS(ov_opset);
* INSERT_OP macro allows to ignore some Operations inside OpSet if it's creation wasn't registered
*/
#if defined(SELECTIVE_BUILD_ANALYZER)
-# define OV_OP_SCOPE(region) OV_SCOPE(ov_op, region)
+# define OV_OP_SCOPE(region) OV_SCOPE(ov_op_exec, region)
# define REGISTER_OP(opset_name, op_name) \
OV_ITT_SCOPED_TASK(SIMPLE_ov_opset, openvino::itt::handle(opset_name + "_" + op_name))
# define INSERT_OP(opset_name, op_name, op_namespace) opset.insert<op_namespace::op_name>()
#elif defined(SELECTIVE_BUILD)
-# define OV_OP_SCOPE(region) \
- if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(ov_op, _, region)) == 0) \
- OPENVINO_THROW(std::string(OV_PP_TOSTRING(OV_PP_CAT3(ov_op, _, region))) + " is disabled!")
+# define OV_OP_SCOPE(region) \
+ if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(ov_op_exec, _, region)) == 0) \
+ OPENVINO_THROW(std::string(OV_PP_TOSTRING(OV_PP_CAT3(ov_op_exec, _, region))) + " is disabled!")
# define REGISTER_OP(opset_name, op_name)
# define INSERT_OP(opset_name, op_name, op_namespace) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT4(ov_opset_, opset_name, _, op_name)) == 1) \
opset.insert<op_namespace::op_name>()
#else
-# define OV_OP_SCOPE(region) OV_ITT_SCOPED_TASK(ov::itt::domains::ov_op, OV_PP_TOSTRING(region))
+# define OV_OP_SCOPE(region) OV_ITT_SCOPED_TASK(ov::itt::domains::ov_op_exec, OV_PP_TOSTRING(region))
# define REGISTER_OP(opset_name, op_name)
# define INSERT_OP(opset_name, op_name, op_namespace) opset.insert<op_namespace::op_name>()
#endif
#define OPENVINO_TYPE_CASE(region, a, ...) \
case ov::element::Type_t::a: { \
- OV_SCOPE(ov_op, OV_PP_CAT3(region, _, a)) { \
+ OV_SCOPE(ov_op_exec, OV_PP_CAT3(region, _, a)) { \
rc = evaluate<ov::element::Type_t::a>(__VA_ARGS__); \
} \
} break
#define OPENVINO_2_TYPES_CASE(region, a, b, ...) \
case element::Type_t::a: { \
- OV_SCOPE(ov_op, OV_PP_CAT4(region, _, a, b)) { \
+ OV_SCOPE(ov_op_exec, OV_PP_CAT4(region, _, a, b)) { \
rc = evaluate<element::Type_t::a, element::Type_t::b>(__VA_ARGS__); \
} \
} break
#define OPENVINO_COPY_TENSOR(region, a, ...) \
case ov::element::Type_t::a: { \
- OV_SCOPE(ov_op, OV_PP_CAT3(region, _, a)) { \
+ OV_SCOPE(ov_op_exec, OV_PP_CAT3(region, _, a)) { \
rc = copy_tensor<ov::element::Type_t::a>(__VA_ARGS__); \
} \
} break
diff --git a/src/core/src/model.cpp b/src/core/src/model.cpp
index 1c487adb29b..25e9ba6db59 100644
--- a/src/core/src/model.cpp
+++ b/src/core/src/model.cpp
@@ -47,7 +47,7 @@ void check_all_variables_registered(const std::vector<shared_ptr<ov::Node>>& ord
void check_all_parameters_registered(const std::vector<shared_ptr<ov::Node>>& ordered_ops,
const ov::ParameterVector& parameters) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::check_all_parameters_registered");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::check_all_parameters_registered");
std::stringstream unregistered_parameters;
for (auto& node : ordered_ops) {
@@ -61,7 +61,7 @@ void check_all_parameters_registered(const std::vector<shared_ptr<ov::Node>>& or
}
ov::op::util::VariableVector auto_detect_variables(const std::vector<std::shared_ptr<ov::Node>>& ordered_ops) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::auto_detect_variables");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::auto_detect_variables");
unordered_set<ov::op::util::Variable::Ptr> variables;
for (const auto& op : ordered_ops) {
if (const auto& variable_op = dynamic_pointer_cast<ov::op::util::VariableExtension>(op)) {
@@ -72,7 +72,7 @@ ov::op::util::VariableVector auto_detect_variables(const std::vector<std::shared
}
ov::ParameterVector auto_detect_parameters(const std::vector<std::shared_ptr<ov::Node>>& ordered_ops) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::auto_detect_parameters");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::auto_detect_parameters");
ov::ParameterVector parameter_vector;
for (const auto& op : ordered_ops) {
if (const auto& param = ov::as_type_ptr<ov::op::v0::Parameter>(op)) {
@@ -206,7 +206,7 @@ ov::Model::Model(const OutputVector& results, const string& name) : Model(result
ov::Model::~Model() = default;
void ov::Model::prerequirements(bool detect_variables, bool detect_parameters) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::prerequirements");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::prerequirements");
for (const auto& param : m_parameters) {
OPENVINO_ASSERT(param != nullptr, "Model is incorrect! Some Parameter operation equals to nullptr.");
@@ -239,7 +239,7 @@ void ov::Model::prerequirements(bool detect_variables, bool detect_parameters) {
}
void ov::Model::validate_nodes_and_infer_types() const {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::validate_nodes_and_infer_types");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::validate_nodes_and_infer_types");
std::stringstream unregistered_parameters;
std::stringstream unregistered_variables;
@@ -284,7 +284,7 @@ void ov::Model::validate_nodes_and_infer_types() const {
}
std::vector<shared_ptr<ov::Node>> ov::Model::get_ordered_ops() const {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Model::get_ordered_ops");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Model::get_ordered_ops");
lock_guard<mutex> lock(m_model_mutex);
NodeVector nodes;
diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp
index eb6ef40ed9f..3d530ada217 100644
--- a/src/core/src/node.cpp
+++ b/src/core/src/node.cpp
@@ -700,7 +700,7 @@ bool ov::Node::evaluate_symbol(TensorSymbolVector& output_symbols) const {
}
bool ov::Node::can_constant_fold(const OutputVector& input_values) const {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Node::can_constant_fold");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Node::can_constant_fold");
if (is_const_fold_disabled()) {
return false;
@@ -715,7 +715,7 @@ bool ov::Node::can_constant_fold(const OutputVector& input_values) const {
}
bool ov::Node::constant_fold(OutputVector& output_values, const OutputVector& input_values) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "Node::constant_fold");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "Node::constant_fold");
if (!Node::can_constant_fold(input_values)) {
return false;
diff --git a/src/core/src/pass/graph_rewrite.cpp b/src/core/src/pass/graph_rewrite.cpp
index 41348d8b62f..41c4154eaa0 100644
--- a/src/core/src/pass/graph_rewrite.cpp
+++ b/src/core/src/pass/graph_rewrite.cpp
@@ -52,7 +52,7 @@
* If MatcherPass register more than one node make sure that this nodes are registered in
* topological order. */
-#ifdef ENABLE_PROFILING_ITT
+#ifdef ENABLE_PROFILING_ITT_FULL
namespace ov {
namespace pass {
@@ -65,7 +65,7 @@ PerfCounters& perf_counters_graph_rewrite() {
} // namespace pass
} // namespace ov
-#endif // ENABLE_PROFILING_ITT
+#endif // ENABLE_PROFILING_ITT_FULL
std::shared_ptr<ov::pass::MatcherPass> ov::pass::GraphRewrite::add_matcher(
const std::shared_ptr<ov::pass::MatcherPass>& pass) {
auto pass_config = get_pass_config();
@@ -96,7 +96,7 @@ bool ov::pass::GraphRewrite::run_on_model(const std::shared_ptr<ov::Model>& f) {
bool ov::pass::GraphRewrite::apply_matcher_passes(std::shared_ptr<Model> f,
std::deque<std::weak_ptr<Node>> nodes_to_run) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "pass::GraphRewrite::apply_matcher_passes");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "pass::GraphRewrite::apply_matcher_passes");
bool rewritten = false;
const auto& pass_config = get_pass_config();
@@ -310,7 +310,7 @@ void ov::pass::MatcherPass::register_matcher(const std::shared_ptr<ov::pass::pat
}
bool ov::pass::MatcherPass::apply(std::shared_ptr<ov::Node> node) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, pass::perf_counters_graph_rewrite()[get_type_info()]);
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, pass::perf_counters_graph_rewrite()[get_type_info()]);
clear_new_nodes();
if (m_handler)
return m_handler(node);
diff --git a/src/core/src/pass/manager.cpp b/src/core/src/pass/manager.cpp
index 125c0aaffa5..7d9b8e33456 100644
--- a/src/core/src/pass/manager.cpp
+++ b/src/core/src/pass/manager.cpp
@@ -23,7 +23,7 @@
#include "openvino/util/log.hpp"
#include "perf_counters.hpp"
-#ifdef ENABLE_PROFILING_ITT
+#ifdef ENABLE_PROFILING_ITT_FULL
namespace ov {
namespace pass {
@@ -36,7 +36,7 @@ PerfCounters& perf_counters() {
} // namespace pass
} // namespace ov
-#endif // ENABLE_PROFILING_ITT
+#endif // ENABLE_PROFILING_ITT_FULL
namespace {
@@ -332,7 +332,7 @@ void ov::pass::Manager::set_per_pass_validation(bool new_state) {
}
bool ov::pass::Manager::run_passes(const std::shared_ptr<ov::Model>& model) {
- OV_ITT_SCOPED_TASK(ov::itt::domains::core, "pass::Manager::run_passes");
+ OV_ITT_SCOPED_TASK(ov::itt::domains::ov_core, "pass::Manager::run_passes");
Profiler profiler(m_name);
bool model_changed = false;
diff --git a/src/core/tests/conditional_compilation/ov_cc_on.cpp b/src/core/tests/conditional_compilation/ov_cc_on.cpp
index 7b252929341..bf0ee503971 100644
--- a/src/core/tests/conditional_compilation/ov_cc_on.cpp
+++ b/src/core/tests/conditional_compilation/ov_cc_on.cpp
@@ -24,7 +24,7 @@
using namespace std;
TEST(conditional_compilation, disabled_op_scope) {
-#define ov_op_Scope0 1
+#define ov_op_exec_Scope0 1
int n = 0;
// Simple Scope0 is enabled
@@ -34,7 +34,7 @@ TEST(conditional_compilation, disabled_op_scope) {
// Simple Scope1 is disabled and throws exception
ASSERT_THROW(OV_OP_SCOPE(Scope1), ov::Exception);
-#undef ov_op_Scope0
+#undef ov_op_exec_Scope0
}
TEST(conditional_compilation, disabled_Constant_in_opset) {
diff --git a/src/docs/performance_analysis_ITT_counters.md b/src/docs/performance_analysis_ITT_counters.md
index 64a92200cc8..1f941e7d887 100644
--- a/src/docs/performance_analysis_ITT_counters.md
+++ b/src/docs/performance_analysis_ITT_counters.md
@@ -13,7 +13,7 @@ OpenVINO has a powerful capabilities for performance analysis of the key stages,
## Performance analysis
For performance analysis, follow the steps below:
-1. Run the CMake tool with the following option: `-DENABLE_PROFILING_ITT=ON` and build OpenVINO.
+1. Run the CMake tool with the following option: `-DENABLE_PROFILING_ITT=FULL` and build OpenVINO.
2. Choose the tool for statistics collection using ITT counters.
1. [Intel Vtune Profiler](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/vtune-profiler.html)
diff --git a/src/inference/src/cpp/core.cpp b/src/inference/src/cpp/core.cpp
index dfdad3e569e..1f394b27da5 100644
--- a/src/inference/src/cpp/core.cpp
+++ b/src/inference/src/cpp/core.cpp
@@ -83,6 +83,7 @@ std::map<std::string, Version> Core::get_versions(const std::string& device_name
std::shared_ptr<ov::Model> Core::read_model(const std::wstring& model_path,
const std::wstring& bin_path,
const ov::AnyMap& properties) const {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Read model");
OV_CORE_CALL_STATEMENT(return _impl->read_model(ov::util::wstring_to_string(model_path),
ov::util::wstring_to_string(bin_path),
properties););
@@ -92,20 +93,24 @@ std::shared_ptr<ov::Model> Core::read_model(const std::wstring& model_path,
std::shared_ptr<ov::Model> Core::read_model(const std::string& model_path,
const std::string& bin_path,
const AnyMap& properties) const {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Read model");
OV_CORE_CALL_STATEMENT(return _impl->read_model(model_path, bin_path, properties););
}
std::shared_ptr<ov::Model> Core::read_model(const std::string& model, const ov::Tensor& weights) const {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Read model");
OV_CORE_CALL_STATEMENT(return _impl->read_model(model, weights););
}
CompiledModel Core::compile_model(const std::shared_ptr<const ov::Model>& model, const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
return compile_model(model, ov::DEFAULT_DEVICE_NAME, config);
}
CompiledModel Core::compile_model(const std::shared_ptr<const ov::Model>& model,
const std::string& device_name,
const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
OV_CORE_CALL_STATEMENT({
auto exec = _impl->compile_model(model, device_name, config);
return {exec._ptr, exec._so};
@@ -113,16 +118,19 @@ CompiledModel Core::compile_model(const std::shared_ptr<const ov::Model>& model,
}
CompiledModel Core::compile_model(const std::string& model_path, const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
return compile_model(model_path, ov::DEFAULT_DEVICE_NAME, config);
}
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
CompiledModel Core::compile_model(const std::wstring& model_path, const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
return compile_model(ov::util::wstring_to_string(model_path), config);
}
#endif
CompiledModel Core::compile_model(const std::string& model_path, const std::string& device_name, const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
OV_CORE_CALL_STATEMENT({
auto exec = _impl->compile_model(model_path, device_name, config);
return {exec._ptr, exec._so};
@@ -133,6 +141,7 @@ CompiledModel Core::compile_model(const std::string& model_path, const std::stri
CompiledModel Core::compile_model(const std::wstring& model_path,
const std::string& device_name,
const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
return compile_model(ov::util::wstring_to_string(model_path), device_name, config);
}
#endif
@@ -141,6 +150,7 @@ CompiledModel Core::compile_model(const std::string& model,
const ov::Tensor& weights,
const std::string& device_name,
const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
OV_CORE_CALL_STATEMENT({
auto exec = _impl->compile_model(model, weights, device_name, config);
return {exec._ptr, exec._so};
@@ -150,6 +160,7 @@ CompiledModel Core::compile_model(const std::string& model,
CompiledModel Core::compile_model(const std::shared_ptr<const ov::Model>& model,
const RemoteContext& context,
const AnyMap& config) {
+ OV_ITT_SCOPED_REGION_BASE(ov::itt::domains::OV, "Compile model");
OV_CORE_CALL_STATEMENT({
auto exec = _impl->compile_model(model, ov::SoPtr<ov::IRemoteContext>{context._impl, context._so}, config);
return {exec._ptr, exec._so};
diff --git a/src/inference/src/cpp/infer_request.cpp b/src/inference/src/cpp/infer_request.cpp
index 33e8b88a9fc..39869e9f344 100644
--- a/src/inference/src/cpp/infer_request.cpp
+++ b/src/inference/src/cpp/infer_request.cpp
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include "itt.hpp"
#include "openvino/core/except.hpp"
#include "openvino/core/node.hpp"
#include "openvino/runtime/compiled_model.hpp"
diff --git a/src/inference/src/itt.hpp b/src/inference/src/itt.hpp
index 2767092a04c..6a5ef7f773c 100644
--- a/src/inference/src/itt.hpp
+++ b/src/inference/src/itt.hpp
@@ -15,9 +15,9 @@
namespace ov {
namespace itt {
namespace domains {
-OV_ITT_DOMAIN(OV);
-OV_ITT_DOMAIN(ReadTime);
-OV_ITT_DOMAIN(LoadTime);
+OV_ITT_DOMAIN(OV, "ov");
+OV_ITT_DOMAIN(ReadTime, "ov::ReadTime");
+OV_ITT_DOMAIN(LoadTime, "ov::LoadTime");
} // namespace domains
} // namespace itt
} // namespace ov
diff --git a/src/plugins/intel_cpu/docs/selective_build.md b/src/plugins/intel_cpu/docs/selective_build.md
index e7811091240..0519d51ad9f 100644
--- a/src/plugins/intel_cpu/docs/selective_build.md
+++ b/src/plugins/intel_cpu/docs/selective_build.md
@@ -16,7 +16,7 @@ The selective build carries on under the instruction of:
The first build collects the information and generate a CSV file indicating which components are going to be included and which are going to be excluded in the selected build.
-* For the first build, config cmake with option "-DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT"
+* For the first build, config cmake with option "-DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT"
```
cd ./build
@@ -24,7 +24,7 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_CPU_DEBUG_CAPS=ON \
--DENABLE_PROFILING_ITT=ON \
+-DENABLE_PROFILING_ITT=FULL \
-DSELECTIVE_BUILD=COLLECT \
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
-DCMAKE_INSTALL_RPATH=`pwd`/install/runtime/3rdparty/tbb/lib:`pwd`/install/runtime/lib/intel64
diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp
index 8620ced8a5a..ed6a8ddb483 100644
--- a/src/plugins/intel_cpu/src/graph.cpp
+++ b/src/plugins/intel_cpu/src/graph.cpp
@@ -105,7 +105,7 @@ Graph::~Graph() {
template <typename NET>
void Graph::CreateGraph(NET& model, const GraphContext::CPtr& context) {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "CreateGraph");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "CreateGraph");
Init(model, context);
@@ -153,7 +153,7 @@ template void Graph::CreateGraph(const std::shared_ptr<const ov::Model>&, const
void Graph::Replicate(const std::shared_ptr<const ov::Model>& model,
const std::vector<node::Input::InputConfig>& inputConfigs,
const std::vector<node::Input::OutputConfig>& outputConfigs) {
- OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::intel_cpu_LT, "Graph::Replicate", "ov::Model");
+ OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::ov_intel_cpu_LT, "Graph::Replicate", "ov::Model");
this->_name = model->get_friendly_name();
@@ -300,7 +300,7 @@ void Graph::Replicate(const std::shared_ptr<const ov::Model>& model,
}
static std::vector<size_t> IdentifySyncPoints(const std::vector<NodePtr>& graphNodes) {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::IdentifySyncPoints");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::IdentifySyncPoints");
std::vector<size_t> syncNodesInds;
for (size_t i = 0; i < graphNodes.size(); ++i) {
@@ -332,7 +332,7 @@ static std::vector<size_t> IdentifySyncPoints(const std::vector<NodePtr>& graphN
static std::tuple<std::vector<NodePtr>, std::vector<size_t>> ExtractExecutableNodesAndSyncPoints(
const std::vector<size_t>& syncNodesInds,
const std::vector<NodePtr>& graphNodes) {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ExtractExecutableNodesAndSyncPoints");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::ExtractExecutableNodesAndSyncPoints");
std::unordered_map<size_t, size_t> graphIdToExecutableId;
std::vector<NodePtr> executableGraphNodes;
for (size_t i = 0; i < graphNodes.size(); i++) {
@@ -439,14 +439,14 @@ void Graph::Configure([[maybe_unused]] bool optimize) {
}
void Graph::InitNodes() {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::InitNodes");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::InitNodes");
for (auto& node : graphNodes) {
node->init();
}
}
void Graph::InitDescriptors() {
- OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::intel_cpu_LT, "InitDescriptors", "Prepare");
+ OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::ov_intel_cpu_LT, "InitDescriptors", "Prepare");
for (auto& node : graphNodes) {
OV_ITT_SCOPE_NEXT(FIRST_INFERENCE, taskChain, node->profiling.getSupportedDescriptors);
@@ -502,7 +502,7 @@ void Graph::InitDescriptors() {
}
void Graph::ResolveInplaceDirections() {
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Graph::ResolveInplaceDirections");
+ OV_ITT_SCOPED_TASK(itt::domains::ov_intel_cpu, "Graph::ResolveInplaceDirections");
for (auto& node : graphNodes) {
node->resolveInPlaceDirection();
@@ -510,9 +510,9 @@ void Graph::ResolveInplaceDirections() {
}
void Graph::InitOptimalPrimitiveDescriptors() {
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Graph::InitOptimalPrimitiveDescriptors");
+ OV_ITT_SCOPED_TASK(itt::domains::ov_intel_cpu, "Graph::InitOptimalPrimitiveDescriptors");
for (auto& node : graphNodes) {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, node->profiling.initOptimalPrimitiveDescriptor);
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, node->profiling.initOptimalPrimitiveDescriptor);
DEBUG_LOG("Init optimal primitive descriptors for node: ", node->getName());
node->initOptimalPrimitiveDescriptor();
DEBUG_LOG("#",
@@ -527,7 +527,7 @@ void Graph::InitOptimalPrimitiveDescriptors() {
}
void Graph::CreatePrimitivesAndExecConstants() const {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::CreatePrimitivesAndExecConstants");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::CreatePrimitivesAndExecConstants");
using shared_memory_ptr = WeightsSharing::SharedMemory::Ptr;
auto acquireSharedOutputs = [this](const NodePtr& node) {
@@ -555,7 +555,7 @@ void Graph::CreatePrimitivesAndExecConstants() const {
for (const auto& node : graphNodes) {
{
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, node->profiling.createPrimitive);
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, node->profiling.createPrimitive);
DEBUG_LOG(*node);
node->createPrimitive();
}
@@ -658,7 +658,7 @@ static std::unordered_set<std::string> getUniqueLayerNames(const std::vector<Nod
}
void Graph::ResolveEdgeConflicts() {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ResolveEdgeConflicts");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::ResolveEdgeConflicts");
std::unordered_set<std::string> uniqueLayerNames = getUniqueLayerNames(graphNodes);
@@ -695,7 +695,7 @@ void Graph::ResolveEdgeConflicts() {
}
void Graph::ResolveComplexInplaceConflicts() {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ResolveComplexInplaceConflicts");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::ResolveComplexInplaceConflicts");
auto numberOfEdges = static_cast<ptrdiff_t>(graphEdges.size());
@@ -1200,7 +1200,7 @@ void Graph::Allocate() {
}
bool Graph::ProcessDynNodes() const {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ProcessDynNodes");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::ProcessDynNodes");
const bool containsDynamicNodes = std::any_of(graphNodes.begin(), graphNodes.end(), [](const NodePtr& node) {
return node->isDynamicNode();
@@ -1593,11 +1593,11 @@ public:
/* 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(ittScope, (node)->profiling.execute); \
+#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()); \
DEBUG_LOG(*(node));
inline void Graph::ExecuteNode(const NodePtr& node, SyncInferRequest* request, int numaId) const {
@@ -1609,7 +1609,7 @@ inline void Graph::ExecuteNode(const NodePtr& node, SyncInferRequest* request, i
}
inline void Graph::ExecuteNodeWithCatch(const NodePtr& node, SyncInferRequest* request, int numaId) const {
- VERBOSE_PERF_DUMP_ITT_DEBUG_LOG(itt::domains::intel_cpu, node, getConfig());
+ VERBOSE_PERF_DUMP_ITT_DEBUG_LOG(itt::domains::ov_intel_cpu, node, getConfig());
try {
ExecuteNode(node, request, numaId);
@@ -1673,7 +1673,7 @@ void Graph::Infer(SyncInferRequest* request) {
}
void Graph::SortTopologically() {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::SortTopologically");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "Graph::SortTopologically");
// Set execIndex of all nodes to default invalid value
for (auto& node : graphNodes) {
diff --git a/src/plugins/intel_cpu/src/graph_optimizer.cpp b/src/plugins/intel_cpu/src/graph_optimizer.cpp
index d8fc29550e6..9b7d4a573dd 100644
--- a/src/plugins/intel_cpu/src/graph_optimizer.cpp
+++ b/src/plugins/intel_cpu/src/graph_optimizer.cpp
@@ -89,7 +89,7 @@ void GraphOptimizer::ApplyCommonGraphOptimizations(Graph& graph) {
// computing-intensive nodes. So Locate the FuseConvolutionAndZeroPoints() as the first optimization.
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE,
taskChain,
- itt::domains::intel_cpu_LT,
+ itt::domains::ov_intel_cpu_LT,
"ApplyCommonGraphOptimizations",
"FuseConvolutionAndZeroPoints");
FuseConvolutionAndZeroPoints(graph);
@@ -228,7 +228,7 @@ void GraphOptimizer::ApplyCommonGraphOptimizations(Graph& graph) {
}
void GraphOptimizer::ApplyImplSpecificGraphOptimizations(Graph& graph) {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "GraphOptimizer::ApplyImplSpecificGraphOptimizations");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "GraphOptimizer::ApplyImplSpecificGraphOptimizations");
TailNodesPrecisionOptimize(graph);
graph.RemoveDroppedNodes();
diff --git a/src/plugins/intel_cpu/src/infer_request.cpp b/src/plugins/intel_cpu/src/infer_request.cpp
index a7b19da3f7a..2556c9da699 100644
--- a/src/plugins/intel_cpu/src/infer_request.cpp
+++ b/src/plugins/intel_cpu/src/infer_request.cpp
@@ -103,8 +103,8 @@ void SyncInferRequest::update_external_tensor_ptrs() {
}
void SyncInferRequest::infer() {
- using namespace openvino::itt;
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, m_profiling_task);
+ OV_ITT_SCOPED_REGION_BASE(itt::domains::ov_intel_cpu,
+ std::string("SyncInferenceRequest:") + m_compiled_model.name());
auto graphLock = m_compiled_model.lock();
auto&& graph = graphLock._graph;
auto message = ov::threading::message_manager();
@@ -360,7 +360,7 @@ const ov::Output<const ov::Node>& SyncInferRequest::get_internal_port(const ov::
}
void SyncInferRequest::set_tensor(const ov::Output<const ov::Node>& in_port, const ov::SoPtr<ov::ITensor>& in_tensor) {
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "set_tensor");
+ OV_ITT_SCOPED_TASK(itt::domains::ov_intel_cpu, "set_tensor");
OPENVINO_ASSERT(in_tensor, "Failed to set empty tensor for port!");
auto port = get_internal_port(in_port);
auto tensor = in_tensor;
@@ -480,7 +480,7 @@ void SyncInferRequest::set_tensors_impl(const ov::Output<const ov::Node> port,
}
void SyncInferRequest::init_tensor(const std::size_t& port_index, const ov::ISyncInferRequest::FoundPort::Type& type) {
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "init_tensor");
+ OV_ITT_SCOPED_TASK(itt::domains::ov_intel_cpu, "init_tensor");
auto&& graph = m_compiled_model.graph();
OPENVINO_ASSERT(graph.IsReady(), "Graph is not ready!");
diff --git a/src/plugins/intel_cpu/src/itt.h b/src/plugins/intel_cpu/src/itt.h
index 8e6268bcda8..14c6af82272 100644
--- a/src/plugins/intel_cpu/src/itt.h
+++ b/src/plugins/intel_cpu/src/itt.h
@@ -16,23 +16,61 @@
#endif
#include <openvino/itt.hpp>
+#include <string>
+
+#include "../../core/src/itt.hpp"
namespace ov::intel_cpu::itt::domains {
-OV_ITT_DOMAIN(intel_cpu);
-OV_ITT_DOMAIN(intel_cpu_LT);
+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 : ScopedOpExecTask(openvino::itt::handle(name)) {}
+ explicit ScopedOpExecTask(const std::string& name) noexcept : ScopedOpExecTask(name.c_str()) {}
+ explicit ScopedOpExecTask(openvino::itt::handle_t handle) noexcept : m_handle(handle) {
+ openvino::itt::internal::taskBegin(::ov::itt::domains::ov_op_exec(), m_handle);
+ }
+ ~ScopedOpExecTask() noexcept {
+ 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)
#elif defined(SELECTIVE_BUILD)
# define CPU_LPT_SCOPE(region) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(intel_cpu, _, region)) == 0) \
- OPENVINO_THROW(std::string(OV_PP_TOSTRING(OV_PP_CAT3(ov_op, _, region))), " is disabled!")
+ OPENVINO_THROW(std::string(OV_PP_TOSTRING(OV_PP_CAT3(intel_cpu, _, region))), " is disabled!")
# define CPU_GRAPH_OPTIMIZER_SCOPE(region) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(intel_cpu, _, region)) == 0) \
OPENVINO_THROW(std::string(OV_PP_TOSTRING(OV_PP_CAT3(intel_cpu, _, region))), " is disabled!")
#else
-# define CPU_LPT_SCOPE(region) OV_ITT_SCOPED_TASK(ov::intel_cpu::itt::domains::intel_cpu, OV_PP_TOSTRING(region))
+# define CPU_LPT_SCOPE(region) OV_ITT_SCOPED_TASK(ov::intel_cpu::itt::domains::ov_intel_cpu, OV_PP_TOSTRING(region))
# define CPU_GRAPH_OPTIMIZER_SCOPE(region)
#endif
diff --git a/src/plugins/intel_cpu/src/node.cpp b/src/plugins/intel_cpu/src/node.cpp
index 9ea78e130ab..71c6fb1c68b 100644
--- a/src/plugins/intel_cpu/src/node.cpp
+++ b/src/plugins/intel_cpu/src/node.cpp
@@ -21,11 +21,13 @@
#include <utility>
#include <vector>
+#include "../../core/src/itt.hpp"
#include "cpu_memory.h"
#include "cpu_types.h"
#include "dnnl_extension_utils.h"
#include "edge.h"
#include "graph_context.h"
+#include "itt.h"
#include "memory_desc/cpu_memory_desc.h"
#include "memory_desc/cpu_memory_desc_utils.h"
#include "memory_desc/dnnl_blocked_memory_desc.h"
@@ -820,6 +822,7 @@ 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 {
diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp
index 8941f868642..c627f5a8672 100644
--- a/src/plugins/intel_cpu/src/plugin.cpp
+++ b/src/plugins/intel_cpu/src/plugin.cpp
@@ -314,7 +314,7 @@ static Config::ModelType getModelType(const std::shared_ptr<const Model>& model)
std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<const ov::Model>& model,
const ov::AnyMap& orig_config) const {
- OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Plugin::compile_model");
+ OV_ITT_SCOPED_TASK(itt::domains::ov_intel_cpu, "Plugin::compile_model");
CREATE_DEBUG_TIMER(debugLoadTimer);
// verification of supported input
@@ -731,7 +731,7 @@ static bool get_cache_decrypt_fn(const ov::AnyMap& config, CacheDecrypt& decrypt
}
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_stream, const ov::AnyMap& config) const {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "import_model");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "import_model");
CacheDecrypt decrypt{codec_xor};
auto decrypt_from_string = get_cache_decrypt_fn(config, decrypt);
@@ -744,7 +744,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_str
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& model_tensor,
const ov::AnyMap& config) const {
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "import_model");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "import_model");
CacheDecrypt decrypt{codec_xor};
auto decrypt_from_string = get_cache_decrypt_fn(config, decrypt);
diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
index eb032ae22ae..a408b93bcf7 100644
--- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
+++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
@@ -1045,7 +1045,7 @@ void Transformations::Lpt(const std::vector<ov::element::Type>& defaultPrecision
CPU_DEBUG_CAP_TRANSFORMATION_SCOPE(this, Lpt);
CPU_LPT_SCOPE(LowPrecisionTransformations_Part4);
- OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "LowPrecisionTransformations");
+ OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::ov_intel_cpu_LT, "LowPrecisionTransformations");
runLptPasses(defaultPrecisions);
}
diff --git a/tests/conditional_compilation/test_utils.py b/tests/conditional_compilation/test_utils.py
index 7b75a0c608f..bd8cd38fe9a 100644
--- a/tests/conditional_compilation/test_utils.py
+++ b/tests/conditional_compilation/test_utils.py
@@ -82,7 +82,7 @@ def make_build(openvino_root_dir, build_dir, install_dir, build_target: dict = N
build_target.keys()] if build_target else ""
nproc = multiprocessing.cpu_count()
cmd = (
- f"cmake -DENABLE_PROFILING_ITT=ON -DCMAKE_BUILD_TYPE=Release "
+ f"cmake -DENABLE_PROFILING_ITT=FULL -DCMAKE_BUILD_TYPE=Release "
f"-DPython3_EXECUTABLE={sys.executable} {additional_args_line}"
f"-S {openvino_root_dir} -B {build_dir} && "
f"cmake --build {build_dir} -j{nproc} && "
diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake
index d5e7698f5e9..371ea475b13 100644
--- a/thirdparty/dependencies.cmake
+++ b/thirdparty/dependencies.cmake
@@ -37,7 +37,7 @@ if(ENABLE_LTO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
endif()
-if(ENABLE_PROFILING_ITT)
+if(NOT ENABLE_PROFILING_ITT STREQUAL "OFF")
find_package(ittapi QUIET)
if(ittapi_FOUND)
if(TARGET ittapi::ittapi)
diff --git a/thirdparty/ittapi/ittapi b/thirdparty/ittapi/ittapi
index 8e526a82cc8..ca45fef1a12 160000
--- a/thirdparty/ittapi/ittapi
+++ b/thirdparty/ittapi/ittapi
@@ -1 +1 @@
-Subproject commit 8e526a82cc805665ef4513399aaea8a5dccfd66f
+Subproject commit ca45fef1a12cef3316e6ff362a4d36571270e392