Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3fb50e5
itt regions
aobolensk Jul 25, 2025
8658219
region counter
aobolensk Jul 28, 2025
8adf99c
clang-format
aobolensk Jul 28, 2025
357fada
map tasks id to the parent region
aobolensk Jul 28, 2025
5d0c385
Fix group
aobolensk Aug 4, 2025
a412f20
fix parent ID
aobolensk Aug 5, 2025
3edfdae
Fix parent ID
aobolensk Aug 12, 2025
c2014cf
Propagate region d1
aobolensk Aug 12, 2025
64ce5cb
Trace Node::execute
aobolensk Aug 12, 2025
c9dfbb7
exec
aobolensk Aug 25, 2025
7161b74
Add base/full tracing
aobolensk Aug 27, 2025
95532f1
fmt
aobolensk Aug 27, 2025
c9ca0ca
cover CPU infer request
aobolensk Aug 27, 2025
1fbcd44
ci: ON -> FULL
aobolensk Aug 27, 2025
7e9b145
fix traces unit tests
aobolensk Aug 27, 2025
31d1e22
Fix regions in base tracing
aobolensk Sep 3, 2025
f428a79
infer request region
aobolensk Sep 5, 2025
785bd60
update docs & defaults
aobolensk Sep 8, 2025
6b78e44
fix style, build errors and make separate macros for base/full tracing
aobolensk Sep 8, 2025
10e26a2
try mutex
aobolensk Sep 9, 2025
53bf443
align domains naming
aobolensk Sep 10, 2025
860eb28
build issue fix
aobolensk Sep 23, 2025
bc3f0fe
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Sep 23, 2025
390bc72
Merge branch 'master' into itt-regions
aobolensk Sep 26, 2025
e7749d1
update ittapi
aobolensk Sep 29, 2025
7db7827
fixes part 1
aobolensk Oct 2, 2025
f775e5e
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Oct 2, 2025
9bc064c
itt x64 only
aobolensk Oct 2, 2025
5f6bbe9
Remove extra handle
aobolensk Oct 6, 2025
00aeb3d
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Oct 6, 2025
5da5e02
Address Eugeny's review comments
aobolensk Oct 6, 2025
687ea22
ops + dnn IIT with base
aobolensk Oct 6, 2025
f83b6dc
fix header
aobolensk Oct 7, 2025
1650109
Propagate Node events to base
aobolensk Oct 7, 2025
20a0c7c
move ittnotify.hpp to cpp
aobolensk Oct 7, 2025
f15a813
cover itt.cpp with guards
aobolensk Oct 7, 2025
3cfcf8d
fix CC after 'cover itt.cpp with guards'
aobolensk Oct 7, 2025
9b1cdca
allow domain & handle on non-initialized ITT
aobolensk Oct 7, 2025
cd4b399
Address comments
aobolensk Oct 8, 2025
85e1817
Address part of review comments
aobolensk Oct 27, 2025
f4f2a87
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Oct 27, 2025
eb589d4
clang-format
aobolensk Oct 27, 2025
3bd0d50
Remove extra comment
aobolensk Oct 27, 2025
0f3de31
clang-tidy
aobolensk Oct 27, 2025
f72daf2
Remove inter_request trace from core
aobolensk Oct 27, 2025
6e118a9
Address Egor's comments
aobolensk Oct 27, 2025
463df55
Remove tasks
aobolensk Oct 27, 2025
24f1645
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Oct 27, 2025
9caf40d
Revert conditional domain and handle init
aobolensk Oct 27, 2025
9d2418c
revert some
aobolensk Oct 27, 2025
3d6492a
reapply safe changes
aobolensk Oct 28, 2025
8cbc625
Revert "reapply safe changes"
aobolensk Oct 28, 2025
dc0b0fa
taskName -> regionName
aobolensk Oct 28, 2025
edf52c2
Merge remote-tracking branch 'origin/master' into itt-regions
aobolensk Oct 28, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 `
Expand Down
12 changes: 11 additions & 1 deletion cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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:\
Expand Down
2 changes: 1 addition & 1 deletion cmake/templates/OpenVINOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions docs/dev/conditional_compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
31 changes: 20 additions & 11 deletions src/common/itt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Loading
Loading