From cf8ccb590a6d8753bb7e081d0403a098c762b234 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 21 Mar 2022 09:27:43 +0300 Subject: [PATCH 1/9] Removed obsolete code snippets (#11061) * Removed obsolete code snippets * NCC style * Fixed NCC for BA --- .../ncc_naming_style/ncc_naming_style.cmake | 7 +++- docs/Extensibility_UG/Intro.md | 2 +- .../low_precision_transformations/lpt.md | 2 +- docs/OV_Runtime_UG/Int8Inference.md | 2 +- docs/OV_Runtime_UG/PythonPackage_Overview.md | 14 ------- docs/OV_Runtime_UG/openvino_intro.md | 4 +- docs/documentation.md | 2 +- .../installing-openvino-linux.md | 2 +- .../installing-openvino-macos.md | 2 +- .../installing-openvino-windows.md | 2 +- docs/snippets/CMakeLists.txt | 32 ++++++++-------- docs/snippets/Graph_debug_capabilities0.cpp | 13 ------- docs/snippets/Graph_debug_capabilities1.cpp | 13 ------- docs/snippets/InferenceEngine_QueryAPI0.cpp | 10 ----- docs/snippets/InferenceEngine_QueryAPI1.cpp | 10 ----- docs/snippets/InferenceEngine_QueryAPI2.cpp | 10 ----- docs/snippets/InferenceEngine_QueryAPI3.cpp | 12 ------ docs/snippets/InferenceEngine_QueryAPI4.cpp | 12 ------ docs/snippets/InferenceEngine_QueryAPI5.cpp | 12 ------ docs/snippets/dldt_optimization_guide1.cpp | 16 -------- docs/snippets/dldt_optimization_guide2.cpp | 14 ------- docs/snippets/dldt_optimization_guide3.cpp | 22 ----------- docs/snippets/dldt_optimization_guide4.cpp | 20 ---------- docs/snippets/dldt_optimization_guide5.cpp | 30 --------------- docs/snippets/dldt_optimization_guide6.cpp | 24 ------------ docs/snippets/dldt_optimization_guide7.cpp | 15 -------- docs/snippets/example_async_infer_request.cpp | 20 +++++----- docs/snippets/movidius-programming-guide.cpp | 36 ------------------ docs/snippets/nGraphTutorial.cpp | 38 ------------------- samples/cpp/CMakeLists.txt | 2 +- samples/cpp/benchmark_app/README.md | 12 ++---- samples/cpp/benchmark_app/main.cpp | 10 ++--- samples/cpp/build_samples.sh | 4 +- samples/cpp/build_samples_msvc.bat | 4 +- samples/cpp/hello_reshape_ssd/main.cpp | 2 +- samples/cpp/speech_sample/main.cpp | 6 +-- .../model_creation_sample.py | 2 +- samples/scripts/README.txt | 8 ++-- samples/scripts/run_sample_benchmark_app.bat | 8 ++-- samples/scripts/run_sample_benchmark_app.sh | 6 +-- samples/scripts/run_sample_squeezenet.bat | 6 +-- samples/scripts/run_sample_squeezenet.sh | 4 +- 42 files changed, 75 insertions(+), 397 deletions(-) delete mode 100644 docs/OV_Runtime_UG/PythonPackage_Overview.md delete mode 100644 docs/snippets/Graph_debug_capabilities0.cpp delete mode 100644 docs/snippets/Graph_debug_capabilities1.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI0.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI1.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI2.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI3.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI4.cpp delete mode 100644 docs/snippets/InferenceEngine_QueryAPI5.cpp delete mode 100644 docs/snippets/dldt_optimization_guide1.cpp delete mode 100644 docs/snippets/dldt_optimization_guide2.cpp delete mode 100644 docs/snippets/dldt_optimization_guide3.cpp delete mode 100644 docs/snippets/dldt_optimization_guide4.cpp delete mode 100644 docs/snippets/dldt_optimization_guide5.cpp delete mode 100644 docs/snippets/dldt_optimization_guide6.cpp delete mode 100644 docs/snippets/dldt_optimization_guide7.cpp delete mode 100644 docs/snippets/movidius-programming-guide.cpp delete mode 100644 docs/snippets/nGraphTutorial.cpp diff --git a/cmake/developer_package/ncc_naming_style/ncc_naming_style.cmake b/cmake/developer_package/ncc_naming_style/ncc_naming_style.cmake index 53b14c02c89492..296552323b0412 100644 --- a/cmake/developer_package/ncc_naming_style/ncc_naming_style.cmake +++ b/cmake/developer_package/ncc_naming_style/ncc_naming_style.cmake @@ -23,7 +23,7 @@ execute_process( ERROR_VARIABLE error_var) if(NOT clang_find_result EQUAL "0") - message(WARNING "Please, install libclang-[N]-dev package (required for ncc naming style check)") + message(WARNING "Please, install clang-[N] libclang-[N]-dev package (required for ncc naming style check)") message(WARNING "find_package(Clang) output: ${output_var}") message(WARNING "find_package(Clang) error: ${error_var}") set(ENABLE_NCC_STYLE OFF) @@ -107,8 +107,11 @@ function(ov_ncc_naming_style) list(APPEND NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES "${NCC_STYLE_SOURCE_DIRECTORY}") + # without it sources with same name from different directories will map to same .ncc_style target + file(RELATIVE_PATH source_dir_rel ${CMAKE_SOURCE_DIR} ${NCC_STYLE_SOURCE_DIRECTORY}) + foreach(source IN LISTS sources) - set(output_file "${ncc_style_bin_dir}/${source}.ncc_style") + set(output_file "${ncc_style_bin_dir}/${source_dir_rel}/${source}.ncc_style") set(full_source_path "${NCC_STYLE_SOURCE_DIRECTORY}/${source}") add_custom_command( diff --git a/docs/Extensibility_UG/Intro.md b/docs/Extensibility_UG/Intro.md index f0df72daf47c81..1291060b2c53ac 100644 --- a/docs/Extensibility_UG/Intro.md +++ b/docs/Extensibility_UG/Intro.md @@ -116,5 +116,5 @@ After the build you can use path to your extension library to load your extensio ## See Also * [OpenVINO Transformations](./ov_transformations.md) -* [Using Inference Engine Samples](../OV_Runtime_UG/Samples_Overview.md) +* [Using OpenVINO Runtime Samples](../OV_Runtime_UG/Samples_Overview.md) * [Hello Shape Infer SSD sample](../../samples/cpp/hello_reshape_ssd/README.md) diff --git a/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/low_precision_transformations/lpt.md b/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/low_precision_transformations/lpt.md index dc7e2db4f78a62..28796f93d6e397 100644 --- a/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/low_precision_transformations/lpt.md +++ b/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/low_precision_transformations/lpt.md @@ -259,7 +259,7 @@ Result model depends on different factors: Information about layer precision is stored in the performance counters that are -available from the Inference Engine API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on CPU Plugin looks as follows: +available from the OpenVINO Runtime API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on CPU Plugin looks as follows: | layerName | execStatus | layerType | execType | realTime (ms) | cpuTime (ms) | diff --git a/docs/OV_Runtime_UG/Int8Inference.md b/docs/OV_Runtime_UG/Int8Inference.md index dc3806e058637a..bdfc41781b4fde 100644 --- a/docs/OV_Runtime_UG/Int8Inference.md +++ b/docs/OV_Runtime_UG/Int8Inference.md @@ -62,7 +62,7 @@ For 8-bit integer computations, a model must be quantized. Quantized models can ## Performance Counters Information about layer precision is stored in the performance counters that are -available from the Inference Engine API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on [CPU Plugin](supported_plugins/CPU.md) looks as follows: +available from the OpenVINO Runtime API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on [CPU Plugin](supported_plugins/CPU.md) looks as follows: | layerName | execStatus | layerType | execType | realTime (ms) | cpuTime (ms) | diff --git a/docs/OV_Runtime_UG/PythonPackage_Overview.md b/docs/OV_Runtime_UG/PythonPackage_Overview.md deleted file mode 100644 index 5e03eb3295cc51..00000000000000 --- a/docs/OV_Runtime_UG/PythonPackage_Overview.md +++ /dev/null @@ -1,14 +0,0 @@ -# OpenVINO™ Python* Package - -OpenVINO™ Python\* package includes types to measure model and calibrate to low precision. - -The OpenVINO™ Python\* package available in the `/python/python3.X` directory. - -The OpenVINO™ Python\* package includes the following sub-packages: - - - [openvino.inference_engine](../../src/bindings/python/docs/api_overview.md) - Python\* wrapper on OpenVINO™ Inference Engine. - - `openvino.tools.accuracy_checker` - Measure accuracy. - - `openvino.tools.benchmark` - Measure latency and throughput. - -## See Also -* [Integrate with Customer Application New API](integrate_with_your_application.md) diff --git a/docs/OV_Runtime_UG/openvino_intro.md b/docs/OV_Runtime_UG/openvino_intro.md index 01ee85e24348eb..82dd1379c3f32b 100644 --- a/docs/OV_Runtime_UG/openvino_intro.md +++ b/docs/OV_Runtime_UG/openvino_intro.md @@ -2,7 +2,7 @@ @sphinxdirective -.. _deep learning inference engine: +.. _deep learning openvino runtime: .. toctree:: :maxdepth: 1 @@ -45,6 +45,6 @@ The scheme below illustrates the typical workflow for deploying a trained deep l - * - **Inference Engine Concept**. Duration: 3:43 + * - **OpenVINO Runtime Concept**. Duration: 3:43 @endsphinxdirective diff --git a/docs/documentation.md b/docs/documentation.md index 6324d435dfa4d7..4730497de1806e 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -73,7 +73,7 @@ openvino_docs_Extensibility_UG_Intro openvino_docs_transformations - Inference Engine Plugin Developer Guide + OpenVINO Plugin Developer Guide groupie_dev_api Plugin Transformation Pipeline diff --git a/docs/install_guides/installing-openvino-linux.md b/docs/install_guides/installing-openvino-linux.md index 77c4462c93c0a5..a29b45377b3fa2 100644 --- a/docs/install_guides/installing-openvino-linux.md +++ b/docs/install_guides/installing-openvino-linux.md @@ -219,7 +219,7 @@ To uninstall the toolkit, follow the steps on the [Uninstalling page](uninstalli .. dropdown:: Additional Resources * Converting models for use with OpenVINO™: :ref:`Model Optimizer Developer Guide ` - * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` + * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` * Sample applications: :ref:`OpenVINO™ Toolkit Samples Overview ` * Pre-trained deep learning models: :ref:`Overview of OpenVINO™ Toolkit Pre-Trained Models ` * IoT libraries and code samples in the GitHUB repository: `Intel® IoT Developer Kit`_ diff --git a/docs/install_guides/installing-openvino-macos.md b/docs/install_guides/installing-openvino-macos.md index 383e56524b3bc9..81e4f01c25e54e 100644 --- a/docs/install_guides/installing-openvino-macos.md +++ b/docs/install_guides/installing-openvino-macos.md @@ -143,7 +143,7 @@ To uninstall the toolkit, follow the steps on the [Uninstalling page](uninstalli .. dropdown:: Additional Resources * Converting models for use with OpenVINO™: :ref:`Model Optimizer Developer Guide ` - * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` + * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` * Sample applications: :ref:`OpenVINO™ Toolkit Samples Overview ` * Pre-trained deep learning models: :ref:`Overview of OpenVINO™ Toolkit Pre-Trained Models ` * IoT libraries and code samples in the GitHUB repository: `Intel® IoT Developer Kit`_ diff --git a/docs/install_guides/installing-openvino-windows.md b/docs/install_guides/installing-openvino-windows.md index 0aa6244de66bd8..b3f5f7a0a32f60 100644 --- a/docs/install_guides/installing-openvino-windows.md +++ b/docs/install_guides/installing-openvino-windows.md @@ -180,7 +180,7 @@ To uninstall the toolkit, follow the steps on the [Uninstalling page](uninstalli .. dropdown:: Additional Resources * Converting models for use with OpenVINO™: :ref:`Model Optimizer Developer Guide ` - * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` + * Writing your own OpenVINO™ applications: :ref:`OpenVINO™ Runtime User Guide ` * Sample applications: :ref:`OpenVINO™ Toolkit Samples Overview ` * Pre-trained deep learning models: :ref:`Overview of OpenVINO™ Toolkit Pre-Trained Models ` * IoT libraries and code samples in the GitHUB repository: `Intel® IoT Developer Kit`_ diff --git a/docs/snippets/CMakeLists.txt b/docs/snippets/CMakeLists.txt index b9908896c8b3ec..8df0cc3f287d39 100644 --- a/docs/snippets/CMakeLists.txt +++ b/docs/snippets/CMakeLists.txt @@ -4,6 +4,13 @@ set(TARGET_NAME ie_docs_snippets) +if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) + ie_add_compiler_flags(-Wno-unused-variable) + if(CMAKE_COMPILER_IS_GNUCXX) + ie_add_compiler_flags(-Wno-unused-variable -Wno-unused-but-set-variable) + endif() +endif() + file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/gpu/*.cpp") @@ -57,9 +64,9 @@ endif() # remove OpenCV related sources if (ENABLE_OPENCV) - find_package(OpenCV QUIET) + find_package(OpenCV QUIET) else() - set(OpenCV_FOUND FALSE) + set(OpenCV_FOUND OFF) endif() if(NOT OpenCV_FOUND) @@ -102,30 +109,23 @@ if(ENABLE_OV_ONNX_FRONTEND) target_link_libraries(${TARGET_NAME} PRIVATE openvino_onnx_frontend) endif() -if(NOT MSVC) - target_compile_options(${TARGET_NAME} PRIVATE -Wno-unused-variable) - if(CMAKE_COMPILER_IS_GNUCXX) - target_compile_options(${TARGET_NAME} PRIVATE -Wno-unused-but-set-variable) - endif() -endif() - target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime openvino::runtime::dev) +ov_ncc_naming_style(FOR_TARGET "${TARGET_NAME}" + SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + +# +# Example +# + set(TARGET_NAME "ov_integration_snippet") # [cmake:integration_example] cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD 11) - find_package(OpenVINO REQUIRED) add_executable(${TARGET_NAME} src/main.cpp) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime) # [cmake:integration_example] -if(NOT MSVC) - target_compile_options(${TARGET_NAME} PRIVATE -Wno-unused-variable) - if(CMAKE_COMPILER_IS_GNUCXX) - target_compile_options(${TARGET_NAME} PRIVATE -Wno-unused-but-set-variable) - endif() -endif() diff --git a/docs/snippets/Graph_debug_capabilities0.cpp b/docs/snippets/Graph_debug_capabilities0.cpp deleted file mode 100644 index 02c6a2c153bab3..00000000000000 --- a/docs/snippets/Graph_debug_capabilities0.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - -int main() { -using namespace InferenceEngine; -//! [part0] -std::shared_ptr model; -// ... -ov::pass::VisualizeTree("after.png").run_on_model(model); // Visualize the nGraph function to an image -//! [part0] -return 0; -} diff --git a/docs/snippets/Graph_debug_capabilities1.cpp b/docs/snippets/Graph_debug_capabilities1.cpp deleted file mode 100644 index 5649ed5abfbeb6..00000000000000 --- a/docs/snippets/Graph_debug_capabilities1.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -int main() { -using namespace InferenceEngine; -//! [part1] -std::shared_ptr nGraph; -// ... -CNNNetwork network(nGraph); -network.serialize("test_ir.xml", "test_ir.bin"); -//! [part1] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI0.cpp b/docs/snippets/InferenceEngine_QueryAPI0.cpp deleted file mode 100644 index ebd1fdf30a3bad..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI0.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part0] -InferenceEngine::Core core; -std::vector availableDevices = core.GetAvailableDevices(); -//! [part0] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI1.cpp b/docs/snippets/InferenceEngine_QueryAPI1.cpp deleted file mode 100644 index 26c75cab0722bd..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI1.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part1] -InferenceEngine::Core core; -bool dumpDotFile = core.GetConfig("HETERO", HETERO_CONFIG_KEY(DUMP_GRAPH_DOT)).as(); -//! [part1] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI2.cpp b/docs/snippets/InferenceEngine_QueryAPI2.cpp deleted file mode 100644 index 473f217fa1f567..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI2.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part2] -InferenceEngine::Core core; -std::string cpuDeviceName = core.GetMetric("GPU", METRIC_KEY(FULL_DEVICE_NAME)).as(); -//! [part2] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI3.cpp b/docs/snippets/InferenceEngine_QueryAPI3.cpp deleted file mode 100644 index afd9f36948d031..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI3.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part3] -InferenceEngine::Core core; -auto network = core.ReadNetwork("sample.xml"); -auto exeNetwork = core.LoadNetwork(network, "CPU"); -auto nireq = exeNetwork.GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); -//! [part3] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI4.cpp b/docs/snippets/InferenceEngine_QueryAPI4.cpp deleted file mode 100644 index ee7476a76ee349..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI4.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part4] -InferenceEngine::Core core; -auto network = core.ReadNetwork("sample.xml"); -auto exeNetwork = core.LoadNetwork(network, "MYRIAD"); -float temperature = exeNetwork.GetMetric(METRIC_KEY(DEVICE_THERMAL)).as(); -//! [part4] -return 0; -} diff --git a/docs/snippets/InferenceEngine_QueryAPI5.cpp b/docs/snippets/InferenceEngine_QueryAPI5.cpp deleted file mode 100644 index 4297c886699cb9..00000000000000 --- a/docs/snippets/InferenceEngine_QueryAPI5.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part5] -InferenceEngine::Core core; -auto network = core.ReadNetwork("sample.xml"); -auto exeNetwork = core.LoadNetwork(network, "CPU"); -auto ncores = exeNetwork.GetConfig(PluginConfigParams::KEY_CPU_THREADS_NUM).as(); -//! [part5] -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide1.cpp b/docs/snippets/dldt_optimization_guide1.cpp deleted file mode 100644 index 91b44081351eaf..00000000000000 --- a/docs/snippets/dldt_optimization_guide1.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part1] -Core ie; -auto netReader = ie.ReadNetwork("sample.xml"); -InferenceEngine::InputsDataMap info(netReader.getInputsInfo()); -auto& inputInfoFirst = info.begin()->second; -for (auto& it : info) { - it.second->setPrecision(Precision::U8); -} -//! [part1] - -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide2.cpp b/docs/snippets/dldt_optimization_guide2.cpp deleted file mode 100644 index 97f6e28e3eebe9..00000000000000 --- a/docs/snippets/dldt_optimization_guide2.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part2] -//Lock Intel MSS surface -mfxFrameSurface1 *frame_in; //Input MSS surface. -mfxFrameAllocator* pAlloc = &m_mfxCore.FrameAllocator(); -pAlloc->Lock(pAlloc->pthis, frame_in->Data.MemId, &frame_in->Data); -//Inference Engine code -//! [part2] - -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide3.cpp b/docs/snippets/dldt_optimization_guide3.cpp deleted file mode 100644 index e3be0da706d940..00000000000000 --- a/docs/snippets/dldt_optimization_guide3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part3] -InferenceEngine::SizeVector dims_src = { - 1 /* batch, N*/, - (size_t) frame_in->Info.Height /* Height */, - (size_t) frame_in->Info.Width /* Width */, - 3 /*Channels,*/, - }; -InferenceEngine::TensorDesc desc(InferenceEngine::Precision::U8, dims_src, InferenceEngine::NHWC); -/* wrapping the surface data, as RGB is interleaved, need to pass only ptr to the R, notice that this wouldn’t work with planar formats as these are 3 separate planes/pointers*/ -InferenceEngine::TBlob::Ptr p = InferenceEngine::make_shared_blob( desc, (uint8_t*) frame_in->Data.R); -inferRequest.SetBlob("input", p); -inferRequest.Infer(); -//Make sure to unlock the surface upon inference completion, to return the ownership back to the Intel MSS -pAlloc->Unlock(pAlloc->pthis, frame_in->Data.MemId, &frame_in->Data); -//! [part3] - -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide4.cpp b/docs/snippets/dldt_optimization_guide4.cpp deleted file mode 100644 index 52396aa268bf3d..00000000000000 --- a/docs/snippets/dldt_optimization_guide4.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part4] -InferenceEngine::SizeVector dims_src = { - 1 /* batch, N*/, - 3 /*Channels,*/, - (size_t) frame_in->Info.Height /* Height */, - (size_t) frame_in->Info.Width /* Width */, - }; -TensorDesc desc(InferenceEngine::Precision::U8, dims_src, InferenceEngine::NCHW); -/* wrapping the RGBP surface data*/ -InferenceEngine::TBlob::Ptr p = InferenceEngine::make_shared_blob( desc, (uint8_t*) frame_in->Data.R); -inferRequest.SetBlob("input", p); -// … -//! [part4] - -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide5.cpp b/docs/snippets/dldt_optimization_guide5.cpp deleted file mode 100644 index a9226ecce3a489..00000000000000 --- a/docs/snippets/dldt_optimization_guide5.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include - -int main() { -InferenceEngine::InferRequest inferRequest; -//! [part5] -cv::Mat frame(cv::Size(100, 100), CV_8UC3); // regular CV_8UC3 image, interleaved -// creating blob that wraps the OpenCV’s Mat -// (the data it points should persists until the blob is released): -InferenceEngine::SizeVector dims_src = { - 1 /* batch, N*/, - (size_t)frame.rows /* Height */, - (size_t)frame.cols /* Width */, - (size_t)frame.channels() /*Channels,*/, - }; -InferenceEngine::TensorDesc desc(InferenceEngine::Precision::U8, dims_src, InferenceEngine::NHWC); -InferenceEngine::TBlob::Ptr p = InferenceEngine::make_shared_blob( desc, (uint8_t*)frame.data, frame.step[0] * frame.rows); -inferRequest.SetBlob("input", p); -inferRequest.Infer(); -// … -// similarly, you can wrap the output tensor (let’s assume it is FP32) -// notice that the output should be also explicitly stated as NHWC with setLayout -auto output_blob = inferRequest.GetBlob("output"); -const float* output_data = output_blob->buffer().as(); -auto dims = output_blob->getTensorDesc().getDims(); -cv::Mat res (dims[2], dims[3], CV_32FC3, (void *)output_data); -//! [part5] - -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide6.cpp b/docs/snippets/dldt_optimization_guide6.cpp deleted file mode 100644 index 5e5cd2de485297..00000000000000 --- a/docs/snippets/dldt_optimization_guide6.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part6] -InferenceEngine::Core ie; -auto network = ie.ReadNetwork("Model.xml", "Model.bin"); -InferenceEngine::InputsDataMap input_info(network.getInputsInfo()); - -auto executable_network = ie.LoadNetwork(network, "GPU"); -auto infer_request = executable_network.CreateInferRequest(); - -for (auto & item : input_info) { - std::string input_name = item.first; - auto input = infer_request.GetBlob(input_name); - /** Lock/Fill input tensor with data **/ - unsigned char* data = input->buffer().as::value_type*>(); - // ... -} - -infer_request.Infer(); -//! [part6] -return 0; -} diff --git a/docs/snippets/dldt_optimization_guide7.cpp b/docs/snippets/dldt_optimization_guide7.cpp deleted file mode 100644 index c2fdc529c37f2c..00000000000000 --- a/docs/snippets/dldt_optimization_guide7.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -int main() { -InferenceEngine::Core core; -auto network0 = core.ReadNetwork("sample.xml"); -auto network1 = core.ReadNetwork("sample.xml"); -//! [part7] -//these two networks go thru same plugin (aka device) and their requests will not overlap. -auto executable_network0 = core.LoadNetwork(network0, "CPU", - {{InferenceEngine::PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, InferenceEngine::PluginConfigParams::YES}}); -auto executable_network1 = core.LoadNetwork(network1, "GPU", - {{InferenceEngine::PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, InferenceEngine::PluginConfigParams::YES}}); -//! [part7] -return 0; -} diff --git a/docs/snippets/example_async_infer_request.cpp b/docs/snippets/example_async_infer_request.cpp index 782182f5caa5ef..ed3f880e4a8b62 100644 --- a/docs/snippets/example_async_infer_request.cpp +++ b/docs/snippets/example_async_infer_request.cpp @@ -12,11 +12,11 @@ class AcceleratorSyncRequest : public IInferRequestInternal { public: using Ptr = std::shared_ptr; - void Preprocess(); - void WriteToDevice(); - void RunOnDevice(); - void ReadFromDevice(); - void PostProcess(); + void preprocess(); + void write_to_device(); + void run_on_device(); + void read_from_device(); + void post_process(); }; // ! [async_infer_request:define_pipeline] @@ -40,19 +40,19 @@ class AcceleratorAsyncInferRequest : public AsyncInferRequestThreadSafeDefault { // Five pipeline stages of synchronous infer request are run by different executors _pipeline = { { _preprocessExecutor , [this] { - _accSyncRequest->Preprocess(); + _accSyncRequest->preprocess(); }}, { _writeToDeviceExecutor , [this] { - _accSyncRequest->WriteToDevice(); + _accSyncRequest->write_to_device(); }}, { _runOnDeviceExecutor , [this] { - _accSyncRequest->RunOnDevice(); + _accSyncRequest->run_on_device(); }}, { _readFromDeviceExecutor , [this] { - _accSyncRequest->ReadFromDevice(); + _accSyncRequest->read_from_device(); }}, { _postProcessExecutor , [this] { - _accSyncRequest->PostProcess(); + _accSyncRequest->post_process(); }}, }; } diff --git a/docs/snippets/movidius-programming-guide.cpp b/docs/snippets/movidius-programming-guide.cpp deleted file mode 100644 index 39f28ae254d51e..00000000000000 --- a/docs/snippets/movidius-programming-guide.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include - -int main() { -InferenceEngine::Core core; -int numRequests = 42; -int i = 1; -auto network = core.ReadNetwork("sample.xml"); -auto executable_network = core.LoadNetwork(network, "CPU"); -//! [part0] -struct Request { - InferenceEngine::InferRequest inferRequest; - int frameidx; -}; -//! [part0] - -//! [part1] -// numRequests is the number of frames (max size, equal to the number of VPUs in use) -std::vector request(numRequests); -//! [part1] - -//! [part2] -// initialize infer request pointer – Consult IE API for more detail. -request[i].inferRequest = executable_network.CreateInferRequest(); -//! [part2] - -//! [part3] -// Run inference -request[i].inferRequest.StartAsync(); -//! [part3] - -//! [part4] -request[i].inferRequest.SetCompletionCallback([] () {}); -//! [part4] - -return 0; -} diff --git a/docs/snippets/nGraphTutorial.cpp b/docs/snippets/nGraphTutorial.cpp deleted file mode 100644 index e39e783d5eb47c..00000000000000 --- a/docs/snippets/nGraphTutorial.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include "ngraph/opsets/opset.hpp" -#include "ngraph/opsets/opset3.hpp" - - -int main() { -//! [part0] - -using namespace std; -using namespace ngraph; - -auto arg0 = make_shared(element::f32, Shape{7}); -auto arg1 = make_shared(element::f32, Shape{7}); -// Create an 'Add' operation with two inputs 'arg0' and 'arg1' -auto add0 = make_shared(arg0, arg1); -auto abs0 = make_shared(add0); -// Create a node whose inputs/attributes will be specified later -auto acos0 = make_shared(); -// Create a node using opset factories -auto add1 = shared_ptr(get_opset3().create("Add")); -// Set inputs to nodes explicitly -acos0->set_argument(0, add0); -add1->set_argument(0, acos0); -add1->set_argument(1, abs0); - -// Create a graph with one output (add1) and four inputs (arg0, arg1) -auto ng_function = make_shared(OutputVector{add1}, ParameterVector{arg0, arg1}); -// Run shape inference on the nodes -ng_function->validate_nodes_and_infer_types(); - -//! [part0] - -//! [part1] -InferenceEngine::CNNNetwork net (ng_function); -//! [part1] - -return 0; -} diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 3433dee0e5ecc6..9a73582a73ec50 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -233,7 +233,7 @@ macro(ie_add_sample) endif() if(COMMAND ov_ncc_naming_style AND NOT c_sample) ov_ncc_naming_style(FOR_TARGET "${IE_SAMPLE_NAME}" - SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") endif() endmacro() diff --git a/samples/cpp/benchmark_app/README.md b/samples/cpp/benchmark_app/README.md index 11a3239a362a86..64be241a142c60 100644 --- a/samples/cpp/benchmark_app/README.md +++ b/samples/cpp/benchmark_app/README.md @@ -10,11 +10,7 @@ Performance can be measured for two inference modes: latency- and throughput-ori Upon start-up, the application reads command-line parameters and loads a network and inputs (images/binary files) to the specified device. - **NOTE**: By default, Inference Engine samples, tools and demos expect input with BGR channels order. - If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the sample or demo application - or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. - For more information about the argument, refer to **When to Reverse Input Channels** section of - [Converting a Model](../../../docs/MO_DG/prepare_model/convert_model/Converting_Model.md). +> **NOTE**: By default, OpenVINO Runtime samples, tools and demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the sample or demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model](../../../docs/MO_DG/prepare_model/convert_model/Converting_Model.md). Device-specific execution parameters (number of streams, threads, and so on) can be either explicitly specified through the command line or left default. In the last case, the sample logic will select the values for the optimal throughput. @@ -156,7 +152,7 @@ If a model has mixed input types, input folder should contain all required files To run the tool, you can use [public](@ref omz_models_group_public) or [Intel's](@ref omz_models_group_intel) pre-trained models from the Open Model Zoo. The models can be downloaded using the [Model Downloader](@ref omz_tools_downloader). -> **NOTE**: Before running the tool with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](../../../docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md). +> **NOTE**: Before running the tool with a trained model, make sure the model is converted to the OpenVINO IR (\*.xml + \*.bin) using the [Model Optimizer tool](../../../docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md). > > The sample accepts models in ONNX format (.onnx) that do not require preprocessing. @@ -173,7 +169,7 @@ This section provides step-by-step instructions on how to run the Benchmark Tool ```sh python3 downloader.py --name googlenet-v1 -o ``` -2. Convert the model to the Inference Engine IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format (which must be FP32 for CPU and FPG) and output directory to generate the IR files: +2. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format (which must be FP32 for CPU and FPG) and output directory to generate the IR files: ```sh mo --input_model /public/googlenet-v1/googlenet-v1.caffemodel --data_type FP32 --output_dir ``` @@ -243,6 +239,6 @@ Below are fragments of sample output static and dynamic networks: ``` ## See Also -* [Using Inference Engine Samples](../../../docs/OV_Runtime_UG/Samples_Overview.md) +* [Using OpenVINO Runtime Samples](../../../docs/OV_Runtime_UG/Samples_Overview.md) * [Model Optimizer](../../../docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md) * [Model Downloader](@ref omz_tools_downloader) diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index 3518ffc5eee514..f6fded1b22c833 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -32,7 +32,7 @@ static const size_t progressBarDefaultTotalCount = 1000; -bool ParseAndCheckCommandLine(int argc, char* argv[]) { +bool parse_and_check_command_line(int argc, char* argv[]) { // ---------------------------Parsing and validating input // arguments-------------------------------------- slog::info << "Parsing input parameters" << slog::endl; @@ -88,7 +88,7 @@ static void next_step(const std::string additional_info = "") { static size_t step_id = 0; static const std::map step_names = { {1, "Parsing and validating input arguments"}, - {2, "Loading Inference Engine"}, + {2, "Loading OpenVINO Runtime"}, {3, "Setting device configuration"}, {4, "Reading network files"}, {5, "Resizing network to match image sizes and given batch"}, @@ -151,7 +151,7 @@ int main(int argc, char* argv[]) { // ------------------------------------------------- next_step(); - if (!ParseAndCheckCommandLine(argc, argv)) { + if (!parse_and_check_command_line(argc, argv)) { return 0; } @@ -203,7 +203,7 @@ int main(int argc, char* argv[]) { /** This vector stores paths to the processed images with input names**/ auto inputFiles = parse_input_arguments(gflags::GetArgvs()); - // ----------------- 2. Loading the Inference Engine + // ----------------- 2. Loading the OpenVINO Runtime // ----------------------------------------------------------- next_step(); @@ -1089,7 +1089,7 @@ int main(int argc, char* argv[]) { if (!FLAGS_dump_config.empty()) { dump_config(FLAGS_dump_config, config); - slog::info << "Inference Engine configuration settings were dumped to " << FLAGS_dump_config << slog::endl; + slog::info << "OpenVINO Runtime configuration settings were dumped to " << FLAGS_dump_config << slog::endl; } if (!FLAGS_exec_graph_path.empty()) { diff --git a/samples/cpp/build_samples.sh b/samples/cpp/build_samples.sh index e3e97c7d59949d..c1c9536b5e12a6 100755 --- a/samples/cpp/build_samples.sh +++ b/samples/cpp/build_samples.sh @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 usage() { - echo "Build inference engine samples" + echo "Build OpenVINO Runtime samples" echo echo "Options:" echo " -h Print the help message" @@ -70,7 +70,7 @@ else fi if ! command -v cmake &>/dev/null; then - printf "\n\nCMAKE is not installed. It is required to build Inference Engine samples. Please install it. \n\n" + printf "\n\nCMAKE is not installed. It is required to build OpenVINO Runtime samples. Please install it. \n\n" exit 1 fi diff --git a/samples/cpp/build_samples_msvc.bat b/samples/cpp/build_samples_msvc.bat index bfa707d958c65e..259906a9420e5e 100644 --- a/samples/cpp/build_samples_msvc.bat +++ b/samples/cpp/build_samples_msvc.bat @@ -52,7 +52,7 @@ if exist "%SAMPLE_BUILD_DIR%\CMakeCache.txt" del "%SAMPLE_BUILD_DIR%\CMakeCache. cd /d "%ROOT_DIR%" && cmake -E make_directory "%SAMPLE_BUILD_DIR%" && cd /d "%SAMPLE_BUILD_DIR%" && cmake -G "Visual Studio 16 2019" -A %PLATFORM% "%ROOT_DIR%" echo. -echo ###############^|^| Build Inference Engine samples using MS Visual Studio (MSBuild.exe) ^|^|############### +echo ###############^|^| Build OpenVINO Runtime samples using MS Visual Studio (MSBuild.exe) ^|^|############### echo. echo cmake --build . --config Release @@ -65,7 +65,7 @@ echo Done. exit /b :usage -echo Build inference engine samples +echo Build OpenVINO Runtime samples echo. echo Options: echo -h Print the help message diff --git a/samples/cpp/hello_reshape_ssd/main.cpp b/samples/cpp/hello_reshape_ssd/main.cpp index 70646b03330a71..ad3dfdbea07fa3 100644 --- a/samples/cpp/hello_reshape_ssd/main.cpp +++ b/samples/cpp/hello_reshape_ssd/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) { const std::string device_name{argv[3]}; // ------------------------------------------------------------------- - // Step 1. Initialize inference engine core + // Step 1. Initialize OpenVINO Runtime core ov::Core core; // ------------------------------------------------------------------- diff --git a/samples/cpp/speech_sample/main.cpp b/samples/cpp/speech_sample/main.cpp index 7ebc4adde8c4ab..861058bf94cdeb 100644 --- a/samples/cpp/speech_sample/main.cpp +++ b/samples/cpp/speech_sample/main.cpp @@ -32,13 +32,13 @@ using namespace ov::preprocess; /** - * @brief The entry point for inference engine automatic speech recognition sample + * @brief The entry point for OpenVINO Runtime automatic speech recognition sample * @file speech_sample/main.cpp * @example speech_sample/main.cpp */ int main(int argc, char* argv[]) { try { - // ------------------------------ Get Inference Engine version ---------------------------------------------- + // ------------------------------ Get OpenVINO Runtime version ---------------------------------------------- slog::info << "OpenVINO runtime: " << ov::get_openvino_version() << slog::endl; // ------------------------------ Parsing and validation of input arguments --------------------------------- @@ -79,7 +79,7 @@ int main(int argc, char* argv[]) { } size_t numInputFiles(inputFiles.size()); - // --------------------------- Step 1. Initialize inference engine core and read model + // --------------------------- Step 1. Initialize OpenVINO Runtime core and read model // ------------------------------------- ov::Core core; slog::info << "Loading model files:" << slog::endl << FLAGS_m << slog::endl; diff --git a/samples/python/model_creation_sample/model_creation_sample.py b/samples/python/model_creation_sample/model_creation_sample.py index b652f06fae3371..33b796d83daba6 100755 --- a/samples/python/model_creation_sample/model_creation_sample.py +++ b/samples/python/model_creation_sample/model_creation_sample.py @@ -133,7 +133,7 @@ def main(): device_name = sys.argv[2] labels = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] number_top = 1 - # ---------------------------Step 1. Initialize inference engine core-------------------------------------------------- + # ---------------------------Step 1. Initialize OpenVINO Runtime Core-------------------------------------------------- log.info('Creating OpenVINO Runtime Core') core = Core() diff --git a/samples/scripts/README.txt b/samples/scripts/README.txt index a013aad62cce48..7d32960dfa075e 100644 --- a/samples/scripts/README.txt +++ b/samples/scripts/README.txt @@ -39,12 +39,12 @@ The sample illustrates the general workflow of using the Intel(R) Deep Learning - Downloads a public SqueezeNet model using the Model Downloader (extras\open_model_zoo\tools\downloader\downloader.py) - Installs all prerequisites required for running the Model Optimizer using the scripts from the "tools\model_optimizer\install_prerequisites" folder - Converts SqueezeNet to an IR using the Model Optimizer (tools\model_optimizer\mo.py) via the Model Converter (extras\open_model_zoo\tools\downloader\converter.py) - - Builds the Inference Engine classification_sample (samples\cpp\classification_sample) + - Builds the OpenVINO Runtime classification_sample (samples\cpp\classification_sample) - Runs the sample with the car.png picture located in the demo folder The sample application prints top-10 inference results for the picture. -For more information about the Inference Engine classification sample, refer to the documentation available in the sample folder. +For more information about the OpenVINO Runtime classification sample, refer to the documentation available in the sample folder. Benchmark Sample Using SqueezeNet =============================== @@ -56,9 +56,9 @@ The sample script does the following: - Downloads a public SqueezeNet model using the Model Downloader (extras\open_model_zoo\tools\downloader\downloader.py) - Installs all prerequisites required for running the Model Optimizer using the scripts from the "tools\model_optimizer\install_prerequisites" folder - Converts SqueezeNet to an IR using the Model Optimizer (tools\model_optimizer\mo.py) via the Model Converter (extras\open_model_zoo\tools\downloader\converter.py) - - Builds the Inference Engine benchmark tool (samples\benchmark_app) + - Builds the OpenVINO Runtime benchmark tool (samples\benchmark_app) - Runs the tool with the car.png picture located in the demo folder The benchmark app prints performance counters, resulting latency, and throughput values. -For more information about the Inference Engine benchmark app, refer to the documentation available in the sample folder. +For more information about the OpenVINO Runtime benchmark app, refer to the documentation available in the sample folder. diff --git a/samples/scripts/run_sample_benchmark_app.bat b/samples/scripts/run_sample_benchmark_app.bat index e92737076be0e0..c3c975251fe435 100644 --- a/samples/scripts/run_sample_benchmark_app.bat +++ b/samples/scripts/run_sample_benchmark_app.bat @@ -155,7 +155,7 @@ CALL :delay 7 :buildSample echo. -echo ###############^|^| Generate VS solution for Inference Engine samples using cmake ^|^|############### +echo ###############^|^| Generate VS solution for OpenVINO Runtime samples using cmake ^|^|############### echo. CALL :delay 3 @@ -173,7 +173,7 @@ if ERRORLEVEL 1 GOTO errorHandling CALL :delay 7 echo. -echo ###############^|^| Build Inference Engine samples using cmake ^|^|############### +echo ###############^|^| Build OpenVINO Runtime samples using cmake ^|^|############### echo. CALL :delay 3 @@ -186,7 +186,7 @@ CALL :delay 7 :runSample echo. -echo ###############^|^| Run Inference Engine benchmark app ^|^|############### +echo ###############^|^| Run OpenVINO Runtime benchmark app ^|^|############### echo. CALL :delay 3 copy /Y "%ROOT_DIR%%model_name%.labels" "%ir_dir%" @@ -198,7 +198,7 @@ benchmark_app.exe -i "%target_image_path%" -m "%ir_dir%\%model_name%.xml" -pc - if ERRORLEVEL 1 GOTO errorHandling echo. -echo ###############^|^| Inference Engine benchmark app completed successfully ^|^|############### +echo ###############^|^| OpenVINO Runtime benchmark app completed successfully ^|^|############### CALL :delay 10 cd /d "%ROOT_DIR%" diff --git a/samples/scripts/run_sample_benchmark_app.sh b/samples/scripts/run_sample_benchmark_app.sh index 65f9b7154e3292..d4f9875a5c9aa3 100755 --- a/samples/scripts/run_sample_benchmark_app.sh +++ b/samples/scripts/run_sample_benchmark_app.sh @@ -158,7 +158,7 @@ else fi # Step 3. Build samples -echo -ne "\n###############|| Build Inference Engine samples ||###############\n\n" +echo -ne "\n###############|| Build OpenVINO Runtime samples ||###############\n\n" OS_PATH=$(uname -m) NUM_THREADS="-j2" @@ -181,7 +181,7 @@ cmake -DCMAKE_BUILD_TYPE=Release "$samples_path" make $NUM_THREADS benchmark_app # Step 4. Run samples -echo -ne "\n###############|| Run Inference Engine benchmark app ||###############\n\n" +echo -ne "\n###############|| Run OpenVINO Runtime benchmark app ||###############\n\n" cd "$binaries_dir" @@ -189,4 +189,4 @@ cp -f "$ROOT_DIR/${model_name}.labels" "${ir_dir}/" print_and_run ./benchmark_app -d "$target" -i "$target_image_path" -m "${ir_dir}/${model_name}.xml" -pc "${sampleoptions[@]}" -echo -ne "\n###############|| Inference Engine benchmark app completed successfully ||###############\n\n" +echo -ne "\n###############|| OpenVINO Runtime benchmark app completed successfully ||###############\n\n" diff --git a/samples/scripts/run_sample_squeezenet.bat b/samples/scripts/run_sample_squeezenet.bat index 034d300feb31c1..944d3b21edb0e4 100644 --- a/samples/scripts/run_sample_squeezenet.bat +++ b/samples/scripts/run_sample_squeezenet.bat @@ -151,7 +151,7 @@ CALL :delay 7 :buildSample echo. -echo ###############^|^| Generate VS solution for Inference Engine samples using cmake ^|^|############### +echo ###############^|^| Generate VS solution for OpenVINO Runtime samples using cmake ^|^|############### echo. CALL :delay 3 @@ -169,7 +169,7 @@ if ERRORLEVEL 1 GOTO errorHandling CALL :delay 7 echo. -echo ###############^|^| Build Inference Engine samples using cmake ^|^|############### +echo ###############^|^| Build OpenVINO Runtime samples using cmake ^|^|############### echo. CALL :delay 3 @@ -182,7 +182,7 @@ CALL :delay 7 :runSample echo. -echo ###############^|^| Run Inference Engine classification sample ^|^|############### +echo ###############^|^| Run OpenVINO Runtime classification sample ^|^|############### echo. CALL :delay 3 copy /Y "%ROOT_DIR%%model_name%.labels" "%ir_dir%" diff --git a/samples/scripts/run_sample_squeezenet.sh b/samples/scripts/run_sample_squeezenet.sh index e429326f6d904f..01472e81b7752d 100755 --- a/samples/scripts/run_sample_squeezenet.sh +++ b/samples/scripts/run_sample_squeezenet.sh @@ -154,7 +154,7 @@ else fi # Step 3. Build samples -echo -ne "\n###############|| Build Inference Engine samples ||###############\n\n" +echo -ne "\n###############|| Build OpenVINO Runtime samples ||###############\n\n" OS_PATH=$(uname -m) NUM_THREADS="-j2" @@ -178,7 +178,7 @@ cmake -DCMAKE_BUILD_TYPE=Release "$samples_path" make $NUM_THREADS classification_sample_async # Step 4. Run sample -echo -ne "\n###############|| Run Inference Engine classification sample ||###############\n\n" +echo -ne "\n###############|| Run OpenVINO Runtime classification sample ||###############\n\n" cd "$binaries_dir" From 1e3f50ef2d99b30c25a29c19d088fae69a99730d Mon Sep 17 00:00:00 2001 From: Yuan Xu Date: Mon, 21 Mar 2022 15:45:41 +0800 Subject: [PATCH 2/9] fix a reference link (#11048) * updates * adding gna to linux * add missing reference * update * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev * update * minor updates * add gna item to yum and apt * add gna to get started page * update reference formatting * merge commit Co-authored-by: Sergey Lyubimtsev --- docs/install_guides/installing-openvino-docker-linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/install_guides/installing-openvino-docker-linux.md b/docs/install_guides/installing-openvino-docker-linux.md index f09d3f0fdbedd3..96bec59fca1df4 100644 --- a/docs/install_guides/installing-openvino-docker-linux.md +++ b/docs/install_guides/installing-openvino-docker-linux.md @@ -26,8 +26,10 @@ This guide provides steps on creating a Docker image with Intel® Distribution o To launch a Linux image on WSL2 when trying to run inferences on a GPU, make sure that the following requirements are met: - Only Windows 10 with 21H2 update or above installed and Windows 11 are supported. - - Intel GPU driver on Windows host with version 30.0.100.9684 or above need be installed. Please see [this article](https://www.intel.com/content/www/us/en/artificial-intelligence/harness-the-power-of-intel-igpu-on-your-machine.html#articleparagraph_983312434) for more details. + - Intel GPU driver on Windows host with version 30.0.100.9684 or above need be installed. Please see `this article`_ for more details. - From 2022.1 release, the Docker images contain preinstalled recommended version of OpenCL Runtime with WSL2 support. + + .. _this article: https://www.intel.com/content/www/us/en/artificial-intelligence/harness-the-power-of-intel-igpu-on-your-machine.html#articleparagraph_983312434 @endsphinxdirective From 33c0ee3bd2089473391b6dfbfe33823ab45f4297 Mon Sep 17 00:00:00 2001 From: Yuan Hu Date: Mon, 21 Mar 2022 15:59:32 +0800 Subject: [PATCH 3/9] AUTO and MULTI Doc update for release 2022.1 (#11066) * Update Auto plugin docs (#10623) * Update Auto plugin docs Revise auto plugin and auto plugin debugging articles. Include necessary image files. * Update docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/auto_device_selection.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/auto_device_selection.md Co-authored-by: Andrey Zaytsev * Update docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md Co-authored-by: Andrey Zaytsev * Update AutoPlugin_Debugging.md * include review corrections * Update auto_device_selection.md * Update auto_device_selection.md * Update auto_device_selection.md * Update auto_device_selection.md Co-authored-by: Andrey Zaytsev * [AUTOPLUGIN] update multi plugin document for ov2.0 (#10688) * update multi document Signed-off-by: Hu, Yuan2 * update Signed-off-by: Hu, Yuan2 * update snippets ov::enableProfile Signed-off-by: Hu, Yuan2 * fix build issue Signed-off-by: Hu, Yuan2 * use Anymap in snippets Signed-off-by: Hu, Yuan2 * fix format and set property Signed-off-by: Hu, Yuan2 * update python Signed-off-by: Hu, Yuan2 * try fo fix test document issue Signed-off-by: Hu, Yuan2 * removed NEW IE-CENTRIC API and upated set_property Signed-off-by: Hu, Yuan2 * update ov::optimal_number_of_infer_requests Signed-off-by: Hu, Yuan2 * Updated multi code snippets (#11037) * [Auto PLUGIN] update Auto docs (#10889) * update Auto docs Signed-off-by: Hu, Yuan2 * update python snippets Signed-off-by: Hu, Yuan2 * remove vpu, fix a mistaken in python code Signed-off-by: Hu, Yuan2 * update MYRIAD device full name Signed-off-by: Hu, Yuan2 * update API name old API use name Inference Engine API NEW API usen name OpenVINO Runtime API 2.0 Signed-off-by: Hu, Yuan2 * update tab name, and code format Signed-off-by: Hu, Yuan2 * fix AUTO4 format issue Signed-off-by: Hu, Yuan2 * update set_property code Signed-off-by: Hu, Yuan2 * auto draft Signed-off-by: Hu, Yuan2 * mv code into .cpp and .py modify the devicelist part accoding to the review Signed-off-by: Hu, Yuan2 * remove priority list in code and document modify the begning of the document remove perfomance data remove old API use compile_model instead of set_property add a image about cpu accelerate Signed-off-by: Hu, Yuan2 * fix mis print and code is not match document Signed-off-by: Hu, Yuan2 * try to fix doc build issue Signed-off-by: Hu, Yuan2 * fix snippets code compile issue Signed-off-by: Hu, Yuan2 * update sh scripts with ```sh``` Signed-off-by: Hu, Yuan2 Co-authored-by: Karol Blaszczak Co-authored-by: Andrey Zaytsev Co-authored-by: Ilya Lavrenov --- docs/OV_Runtime_UG/auto_device_selection.md | 360 +++++++----------- docs/OV_Runtime_UG/multi_device.md | 178 +++++---- .../supported_plugins/AutoPlugin_Debugging.md | 136 +++++++ ...plugins_AUTO_debugging-img01-localhost.png | 3 + ...ed_plugins_AUTO_debugging-img02-launch.png | 3 + ..._plugins_AUTO_debugging-img03-hotspots.png | 3 + ...gins_AUTO_debugging-img04-vtunesummary.png | 3 + ...ins_AUTO_debugging-img05-vtunebottomup.png | 3 + docs/img/autoplugin_accelerate.png | 3 + docs/snippets/AUTO0.cpp | 30 +- docs/snippets/AUTO1.cpp | 33 +- docs/snippets/AUTO2.cpp | 10 +- docs/snippets/AUTO3.cpp | 22 +- docs/snippets/AUTO4.cpp | 47 ++- docs/snippets/AUTO5.cpp | 25 +- docs/snippets/AUTO6.cpp | 20 + docs/snippets/MULTI0.cpp | 23 +- docs/snippets/MULTI1.cpp | 32 +- docs/snippets/MULTI2.cpp | 22 +- docs/snippets/MULTI3.cpp | 22 +- docs/snippets/MULTI4.cpp | 26 +- docs/snippets/MULTI5.cpp | 14 +- docs/snippets/ov_auto.py | 105 +++++ docs/snippets/ov_multi.py | 72 ++++ 24 files changed, 785 insertions(+), 410 deletions(-) create mode 100644 docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md create mode 100644 docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img01-localhost.png create mode 100644 docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img02-launch.png create mode 100644 docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img03-hotspots.png create mode 100644 docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img04-vtunesummary.png create mode 100644 docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img05-vtunebottomup.png create mode 100644 docs/img/autoplugin_accelerate.png create mode 100644 docs/snippets/AUTO6.cpp create mode 100644 docs/snippets/ov_auto.py create mode 100644 docs/snippets/ov_multi.py diff --git a/docs/OV_Runtime_UG/auto_device_selection.md b/docs/OV_Runtime_UG/auto_device_selection.md index cb13f6e965bae2..92880471450f9e 100644 --- a/docs/OV_Runtime_UG/auto_device_selection.md +++ b/docs/OV_Runtime_UG/auto_device_selection.md @@ -1,286 +1,222 @@ # Automatic device selection {#openvino_docs_IE_DG_supported_plugins_AUTO} -## Auto-Device Plugin Execution (C++) - @sphinxdirective -.. raw:: html - -
C++
-@endsphinxdirective - -The AUTO device is a new, special "virtual" or "proxy" device in the OpenVINO™ toolkit. - -Use "AUTO" as the device name to delegate selection of an actual accelerator to OpenVINO. The Auto-device plugin internally recognizes and selects devices from among CPU, integrated GPU and discrete Intel GPUs (when available) depending on the device capabilities and the characteristics of CNN models (for example, precision). Then the Auto-device assigns inference requests to the selected device. - -From the application's point of view, this is just another device that handles all accelerators in the full system. - -With the 2021.4 release, Auto-device setup is done in three major steps: -1. Configure each device as usual (for example, via the conventional `SetConfig()` method) -2. Load a network to the Auto-device plugin. This is the only change needed in your application. -3. As with any other executable network resulting from `LoadNetwork()`, create as many requests as needed to saturate the devices. - -These steps are covered below in detail. - -### Defining and Configuring the Auto-Device Plugin -Following the OpenVINO convention for devices names, the Auto-device uses the label "AUTO". The only configuration option for Auto-device is a limited device list: - -| Parameter name | Parameter values | Default | Description | -| :--- | :--- | :--- |:-----------------------------------------------------------------------------| -| "MULTI_DEVICE_PRIORITIES" | comma-separated device names with no spaces| N/A | Device candidate list to be selected | - -You can use the configuration name directly as a string or use `InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES` from `multi-device/multi_device_config.hpp`, which defines the same string. - -There are two ways to use Auto-device: -1. Directly indicate device by "AUTO" or an empty string: -@snippet snippets/AUTO0.cpp part0 - -2. Use the Auto-device configuration: -@snippet snippets/AUTO1.cpp part1 - -Both methods allow limiting the list of device candidates for the AUTO plugin. - -> **NOTE**: The OpenVINO Runtime lets you use "GPU" as an alias for "GPU.0" in function calls. - -The Auto-device plugin supports query device optimization capabilities in metric. -| Parameter name | Parameter values | -| :--- | :--- | -| "OPTIMIZATION_CAPABILITIES" | Auto-Device capabilities | +.. toctree:: + :maxdepth: 1 + :hidden: -### Enumerating Devices and Selection Logic + Debugging Auto-Device Plugin -The OpenVINO Runtime API now features a dedicated methods to enumerate devices and their capabilities. -See [Hello Query Device C++ Sample](../../samples/cpp/hello_query_device/README.md). -This is the example output from the sample (truncated to device names only): - -```sh -./hello_query_device -Available devices: - Device: CPU -... - Device: GPU.0 -... - Device: GPU.1 -``` - -### Default Auto-Device Selection Logic - -With the 2021.4 release, the Auto-Device selects the most suitable device using the following default logic: - -1. Check if dGPU (discrete), iGPU (integrated) and CPU devices are available -2. Get the precision of the input model, such as FP32 -3. According to the priority of dGPU, iGPU, and CPU (in this order), if the device supports the precision of the input network, select it as the most suitable device - -For example, CPU, dGPU and iGPU can support the following precision and optimization capabilities: - -| Device | OPTIMIZATION_CAPABILITIES | -| :--- | :--- | -| CPU | WINOGRAD FP32 FP16 INT8 BIN | -| dGPU | FP32 BIN BATCHED_BLOB FP16 INT8 | -| iGPU | FP32 BIN BATCHED_BLOB FP16 INT8 | - -* When the application uses the Auto-device to run FP16 IR on a system with CPU, dGPU and iGPU, Auto-device will offload this workload to dGPU. -* When the application uses the Auto-device to run FP16 IR on a system with CPU and iGPU, Auto-device will offload this workload to iGPU. -* When the application uses the Auto-device to run WINOGRAD-enabled IR on a system with CPU, dGPU and iGPU, Auto-device will offload this workload to CPU. - -In cases when loading the network to dGPU or iGPU fails, CPU is the fall-back choice. - -According to the Auto-device selection logic from the previous section, tell the OpenVINO Runtime -to use the most suitable device from available devices as follows: - -@snippet snippets/AUTO2.cpp part2 - -You can also use the Auto-device plugin to choose a device from a limited choice of devices, in this example CPU and GPU: - -@snippet snippets/AUTO3.cpp part3 +@endsphinxdirective -### Configuring the Individual Devices and Creating the Auto-Device on Top +Auto Device (or `AUTO` in short) is a new special "virtual" or "proxy" device in the OpenVINO toolkit, it doesn’t bind to a specific type of HW device. AUTO solves the complexity in application required to code a logic for the HW device selection (through HW devices) and then, on the deducing the best optimization settings on that device. It does this by self-discovering all available accelerators & capabilities in the system, matching to the user’s performance requirements by respecting new “hints” configuration API to dynamically optimize for latency or throughput respectively. Developer can write application once and deploy anywhere. +For developer who want to limit inference on specific HW candidates, AUTO also provide device priority list as optional property. After developer set device priority list, AUTO will not discover all available accelerators in the system and only try device in list with priority order. -It is possible to configure each individual device as usual and create the "AUTO" device on top: +AUTO always choose the best device, if compiling model fails on this device, AUTO will try to compile it on next best device until one of them succeeds. +If priority list is set, AUTO only select devices according to the list. -@snippet snippets/AUTO4.cpp part4 +The best device is chosen using the following logic: -Alternatively, you can combine all the individual device settings into single config file and load it, allowing the Auto-device plugin to parse and apply it to the right devices. See the code example here: +1. Check which supported devices are available. +2. Check the precision of the input model (for detailed information on precisions read more on the `ov::device::capabilities`) +3. Select the first device capable of supporting the given precision, as presented in the table below. +4. If the model’s precision is FP32 but there is no device capable of supporting it, offload the model to a device supporting FP16. -@snippet snippets/AUTO5.cpp part5 ++----------+------------------------------------------------------+-------------------------------------+ +| Choice || Supported || Supported | +| Priority || Device || model precision | ++==========+======================================================+=====================================+ +| 1 || dGPU | FP32, FP16, INT8, BIN | +| || (e.g. Intel® Iris® Xe MAX) | | ++----------+------------------------------------------------------+-------------------------------------+ +| 2 || iGPU | FP32, FP16, BIN | +| || (e.g. Intel® UHD Graphics 620 (iGPU)) | | ++----------+------------------------------------------------------+-------------------------------------+ +| 3 || Intel® Movidius™ Myriad™ X VPU | FP16 | +| || (e.g. Intel® Neural Compute Stick 2 (Intel® NCS2)) | | ++----------+------------------------------------------------------+-------------------------------------+ +| 4 || Intel® CPU | FP32, FP16, INT8, BIN | +| || (e.g. Intel® Core™ i7-1165G7) | | ++----------+------------------------------------------------------+-------------------------------------+ -### Using the Auto-Device with OpenVINO Samples and Benchmark App +What is important, **AUTO starts inference with the CPU by default except the priority list is set and there is no CPU in it**. CPU provides very low latency and can start inference with no additional delays. While it performs inference, the Auto-Device plugin continues to load the model to the device best suited for the purpose and transfers the task to it when ready. This way, the devices which are much slower in compile the model, GPU being the best example, do not impede inference at its initial stages. -Note that every OpenVINO sample or application that supports the "-d" (which stands for "device") command-line option transparently accepts the Auto-device. The Benchmark Application is the best example of the optimal usage of the Auto-device. You do not need to set the number of requests and CPU threads, as the application provides optimal out-of-the-box performance. Below is the example command-line to evaluate AUTO performance with that: +![autoplugin_accelerate] +This mechanism can be easily observed in our Benchmark Application sample ([see here](#Benchmark App Info)), showing how the first-inference latency (the time it takes to compile the model and perform the first inference) is reduced when using AUTO. For example: ```sh -benchmark_app –d AUTO –m +benchmark_app -m ../public/alexnet/FP32/alexnet.xml -d GPU -niter 128 ``` -You can also use the auto-device with limit device choice: - ```sh -benchmark_app –d AUTO:CPU,GPU –m +benchmark_app -m ../public/alexnet/FP32/alexnet.xml -d AUTO -niter 128 ``` -**NOTES:** -* The default CPU stream is 1 if using `-d AUTO`. -* You can use the FP16 IR to work with Auto-device. -* No demos are fully optimized for Auto-device yet to select the most suitable device, -use GPU streams/throttling, and so on. - -## Auto-Device Plugin Execution (Python) +Assume there are CPU and GPU on the machine, first-inference latency of "AUTO" will be better than "GPU". @sphinxdirective -.. raw:: html - -
Python
+.. note:: + The realtime performance will be closer to the best suited device the longer the process runs. @endsphinxdirective -The AUTO device is a new, special "virtual" or "proxy" device in the OpenVINO™ toolkit. - -Use "AUTO" as the device name to delegate selection of an actual accelerator to OpenVINO. The Auto-device plugin internally recognizes and selects devices from among CPU, integrated GPU and discrete Intel GPUs (when available) depending on the device capabilities and the characteristics of CNN models (for example, precision). Then the Auto-device assigns inference requests to the selected device. +## Using the Auto-Device Plugin -From the application's point of view, this is just another device that handles all accelerators in the full system. +Inference with AUTO is configured similarly to other plugins: compile the model on the plugin whth configuration, and finally, execute inference. -With the 2021.4 release, Auto-device setup is done in three major steps: +Following the OpenVINO™ naming convention, the Auto-Device plugin is assigned the label of “AUTO.” It may be defined with no additional parameters, resulting in defaults being used, or configured further with the following setup options: -1. Configure each device as usual (for example, via the conventional [IECore.set_config](https://docs.openvino.ai/latest/ie_python_api/classie__api_1_1IECore.html#a2c738cee90fca27146e629825c039a05) method). -2. Load a network to the Auto-device plugin. This is the only change needed in your application. -3. As with any other executable network resulting from [IECore.load_network](https://docs.openvino.ai/latest/ie_python_api/classie__api_1_1IECore.html#ac9a2e043d14ccfa9c6bbf626cfd69fcc), create as many requests as needed to saturate the devices. +@sphinxdirective ++---------------------------+-----------------------------------------------+-----------------------------------------------------------+ +| Property | Property values | Description | ++===========================+===============================================+===========================================================+ +| | | AUTO: | | Lists the devices available for selection. | +| | | comma-separated, no spaces | | The device sequence will be taken as priority | +| | | | | from high to low. | +| | | | | If not specified, “AUTO” will be used as default | +| | | | | and all devices will be included. | ++---------------------------+-----------------------------------------------+-----------------------------------------------------------+ +| ov::device:priorities | | device names | | Specifies the devices for Auto-Device plugin to select. | +| | | comma-separated, no spaces | | The device sequence will be taken as priority | +| | | | | from high to low. | +| | | | | This configuration is optional. | ++---------------------------+-----------------------------------------------+-----------------------------------------------------------+ +| ov::hint::performance_mode| | ov::hint::PerformanceMode::LATENCY | | Specifies the performance mode preferred | +| | | ov::hint::PerformanceMode::THROUGHPUT | | by the application. | ++---------------------------+-----------------------------------------------+-----------------------------------------------------------+ +| ov::hint::model_priority | | ov::hint::Priority::HIGH | | Indicates the priority for a model. | +| | | ov::hint::Priority::MEDIUM | | Importantly! | +| | | ov::hint::Priority::LOW | | This property is still not fully supported | ++---------------------------+-----------------------------------------------+-----------------------------------------------------------+ +@endsphinxdirective -These steps are covered below in detail. +### Device candidate list +The device candidate list allows users to customize the priority and limit the choice of devices available to the AUTO plugin. If not specified, the plugin assumes all the devices present in the system can be used. Note, that OpenVINO™ Runtime lets you use “GPU” as an alias for “GPU.0” in function calls. +The following commands are accepted by the API: -### Defining and Configuring the Auto-Device Plugin -Following the OpenVINO convention for devices names, the Auto-device uses the label "AUTO". The only configuration option for Auto-device is a limited device list: +@sphinxdirective -| Parameter name | Parameter values | Default | Description | -| -------------- | ---------------- | ------- | ----------- | -| "AUTO_DEVICE_LIST" | comma-separated device names with no spaces | N/A | Device candidate list to be selected +.. tab:: C++ -There are two ways to use the Auto-device plugin: + .. doxygensnippet:: docs/snippets/AUTO0.cpp + :language: cpp + :fragment: [part0] -1. Directly indicate device by "AUTO" or an empty string. -2. Use the Auto-device configuration +.. tab:: Python -Both methods allow limiting the list of device candidates for the AUTO plugin. + .. doxygensnippet:: docs/snippets/ov_auto.py + :language: python + :fragment: [part0] -```python -from openvino.inference_engine import IECore +@endsphinxdirective -ie = IECore() -# Read a network in IR or ONNX format -net = ie.read_network(model=path_to_model) +To check what devices are present in the system, you can use Device API. For information on how to do it, check [Query device properties and configuration](supported_plugins/config_properties.md) -# Load a network on the "AUTO" device -exec_net = ie.load_network(network=net, device_name="AUTO") +For C++ -# Optionally specify the list of device candidates for the AUTO plugin -# The following two lines are equivalent -exec_net = ie.load_network(network=net, device_name="AUTO:CPU,GPU") -exec_net = ie.load_network(network=net, device_name="AUTO", - config={"AUTO_DEVICE_LIST": "CPU,GPU"}) +```sh +ov::runtime::Core::get_available_devices() (see Hello Query Device C++ Sample) ``` -The Auto-device plugin supports query device optimization capabilities in metric. +For Python -| Parameter name | Parameter values | -| --- | --- | -| "OPTIMIZATION_CAPABILITIES" | Auto-Device capabilities | +```sh +openvino.runtime.Core.available_devices (see Hello Query Device Python Sample) +``` -### Enumerating Devices and Selection Logic +### Performance Hints +The `ov::hint::performance_mode` property enables you to specify a performance mode for the plugin to be more efficient for particular use cases. -The OpenVINO Runtime API now features a dedicated methods to enumerate devices and their capabilities. See the [Hello Query Device Python Sample](../../samples/python/hello_query_device/README.md) for code. +#### ov::hint::PerformanceMode::THROUGHPUT +This mode prioritizes high throughput, balancing between latency and power. It is best suited for tasks involving multiple jobs, like inference of video feeds or large numbers of images. -This is the example output from the sample (truncated to device names only): +#### ov::hint::PerformanceMode::LATENCY +This mode prioritizes low latency, providing short response time for each inference job. It performs best for tasks where inference is required for a single input image, like a medical analysis of an ultrasound scan image. It also fits the tasks of real-time or nearly real-time applications, such as an industrial robot's response to actions in its environment or obstacle avoidance for autonomous vehicles. +Note that currently the `ov::hint` property is supported by CPU and GPU devices only. -```python -./hello_query_device +To enable performance hints for your application, use the following code: +@sphinxdirective -Available devices: - Device: CPU -... - Device: GPU.0 -... - Device: GPU.1 -``` +.. tab:: C++ -### Default Auto-Device Selection Logic + .. doxygensnippet:: docs/snippets/AUTO3.cpp + :language: cpp + :fragment: [part3] + +.. tab:: Python -With the 2021.4 release, the Auto-Device selects the most suitable device using the following default logic: + .. doxygensnippet:: docs/snippets/ov_auto.py + :language: python + :fragment: [part3] -1. Check if dGPU (discrete), iGPU (integrated) and CPU devices are available -2. Get the precision of the input model, such as FP32 -3. According to the priority of dGPU, iGPU, and CPU (in this order), if the device supports the precision of the input network, select it as the most suitable device +@endsphinxdirective -For example, CPU, dGPU and iGPU can support the following precision and optimization capabilities: +### ov::hint::model_priority +The property enables you to control the priorities of models in the Auto-Device plugin. A high-priority model will be loaded to a supported high-priority device. A lower-priority model will not be loaded to a device that is occupied by a higher-priority model. -| Device | OPTIMIZATION_CAPABILITIES | -| --- | --- | -| CPU | WINOGRAD FP32 FP16 INT8 BIN | -| dGPU | FP32 BIN BATCHED_BLOB FP16 INT8 | -| iGPU | FP32 BIN BATCHED_BLOB FP16 INT8 | +@sphinxdirective -* When the application uses the Auto-device to run FP16 IR on a system with CPU, dGPU and iGPU, Auto-device will offload this workload to dGPU. -* When the application uses the Auto-device to run FP16 IR on a system with CPU and iGPU, Auto-device will offload this workload to iGPU. -* When the application uses the Auto-device to run WINOGRAD-enabled IR on a system with CPU, dGPU and iGPU, Auto-device will offload this workload to CPU. +.. tab:: C++ -In cases when loading the network to dGPU or iGPU fails, CPU is the fall-back choice. + .. doxygensnippet:: docs/snippets/AUTO4.cpp + :language: cpp + :fragment: [part4] + +.. tab:: Python -To show the capabilities for a specific device, query the OPTIMIZATION_CAPABILITIES metric: + .. doxygensnippet:: docs/snippets/ov_auto.py + :language: python + :fragment: [part4] +@endsphinxdirective -```python -from openvino.inference_engine import IECore +## Configuring Individual Devices and Creating the Auto-Device plugin on Top +Although the methods described above are currently the preferred way to execute inference with AUTO, the following steps can be also used as an alternative. It is currently available as a legacy feature and used if the device candidate list includes Myriad (devices uncapable of utilizing the Performance Hints option). -ie = IECore() -ie.get_metric(device_name=device, - metric_name="OPTIMIZATION_CAPABILITIES") -``` +@sphinxdirective -### Configuring the Individual Devices and Creating the Auto-Device on Top +.. tab:: C++ -It is possible to configure each individual device as usual and create the "AUTO" device on top: + .. doxygensnippet:: docs/snippets/AUTO5.cpp + :language: cpp + :fragment: [part5] + +.. tab:: Python -```python -from openvino.inference_engine import IECore + .. doxygensnippet:: docs/snippets/ov_auto.py + :language: python + :fragment: [part5] -ie = IECore() -net = ie.read_network(model=path_to_model) +@endsphinxdirective -cpu_config = {} -gpu_config = {} + +## Using AUTO with OpenVINO™ Samples and the Benchmark App +To see how the Auto-Device plugin is used in practice and test its performance, take a look at OpenVINO™ samples. All samples supporting the "-d" command-line option (which stands for "device") will accept the plugin out-of-the-box. The Benchmark Application will be a perfect place to start – it presents the optimal performance of the plugin without the need for additional settings, like the number of requests or CPU threads. To evaluate the AUTO performance, you can use the following commands: -ie.set_config(config=cpu_config, device_name="CPU") -ie.set_config(config=gpu_config, device_name="GPU") +For unlimited device choice: -# Load the network to the AUTO device -exec_net = ie.load_network(network=net, device_name="AUTO") +```sh +benchmark_app –d AUTO –m -i -niter 1000 ``` -Alternatively, you can combine all the individual device settings into single config file and load it, allowing the Auto-device plugin to parse and apply it to the right devices. See the code example here: +For limited device choice: -```python -from openvino.inference_engine import IECore - -# Init the Inference Engine Core -ie = IECore() - -# Read a network in IR or ONNX format -net = ie.read_network(model=path_to_model) +```sh +benchmark_app –d AUTO:CPU,GPU,MYRIAD –m -i -niter 1000 +``` -full_config = {} +For more information, refer to the [C++](../../samples/cpp/benchmark_app/README.md) or [Python](../../tools/benchmark_tool/README.md) version instructions. -# Load the network to the AUTO device -exec_net = ie.load_network(network=net, device_name="AUTO", config=full_config) -``` +@sphinxdirective +.. note:: -### Using the Auto-Device with OpenVINO Samples and Benchmark App + The default CPU stream is 1 if using “-d AUTO”. -Note that every OpenVINO sample or application that supports the "-d" (which stands for "device") command-line option transparently accepts the Auto-device. The Benchmark Application is the best example of the optimal usage of the Auto-device. You do not need to set the number of requests and CPU threads, as the application provides optimal out-of-the-box performance. Below is the example command-line to evaluate AUTO performance with that: + You can use the FP16 IR to work with auto-device. -```sh -benchmark_app –d AUTO –m -``` + No demos are yet fully optimized for AUTO, by means of selecting the most suitable device, using the GPU streams/throttling, and so on. +@endsphinxdirective -You can also use the auto-device with limit device choice: -```sh -benchmark_app –d AUTO:CPU,GPU –m -``` +[autoplugin_accelerate]: ../img/autoplugin_accelerate.png diff --git a/docs/OV_Runtime_UG/multi_device.md b/docs/OV_Runtime_UG/multi_device.md index b7d49eb8726ab8..1a6b6fdc563773 100644 --- a/docs/OV_Runtime_UG/multi_device.md +++ b/docs/OV_Runtime_UG/multi_device.md @@ -13,13 +13,13 @@ The Multi-Device plugin automatically assigns inference requests to available co * Improved throughput from using multiple devices (compared to single-device execution) * More consistent performance, since the devices share the inference burden (if one device is too busy, another can take more of the load) -Note that with Multi-Device the application logic is left unchanged, so you don't need to explicitly load the network to every device, create and balance the inference requests and so on. From the application point of view, this is just another device that handles the actual machinery. The only thing that is required to leverage performance is to provide the multi-device (and hence the underlying devices) with enough inference requests to process. For example, if you were processing 4 cameras on the CPU (with 4 inference requests), it might be desirable to process more cameras (with more requests in flight) to keep CPU and GPU busy via Multi-Device. +Note that with Multi-Device the application logic is left unchanged, so you don't need to explicitly compile the model on every device, create and balance the inference requests and so on. From the application point of view, this is just another device that handles the actual machinery. The only thing that is required to leverage performance is to provide the multi-device (and hence the underlying devices) with enough inference requests to process. For example, if you were processing 4 cameras on the CPU (with 4 inference requests), it might be desirable to process more cameras (with more requests in flight) to keep CPU and GPU busy via Multi-Device. The setup of Multi-Device can be described in three major steps: -1. Configure each device as usual. -2. Load the network to the Multi-Device plugin created on top of a (prioritized) list of the configured devices. This is the only change needed in the application. -3. As with any other ExecutableNetwork call (resulting from `InferenceEngine::Core::LoadNetwork`), you create as many requests as needed to saturate the devices. +1. Prepare configure for each device. +2. Compile the model on the Multi-Device plugin created on top of a (prioritized) list of the configured devices with the configure prepared in step one. +3. As with any other CompiledModel call (resulting from `compile_model`), you create as many requests as needed to saturate the devices. These steps are covered below in detail. @@ -29,17 +29,33 @@ Following the OpenVINO™ convention of labeling devices, the Multi-Device plugi | Parameter name | Parameter values | Default | Description | | -------------- | ---------------- | --- | --- | -| "MULTI_DEVICE_PRIORITIES" | comma-separated device names with no spaces | N/A | Prioritized list of devices | +| ov::device::priorities | comma-separated device names with no spaces | N/A | Prioritized list of devices | -You can set the configuration directly as a string, or use the metric key `MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES from the `multi/multi_device_config.hpp` file, which defines the same string. +You can set the priorities directly as a string. Basically, there are three ways to specify the devices to be use by the "MULTI": -@snippet snippets/MULTI0.cpp part0 +@sphinxdirective + +.. tab:: C++ -Notice that the priorities of the devices can be changed in real time for the executable network: + .. doxygensnippet:: docs/snippets/MULTI0.cpp + :language: cpp + :fragment: [part0] -@snippet snippets/MULTI1.cpp part1 +@endsphinxdirective + +Notice that the priorities of the devices can be changed in real time for the compiled model: + +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/MULTI1.cpp + :language: cpp + :fragment: [part1] + +@endsphinxdirective Finally, there is a way to specify number of requests that the Multi-Device will internally keep for each device. Suppose your original app was running 4 cameras with 4 inference requests. You would probably want to share these 4 requests between 2 devices used in MULTI. The easiest way is to specify a number of requests for each device using parentheses: "MULTI:CPU(2),GPU(2)" and use the same 4 requests in your app. However, such an explicit configuration is not performance-portable and hence not recommended. Instead, the better way is to configure the individual devices and query the resulting number of requests to be used at the application level (see [Configuring the Individual Devices and Creating the Multi-Device On Top](#configuring-the-individual-devices-and-creating-the-multi-device-on-top)). @@ -60,7 +76,15 @@ The OpenVINO Runtime API features a dedicated methods to enumerate devices and t A simple programmatic way to enumerate the devices and use with the multi-device is as follows: -@snippet snippets/MULTI2.cpp part2 +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/MULTI2.cpp + :language: cpp + :fragment: [part2] + +@endsphinxdirective Beyond the trivial "CPU", "GPU", "HDDL" and so on, when multiple instances of a device are available the names are more qualified. For example, this is how two Intel® Movidius™ Myriad™ X sticks are listed with the hello_query_sample: ``` @@ -72,13 +96,28 @@ Beyond the trivial "CPU", "GPU", "HDDL" and so on, when multiple instances of a So the explicit configuration to use both would be "MULTI:MYRIAD.1.2-ma2480,MYRIAD.1.4-ma2480". Accordingly, the code that loops over all available devices of "MYRIAD" type only is below: -@snippet snippets/MULTI3.cpp part3 +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/MULTI3.cpp + :language: cpp + :fragment: [part3] +@endsphinxdirective ### Configuring the Individual Devices and Creating the Multi-Device On Top As discussed in the first section, you shall configure each individual device as usual and then just create the "MULTI" device on top: -@snippet snippets/MULTI4.cpp part4 +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/MULTI4.cpp + :language: cpp + :fragment: [part4] + +@endsphinxdirective An alternative is to combine all the individual device settings into a single config file and load that, allowing the Multi-Device plugin to parse and apply settings to the right devices. See the code example in the next section. @@ -88,7 +127,15 @@ See the [Using the Multi-Device with OpenVINO samples and benchmarking the perfo ### Querying the Optimal Number of Inference Requests You can use the [configure devices](supported_plugins/config_properties.md) to query the optimal number of requests. Similarly, when using the Multi-Device you don't need to sum over included devices yourself, you can query property directly: -@snippet snippets/MULTI5.cpp part5 +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/MULTI5.cpp + :language: cpp + :fragment: [part5] + +@endsphinxdirective ### Using the Multi-Device with OpenVINO Samples and Benchmarking the Performance @@ -98,7 +145,7 @@ Every OpenVINO sample that supports the `-d` (which stands for "device") command ./benchmark_app –d MULTI:HDDL,GPU –m -i -niter 1000 ``` -The Multi-Device plugin supports FP16 IR files. The CPU plugin automatically upconverts it to FP32 and the other devices support it natively. Note that no demos are (yet) fully optimized for Multi-Device, by means of supporting the OPTIMAL_NUMBER_OF_INFER_REQUESTS metric, using the GPU streams/throttling, and so on. +The Multi-Device plugin supports FP16 IR files. The CPU plugin automatically upconverts it to FP32 and the other devices support it natively. Note that no demos are (yet) fully optimized for Multi-Device, by means of supporting the ov::optimal_number_of_infer_requests property, using the GPU streams/throttling, and so on. ### Video: MULTI Plugin @@ -140,13 +187,13 @@ The Multi-Device plugin automatically assigns inference requests to available co * Improved throughput from using multiple devices (compared to single-device execution) * More consistent performance, since the devices share the inference burden (if one device is too busy, another can take more of the load) -Note that with Multi-Device the application logic is left unchanged, so you don't need to explicitly load the network to every device, create and balance the inference requests and so on. From the application point of view, this is just another device that handles the actual machinery. The only thing that is required to leverage performance is to provide the multi-device (and hence the underlying devices) with enough inference requests to process. For example, if you were processing 4 cameras on the CPU (with 4 inference requests), it might be desirable to process more cameras (with more requests in flight) to keep CPU and GPU busy via Multi-Device. +Note that with Multi-Device the application logic is left unchanged, so you don't need to explicitly compile the model on every device, create and balance the inference requests and so on. From the application point of view, this is just another device that handles the actual machinery. The only thing that is required to leverage performance is to provide the multi-device (and hence the underlying devices) with enough inference requests to process. For example, if you were processing 4 cameras on the CPU (with 4 inference requests), it might be desirable to process more cameras (with more requests in flight) to keep CPU and GPU busy via Multi-Device. The setup of Multi-Device can be described in three major steps: -1. Configure each device as usual (using the conventional [ie_api.IECore.set_config](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.set_config) method -2. Load the network to the Multi-Device plugin created on top of a (prioritized) list of the configured devices. This is the only change needed in the application. -3. As with any other ExecutableNetwork call (resulting from `load_network`), you create as many requests as needed to saturate the devices. +1. Configure each device (using the conventional [configure devices](supported_plugins/config_properties.md) method +2. Compile the model on the Multi-Device plugin created on top of a (prioritized) list of the configured devices. This is the only change needed in the application. +3. As with any other CompiledModel call (resulting from `compile_model`), you create as many requests as needed to saturate the devices. These steps are covered below in detail. @@ -163,34 +210,29 @@ You can set the configuration directly as a string, or use the metric key `MULTI #### The Three Ways to Specify Devices Targets for the MULTI plugin * Option 1 - Pass a Prioritized List as a Parameter in ie.load_network() - ```python - from openvino.inference_engine import IECore - ie = IECore() - # Read a network in IR or ONNX format - net = ie.read_network(model=path_to_model) - exec_net = ie.load_network(network=net, device_name="MULTI:CPU,GPU") - ``` +@sphinxdirective + +.. tab:: Python + + .. doxygensnippet:: docs/snippets/ov_multi.py + :language: python + :fragment: [Option_1] + +@endsphinxdirective * Option 2 - Pass a List as a Parameter, and Dynamically Change Priorities during Execution - Notice that the priorities of the devices can be changed in real time for the executable network: - ```python - from openvino.inference_engine import IECore + Notice that the priorities of the devices can be changed in real time for the compiled model: - # Init the Inference Engine Core - ie = IECore() +@sphinxdirective - # Read a network in IR or ONNX format - net = ie.read_network(model=path_to_model) +.. tab:: Python - ie.set_config( config={"MULTI_DEVICE_PRIORITIES":"HDDL,GPU"}, device_name="MULTI") + .. doxygensnippet:: docs/snippets/ov_multi.py + :language: python + :fragment: [Option_2] - # Change priorities - ie.set_config( config={"MULTI_DEVICE_PRIORITIES":"GPU,HDDL"}, device_name="MULTI") - ie.set_config( config={"MULTI_DEVICE_PRIORITIES":"GPU"}, device_name="MULTI") - ie.set_config( config={"MULTI_DEVICE_PRIORITIES":"HDDL,GPU"}, device_name="MULTI") - ie.set_config( config={"MULTI_DEVICE_PRIORITIES":"CPU,HDDL,GPU"}, device_name="MULTI") - ``` +@endsphinxdirective * Option 3 - Use Explicit Hints for Controlling Request Numbers Executed by Devices There is a way to specify the number of requests that Multi-Device will internally keep for each device. If the original app was running 4 cameras with 4 inference requests, it might be best to share these 4 requests between 2 devices used in the MULTI. The easiest way is to specify a number of requests for each device using parentheses: “MULTI:CPU(2),GPU(2)” and use the same 4 requests in the app. However, such an explicit configuration is not performance-portable and not recommended. The better way is to configure the individual devices and query the resulting number of requests to be used at the application level. See [Configuring the Individual Devices and Creating the Multi-Device On Top](#configuring-the-individual-devices-and-creating-the-multi-device-on-top). @@ -213,16 +255,15 @@ The OpenVINO Runtime API features a dedicated methods to enumerate devices and t A simple programmatic way to enumerate the devices and use with the multi-device is as follows: -```python +@sphinxdirective -from openvino.inference_engine import IECore +.. tab:: Python -all_devices = "MULTI:" -ie = IECore() -net = ie.read_network(model=path_to_model) -all_devices += ",".join(ie.available_devices) -exec_net = ie.load_network(network=net, device_name=all_devices) -``` + .. doxygensnippet:: docs/snippets/ov_multi.py + :language: python + :fragment: [available_devices_1] + +@endsphinxdirective Beyond the trivial "CPU", "GPU", "HDDL" and so on, when multiple instances of a device are available the names are more qualified. For example, this is how two Intel® Movidius™ Myriad™ X sticks are listed with the hello_query_sample: @@ -235,46 +276,29 @@ Beyond the trivial "CPU", "GPU", "HDDL" and so on, when multiple instances of a So the explicit configuration to use both would be "MULTI:MYRIAD.1.2-ma2480,MYRIAD.1.4-ma2480". Accordingly, the code that loops over all available devices of "MYRIAD" type only is below: -```python -from openvino.inference_engine import IECore +@sphinxdirective -ie = IECore() -match_list = [] -all_devices = "MULTI:" -dev_match_str = "MYRIAD" -net = ie.read_network(model=path_to_model) +.. tab:: Python -for d in ie.available_devices: - if dev_match_str in d: - match_list.append(d) + .. doxygensnippet:: docs/snippets/ov_multi.py + :language: python + :fragment: [available_devices_2] -all_devices += ",".join(match_list) -exec_net = ie.load_network(network=net, device_name=all_devices) -``` +@endsphinxdirective ### Configuring the Individual Devices and Creating the Multi-Device On Top It is possible to configure each individual device as usual and then create the "MULTI" device on top: -```python -from openvino.inference_engine import IECore - -ie = IECore() -net = ie.read_network(model=path_to_model) +@sphinxdirective -cpu_config = {} -gpu_config = {} +.. tab:: Python -ie.set_config(config=cpu_config, device_name="CPU") -ie.set_config(config=gpu_config, device_name="GPU") + .. doxygensnippet:: docs/snippets/ov_multi.py + :language: python + :fragment: [set_property] -# Load the network to the multi-device, specifying the priorities -exec_net = ie.load_network( - network=net, device_name="MULTI", config={"MULTI_DEVICE_PRIORITIES": "CPU,GPU"} -) -# Query the optimal number of requests -nireq = exec_net.get_metric("OPTIMAL_NUMBER_OF_INFER_REQUESTS") -``` +@endsphinxdirective An alternative is to combine all the individual device settings into a single config file and load that, allowing the Multi-Device plugin to parse and apply settings to the right devices. See the code example in the next section. @@ -302,4 +326,4 @@ The Multi-Device plugin supports FP16 IR files. The CPU plugin automatically upc @endsphinxdirective ### See Also -[Supported Devices](supported_plugins/Supported_Devices.md) \ No newline at end of file +[Supported Devices](supported_plugins/Supported_Devices.md) diff --git a/docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md b/docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md new file mode 100644 index 00000000000000..b0c38920e55cf2 --- /dev/null +++ b/docs/OV_Runtime_UG/supported_plugins/AutoPlugin_Debugging.md @@ -0,0 +1,136 @@ +# Debugging Auto-Device Plugin {#openvino_docs_IE_DG_supported_plugins_AUTO_debugging} + +## Using Debug Log +In case of execution problems, just like all other plugins, Auto-Device provides the user with information on exceptions and error values. If the returned data is not enough for debugging purposes, more information may be acquired by means of `ov::log::Level`. + +There are six levels of logs, which can be called explicitly or set via the `OPENVINO_LOG_LEVEL` environment variable (can be overwritten by `compile_model()` or `set_property()`): + +0 - ov::log::Level::NO +1 - ov::log::Level::ERR +2 - ov::log::Level::WARNING +3 - ov::log::Level::INFO +4 - ov::log::Level::DEBUG +5 - ov::log::Level::TRACE + +@sphinxdirective +.. tab:: C++ API + + .. code-block:: cpp + + ov::Core core; + + // read a network in IR, PaddlePaddle, or ONNX format + std::shared_ptr model = core.read_model("sample.xml"); + + // load a network to AUTO and set log level to debug + ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", {{ov::log::level.name(), "LOG_DEBUG"}}); + + // or set log level with set_config and load network + core.set_property("AUTO", {{ov::log::level.name(), "LOG_DEBUG"}}); + ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO"); + +.. tab:: Python API + + .. code-block:: python + + from openvino.runtime import Core + core = Core() + + # read a network in IR, PaddlePaddle, or ONNX format + model = core.read_model(model_path) + + # load a network to AUTO and set log level to debug + compiled_model = core.compile_model(model=model, device_name="AUTO", config={"LOG_LEVEL":"LOG_DEBUG"}); + + // or set log level with set_config and load network + ie.SetConfig(config={"LOG_LEVEL":"LOG_DEBUG"}, device_name="AUTO"); + compiled_model = core.compile_model(model=model, device_name="AUTO"); + +.. tab:: OS environment variable + + .. code-block:: sh + + When defining it via the variable, + a number needs to be used instead of a log level name, e.g.: + + Linux + export OPENVINO_LOG_LEVEL=0 + + Windows + set OPENVINO_LOG_LEVEL=0 +@endsphinxdirective + +The property returns information in the following format: + +@sphinxdirective +.. code-block:: sh + + [time]LOG_LEVEL[file] [PLUGIN]: message +@endsphinxdirective + +in which the `LOG_LEVEL` is represented by the first letter of its name (ERROR being an exception and using its full name). For example: + +@sphinxdirective +.. code-block:: sh + + [17:09:36.6188]D[plugin.cpp:167] deviceName:MYRIAD, defaultDeviceID:, uniqueName:MYRIAD_ + [17:09:36.6242]I[executable_network.cpp:181] [AUTOPLUGIN]:select device:MYRIAD + [17:09:36.6809]ERROR[executable_network.cpp:384] [AUTOPLUGIN] load failed, MYRIAD:[ GENERAL_ERROR ] +@endsphinxdirective + + +## 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: +@sphinxdirective +.. code-block:: sh + + -DENABLE_PROFILING_ITT=ON +@endsphinxdirective + +For more information, you can refer to: +* [OpenVINO profiling](https://docs.openvino.ai/latest/groupie_dev_profiling.html) +* [Intel® VTune™ Profiler User Guide](https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/api-support/instrumentation-and-tracing-technology-apis.html) + +### Analyze Code Performance on Linux + +You can analyze code performance using Intel® VTune™ Profiler. For more information and installation instructions refer to the [installation guide (PDF)](https://software.intel.com/content/www/us/en/develop/download/intel-vtune-install-guide-linux-os.html) +With Intel® VTune™ Profiler installed you can configure your analysis with the following steps: + +1. Open Intel® VTune™ Profiler GUI on the host machine with the following command: +@sphinxdirective + +.. code-block:: sh + + cd /vtune install dir/intel/oneapi/vtune/2021.6.0/env + source vars.sh + vtune-gui +@endsphinxdirective + +2. select **Configure Analysis** +3. In the **where** pane, select **Local Host** +@sphinxdirective +.. image:: _static/images/IE_DG_supported_plugins_AUTO_debugging-img01-localhost.png + :align: center +@endsphinxdirective +4. In the **what** pane, specify your target application/script on the local system. +@sphinxdirective +.. image:: _static/images/IE_DG_supported_plugins_AUTO_debugging-img02-launch.png + :align: center +@endsphinxdirective +5. In the **how** pane, choose and configure the analysis type you want to perform, for example, **Hotspots Analysis**: +identify the most time-consuming functions and drill down to see time spent on each line of source code. Focus optimization efforts on hot code for the greatest performance impact. +@sphinxdirective +.. image:: _static/images/IE_DG_supported_plugins_AUTO_debugging-img03-hotspots.png + :align: center +@endsphinxdirective +6. Start the analysis by clicking the start button. When it is done, you will get a summary of the run, including top hotspots and top tasks in your application: +@sphinxdirective +.. image:: _static/images/IE_DG_supported_plugins_AUTO_debugging-img04-vtunesummary.png + :align: center +@endsphinxdirective +7. To analyze ITT info related to the Auto plugin, click on the **Bottom-up** tab, choose the **Task Domain/Task Type/Function/Call Stack** from the dropdown list - Auto plugin-related ITT info is under the MULTIPlugin task domain: +@sphinxdirective +.. image:: _static/images/IE_DG_supported_plugins_AUTO_debugging-img05-vtunebottomup.png + :align: center +@endsphinxdirective diff --git a/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img01-localhost.png b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img01-localhost.png new file mode 100644 index 00000000000000..c5b186c02e7173 --- /dev/null +++ b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img01-localhost.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36f4b9e0714e819b0c98a30f3c08d6ce1f9206906be42e80cb1fa746e6354ad6 +size 25333 diff --git a/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img02-launch.png b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img02-launch.png new file mode 100644 index 00000000000000..b00d9f0dcb8fda --- /dev/null +++ b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img02-launch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5a0022bda018ae7e5261bbb9f5e8cc28374254c272dd3cbc2ab2f872381e2c5 +size 21106 diff --git a/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img03-hotspots.png b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img03-hotspots.png new file mode 100644 index 00000000000000..dc1f7d7c0b1dc3 --- /dev/null +++ b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img03-hotspots.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0319b56afe702fb09957f4d3c996155be79efc672edc0e780d34441eaa660b2c +size 43521 diff --git a/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img04-vtunesummary.png b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img04-vtunesummary.png new file mode 100644 index 00000000000000..9769b6eb0e6428 --- /dev/null +++ b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img04-vtunesummary.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:813e629fe674b676c8484a92f94d55ffc13cacc1e077fa19a2c82cd528819d72 +size 256217 diff --git a/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img05-vtunebottomup.png b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img05-vtunebottomup.png new file mode 100644 index 00000000000000..feecb907c87e4c --- /dev/null +++ b/docs/_static/images/IE_DG_supported_plugins_AUTO_debugging-img05-vtunebottomup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62fb4b08191499cfe765f3777dd7ae543739232cfd8861e21f976ba09aa9797b +size 176560 diff --git a/docs/img/autoplugin_accelerate.png b/docs/img/autoplugin_accelerate.png new file mode 100644 index 00000000000000..41aed564ca37e7 --- /dev/null +++ b/docs/img/autoplugin_accelerate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba092e65d9c5c6fb585c4a394ba3e6a913bf4f129a386b7a8664b94aeb47878b +size 61218 diff --git a/docs/snippets/AUTO0.cpp b/docs/snippets/AUTO0.cpp index b546e61a1c64c2..54d720eb4bcc0d 100644 --- a/docs/snippets/AUTO0.cpp +++ b/docs/snippets/AUTO0.cpp @@ -1,12 +1,28 @@ -#include +#include int main() { +{ //! [part0] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - // these 2 lines below are equivalent - InferenceEngine::ExecutableNetwork exec0 = ie.LoadNetwork(network, "AUTO"); - InferenceEngine::ExecutableNetwork exec1 = ie.LoadNetwork(network, ""); +ov::Core core; + +// Read a network in IR, PaddlePaddle, or ONNX format: +std::shared_ptr model = core.read_model("sample.xml"); + +// compile a model on AUTO using the default list of device candidates. +// The following lines are equivalent: +ov::CompiledModel model0 = core.compile_model(model); +ov::CompiledModel model1 = core.compile_model(model, "AUTO"); + +// Optional +// You can also specify the devices to be used by AUTO. +// The following lines are equivalent: +ov::CompiledModel model3 = core.compile_model(model, "AUTO:GPU,CPU"); +ov::CompiledModel model4 = core.compile_model(model, "AUTO", ov::device::priorities("GPU,CPU")); + +//Optional +// the AUTO plugin is pre-configured (globally) with the explicit option: +core.set_property("AUTO", ov::device::priorities("GPU,CPU")); //! [part0] -return 0; +} + return 0; } diff --git a/docs/snippets/AUTO1.cpp b/docs/snippets/AUTO1.cpp index c85e1396bc1aac..13451e929167f6 100644 --- a/docs/snippets/AUTO1.cpp +++ b/docs/snippets/AUTO1.cpp @@ -1,15 +1,30 @@ #include int main() { +{ //! [part1] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - // "AUTO" plugin is (globally) pre-configured with the explicit option: - ie.SetConfig({{"MULTI_DEVICE_PRIORITIES", "CPU,GPU"}}, "AUTO"); - // the below 3 lines are equivalent (the first line leverages the pre-configured AUTO, while second and third explicitly pass the same settings) - InferenceEngine::ExecutableNetwork exec0 = ie.LoadNetwork(network, "AUTO", {}); - InferenceEngine::ExecutableNetwork exec1 = ie.LoadNetwork(network, "AUTO", {{"MULTI_DEVICE_PRIORITIES", "CPU,GPU"}}); - InferenceEngine::ExecutableNetwork exec2 = ie.LoadNetwork(network, "AUTO:CPU,GPU"); +// Inference Engine API +InferenceEngine::Core ie; + +// Read a network in IR, PaddlePaddle, or ONNX format: +InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); + +// Load a network to AUTO using the default list of device candidates. +// The following lines are equivalent: +InferenceEngine::ExecutableNetwork exec0 = ie.LoadNetwork(network); +InferenceEngine::ExecutableNetwork exec1 = ie.LoadNetwork(network, "AUTO"); +InferenceEngine::ExecutableNetwork exec2 = ie.LoadNetwork(network, "AUTO", {}); + +// Optional +// You can also specify the devices to be used by AUTO in its selection process. +// The following lines are equivalent: +InferenceEngine::ExecutableNetwork exec3 = ie.LoadNetwork(network, "AUTO:GPU,CPU"); +InferenceEngine::ExecutableNetwork exec4 = ie.LoadNetwork(network, "AUTO", {{"MULTI_DEVICE_PRIORITIES", "GPU,CPU"}}); + +// Optional +// the AUTO plugin is pre-configured (globally) with the explicit option: +ie.SetConfig({{"MULTI_DEVICE_PRIORITIES", "GPU,CPU"}}, "AUTO"); //! [part1] -return 0; +} + return 0; } diff --git a/docs/snippets/AUTO2.cpp b/docs/snippets/AUTO2.cpp index c70e2923af774a..2e7bd799e73d25 100644 --- a/docs/snippets/AUTO2.cpp +++ b/docs/snippets/AUTO2.cpp @@ -1,10 +1,12 @@ #include int main() { +{ //! [part2] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO"); +InferenceEngine::Core ie; +InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); +InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO"); //! [part2] -return 0; +} + return 0; } diff --git a/docs/snippets/AUTO3.cpp b/docs/snippets/AUTO3.cpp index 37e8e35076837a..fca76f7daf7fba 100644 --- a/docs/snippets/AUTO3.cpp +++ b/docs/snippets/AUTO3.cpp @@ -1,10 +1,22 @@ -#include +#include int main() { +{ + //! [part3] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO:CPU,GPU"); +ov::Core core; + +// Read a network in IR, PaddlePaddle, or ONNX format: +std::shared_ptr model = core.read_model("sample.xml"); + +// compile a model on AUTO with Performance Hints enabled: +// To use the “throughput” mode: +ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", + ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)); +// or the “latency” mode: +ov::CompiledModel compiled_mode2 = core.compile_model(model, "AUTO", + ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)); //! [part3] -return 0; +} + return 0; } diff --git a/docs/snippets/AUTO4.cpp b/docs/snippets/AUTO4.cpp index ee39e7103d7e5b..a5da6d2e42565a 100644 --- a/docs/snippets/AUTO4.cpp +++ b/docs/snippets/AUTO4.cpp @@ -1,19 +1,36 @@ -#include +#include int main() { - const std::map cpu_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } }; - const std::map gpu_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } }; - //! [part4] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - // configure the CPU device first - ie.SetConfig(cpu_config, "CPU"); - // configure the GPU device - ie.SetConfig(gpu_config, "GPU"); - // load the network to the auto-device - InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO"); - // new metric allows to query the optimization capabilities - std::vector device_cap = exeNetwork.GetMetric(METRIC_KEY(OPTIMIZATION_CAPABILITIES)); - //! [part4] + ov::Core core; + + // Read a network in IR, PaddlePaddle, or ONNX format: + std::shared_ptr model = core.read_model("sample.xml"); +{ +//! [part4] +// Example 1 +ov::CompiledModel compiled_model0 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::HIGH)); +ov::CompiledModel compiled_model1 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::MEDIUM)); +ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::LOW)); +/************ + Assume that all the devices (CPU, GPU, and MYRIAD) can support all the networks. + Result: compiled_model0 will use GPU, compiled_model1 will use MYRIAD, compiled_model2 will use CPU. + ************/ + +// Example 2 +ov::CompiledModel compiled_model3 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::LOW)); +ov::CompiledModel compiled_model4 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::MEDIUM)); +ov::CompiledModel compiled_model5 = core.compile_model(model, "AUTO", + ov::hint::model_priority(ov::hint::Priority::LOW)); +/************ + Assume that all the devices (CPU, GPU, and MYRIAD) can support all the networks. + Result: compiled_model3 will use GPU, compiled_model4 will use GPU, compiled_model5 will use MYRIAD. + ************/ +//! [part4] +} return 0; } diff --git a/docs/snippets/AUTO5.cpp b/docs/snippets/AUTO5.cpp index e0678b4e0de8d5..624ed10831c8a6 100644 --- a/docs/snippets/AUTO5.cpp +++ b/docs/snippets/AUTO5.cpp @@ -1,15 +1,18 @@ -#include +#include int main() { - std::string device_name = "AUTO:CPU,GPU"; - const std::map< std::string, std::string > full_config = {}; - //! [part5] - InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - // 'device_name' can be "AUTO:CPU,GPU" to configure the auto-device to use CPU and GPU - InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, device_name, full_config); - // new metric allows to query the optimization capabilities - std::vector device_cap = exeNetwork.GetMetric(METRIC_KEY(OPTIMIZATION_CAPABILITIES)); - //! [part5] +ov::AnyMap cpu_config = {}; +ov::AnyMap myriad_config = {}; +//! [part5] +ov::Core core; + +// Read a network in IR, PaddlePaddle, or ONNX format: +std::shared_ptr model = core.read_model("sample.xml"); + +// Configure CPU and the MYRIAD devices when compiled model +ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", + ov::device::properties("CPU", cpu_config), + ov::device::properties("MYRIAD", myriad_config)); +//! [part5] return 0; } diff --git a/docs/snippets/AUTO6.cpp b/docs/snippets/AUTO6.cpp new file mode 100644 index 00000000000000..f478304ac5ed86 --- /dev/null +++ b/docs/snippets/AUTO6.cpp @@ -0,0 +1,20 @@ +#include + +int main() { +{ +//! [part6] +ov::Core core; + +// read a network in IR, PaddlePaddle, or ONNX format +std::shared_ptr model = core.read_model("sample.xml"); + +// load a network to AUTO and set log level to debug +ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", ov::log::level(ov::log::Level::DEBUG)); + +// or set log level with set_config and load network +core.set_property("AUTO", ov::log::level(ov::log::Level::DEBUG)); +ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO"); +//! [part6] +} + return 0; +} diff --git a/docs/snippets/MULTI0.cpp b/docs/snippets/MULTI0.cpp index 05146a6c9456e1..31e474da19060f 100644 --- a/docs/snippets/MULTI0.cpp +++ b/docs/snippets/MULTI0.cpp @@ -1,18 +1,19 @@ -#include +#include int main() { -using namespace InferenceEngine; //! [part0] - Core ie; - auto network = ie.ReadNetwork("sample.xml"); - //NEW IE-CENTRIC API, the "MULTI" plugin is (globally) pre-configured with the explicit option: - ie.SetConfig({{"MULTI_DEVICE_PRIORITIES", "HDDL,GPU"}}, "MULTI"); - ExecutableNetwork exec0 = ie.LoadNetwork(network, "MULTI", {}); +ov::Core core; +std::shared_ptr model = core.read_model("sample.xml"); +// the "MULTI" device is (globally) pre-configured with the explicit option +core.set_property("MULTI", ov::device::priorities("HDDL,GPU")); +ov::CompiledModel compileModel0 = core.compile_model(model, "MULTI"); - //NEW IE-CENTRIC API, configuration of the "MULTI" is part of the network configuration (and hence specific to the network): - ExecutableNetwork exec1 = ie.LoadNetwork(network, "MULTI", {{"MULTI_DEVICE_PRIORITIES", "HDDL,GPU"}}); - //NEW IE-CENTRIC API, same as previous, but configuration of the "MULTI" is part of the name (so config is empty), also network-specific: - ExecutableNetwork exec2 = ie.LoadNetwork(network, "MULTI:HDDL,GPU", {}); +// configuration of the "MULTI" is part of the compile configuration (and hence specific to the model): +ov::CompiledModel compileModel1 = core.compile_model(model, "MULTI", ov::device::priorities("HDDL,GPU")); + +// same as previous, but configuration of the "MULTI" is part +// of the name (so config is empty), also model-specific: +ov::CompiledModel compileModel2 = core.compile_model(model, "MULTI:HDDL,GPU"); //! [part0] return 0; } diff --git a/docs/snippets/MULTI1.cpp b/docs/snippets/MULTI1.cpp index 60ea4ac5282a76..31df28b298edab 100644 --- a/docs/snippets/MULTI1.cpp +++ b/docs/snippets/MULTI1.cpp @@ -1,22 +1,22 @@ -#include +#include int main() { -using namespace InferenceEngine; //! [part1] - Core ie; - auto network = ie.ReadNetwork("sample.xml"); - ExecutableNetwork exec = ie.LoadNetwork(network, "MULTI:HDDL,GPU", {}); - //... - exec.SetConfig({{"MULTI_DEVICE_PRIORITIES", "GPU,HDDL"}}); - // you can even exclude some device - exec.SetConfig({{"MULTI_DEVICE_PRIORITIES", "GPU"}}); - //... - // and then return it back - exec.SetConfig({{"MULTI_DEVICE_PRIORITIES", "GPU,HDDL"}}); - //but you cannot add new devices on the fly, the next line will trigger the following exception: - //[ ERROR ] [NOT_FOUND] You can only change device priorities but not add new devices with the Network's SetConfig(MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES. - //CPU device was not in the original device list! - exec.SetConfig({{"MULTI_DEVICE_PRIORITIES", "CPU,GPU,HDDL"}}); +ov::Core core; +std::shared_ptr model = core.read_model("sample.xml"); +ov::CompiledModel compileModel = core.compile_model(model, "MULTI:HDDL,GPU"); +// reverse the order of priorities +compileModel.set_property(ov::device::priorities("GPU,HDDL")); +// you can even exclude some device (HDDL here) +compileModel.set_property(ov::device::priorities("GPU")); +// and then return it back +compileModel.set_property(ov::device::priorities("GPU,HDDL")); +// but you cannot add new devices on the fly, +// the next line will trigger the following exception: +// [ ERROR ] [NOT_FOUND] You can only change device +// priorities but not add new devices with the model's +// ov::device::priorities. CPU device was not in the original device list! +compileModel.set_property(ov::device::priorities("CPU,GPU,HDDL")); //! [part1] return 0; } diff --git a/docs/snippets/MULTI2.cpp b/docs/snippets/MULTI2.cpp index d42f42e10b09dd..854126582df8db 100644 --- a/docs/snippets/MULTI2.cpp +++ b/docs/snippets/MULTI2.cpp @@ -1,17 +1,17 @@ -#include +#include int main() { -using namespace InferenceEngine; //! [part2] - Core ie; - auto cnnNetwork = ie.ReadNetwork("sample.xml"); - std::string allDevices = "MULTI:"; - std::vector availableDevices = ie.GetAvailableDevices(); - for (auto && device : availableDevices) { - allDevices += device; - allDevices += ((device == availableDevices[availableDevices.size()-1]) ? "" : ","); - } - ExecutableNetwork exeNetwork = ie.LoadNetwork(cnnNetwork, allDevices, {}); +ov::Core core; +std::shared_ptr model = core.read_model("sample.xml"); +std::vector availableDevices = core.get_available_devices(); +std::string all_devices; +for (auto && device : availableDevices) { + all_devices += device; + all_devices += ((device == availableDevices[availableDevices.size()-1]) ? "" : ","); +} +ov::CompiledModel compileModel = core.compile_model(model, "MULTI", + ov::device::priorities(all_devices)); //! [part2] return 0; } diff --git a/docs/snippets/MULTI3.cpp b/docs/snippets/MULTI3.cpp index 98de44b1e22bc5..29e0132948a76d 100644 --- a/docs/snippets/MULTI3.cpp +++ b/docs/snippets/MULTI3.cpp @@ -1,17 +1,17 @@ -#include +#include int main() { //! [part3] - InferenceEngine::Core ie; - auto cnnNetwork = ie.ReadNetwork("sample.xml"); - std::string allDevices = "MULTI:"; - std::vector myriadDevices = ie.GetMetric("MYRIAD", METRIC_KEY(AVAILABLE_DEVICES)); - for (size_t i = 0; i < myriadDevices.size(); ++i) { - allDevices += std::string("MYRIAD.") - + myriadDevices[i] - + std::string(i < (myriadDevices.size() -1) ? "," : ""); - } - InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(cnnNetwork, allDevices, {}); +ov::Core core; +std::vector myriadDevices = core.get_property("MYRIAD", ov::available_devices); +std::string all_devices; +for (size_t i = 0; i < myriadDevices.size(); ++i) { + all_devices += std::string("MYRIAD.") + + myriadDevices[i] + + std::string(i < (myriadDevices.size() -1) ? "," : ""); +} +ov::CompiledModel compileModel = core.compile_model("sample.xml", "MULTI", + ov::device::priorities(all_devices)); //! [part3] return 0; } diff --git a/docs/snippets/MULTI4.cpp b/docs/snippets/MULTI4.cpp index 40501250b23f8c..9a9669d7816b01 100644 --- a/docs/snippets/MULTI4.cpp +++ b/docs/snippets/MULTI4.cpp @@ -1,19 +1,21 @@ -#include +#include int main() { -const std::map hddl_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } }; -const std::map gpu_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } }; +ov::AnyMap hddl_config, gpu_config; //! [part4] // configure the HDDL device first -InferenceEngine::Core ie; -InferenceEngine::CNNNetwork cnnNetwork = ie.ReadNetwork("sample.xml"); -ie.SetConfig(hddl_config, "HDDL"); -// configure the GPU device -ie.SetConfig(gpu_config, "GPU"); -// load the network to the multi-device, while specifying the configuration (devices along with priorities): -InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(cnnNetwork, "MULTI", {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "HDDL,GPU"}}); -// new metric allows to query the optimal number of requests: -uint32_t nireq = exeNetwork.GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); +ov::Core core; +std::shared_ptr model = core.read_model("sample.xml"); +// compile the modle on the multi-device, +// while specifying the configuration (devices along with priorities +// and the configuration of devices): +ov::CompiledModel compileModel = core.compile_model(model, "MULTI", + ov::device::priorities("HDDL", "GPU"), + ov::device::properties("HDDL", hddl_config), + ov::device::properties("GPU", gpu_config)); + +// query the optimal number of requests: +uint32_t nireq = compileModel.get_property(ov::optimal_number_of_infer_requests); //! [part4] return 0; } diff --git a/docs/snippets/MULTI5.cpp b/docs/snippets/MULTI5.cpp index 20b3015f8de364..e3a6329d562104 100644 --- a/docs/snippets/MULTI5.cpp +++ b/docs/snippets/MULTI5.cpp @@ -1,15 +1,11 @@ -#include +#include int main() { -std::string device_name = "MULTI:HDDL,GPU"; -const std::map< std::string, std::string > full_config = {}; //! [part5] -InferenceEngine::Core ie; -InferenceEngine::CNNNetwork cnnNetwork = ie.ReadNetwork("sample.xml"); -// 'device_name' can be "MULTI:HDDL,GPU" to configure the multi-device to use HDDL and GPU -InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(cnnNetwork, device_name, full_config); -// new metric allows to query the optimal number of requests: -uint32_t nireq = exeNetwork.GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); +ov::Core core; +ov::CompiledModel compileModel = core.compile_model("sample.xml", "MULTI:HDDL,GPU"); +// query the optimal number of requests +uint32_t nireq = compileModel.get_property(ov::optimal_number_of_infer_requests); //! [part5] return 0; } diff --git a/docs/snippets/ov_auto.py b/docs/snippets/ov_auto.py new file mode 100644 index 00000000000000..d1304fffadb8c2 --- /dev/null +++ b/docs/snippets/ov_auto.py @@ -0,0 +1,105 @@ +import sys +from openvino.runtime import Core +from openvino.inference_engine import IECore +model_path = "/openvino_CI_CD/result/install_pkg/tests/test_model_zoo/core/models/ir/add_abc.xml" +path_to_model = "/openvino_CI_CD/result/install_pkg/tests/test_model_zoo/core/models/ir/add_abc.xml" + +def part0(): +#! [part0] + core = Core() + + # Read a network in IR, PaddlePaddle, or ONNX format: + model = core.read_model(model_path) + + # compile a model on AUTO using the default list of device candidates. + # The following lines are equivalent: + compiled_model = core.compile_model(model=model) + compiled_model = core.compile_model(model=model, device_name="AUTO") + + # Optional + # You can also specify the devices to be used by AUTO. + # The following lines are equivalent: + compiled_model = core.compile_model(model=model, device_name="AUTO:GPU,CPU") + compiled_model = core.compile_model(model=model, device_name="AUTO", config={"MULTI_DEVICE_PRIORITIES": "GPU,CPU"}) + + # Optional + # the AUTO plugin is pre-configured (globally) with the explicit option: + core.set_property(device_name="AUTO", properties={"MULTI_DEVICE_PRIORITIES":"GPU,CPU"}) +#! [part0] + +def part1(): +#! [part1] + ### IE API ### + ie = IECore() + + # Read a network in IR, PaddlePaddle, or ONNX format: + net = ie.read_network(model=path_to_model) + + # Load a network to AUTO using the default list of device candidates. + # The following lines are equivalent: + exec_net = ie.load_network(network=net) + exec_net = ie.load_network(network=net, device_name="AUTO") + exec_net = ie.load_network(network=net, device_name="AUTO", config={}) + + # Optional + # You can also specify the devices to be used by AUTO in its selection process. + # The following lines are equivalent: + exec_net = ie.load_network(network=net, device_name="AUTO:GPU,CPU") + exec_net = ie.load_network(network=net, device_name="AUTO", config={"MULTI_DEVICE_PRIORITIES": "GPU,CPU"}) + + # Optional + # the AUTO plugin is pre-configured (globally) with the explicit option: + ie.set_config(config={"MULTI_DEVICE_PRIORITIES":"GPU,CPU"}, device_name="AUTO"); +#! [part1] + +def part3(): +#! [part3] + core = Core() + # Read a network in IR, PaddlePaddle, or ONNX format: + model = core.read_model(model_path) + # compile a model on AUTO with Performance Hints enabled: + # To use the “throughput” mode: + compiled_model = core.compile_model(model=model, device_name="AUTO", config={"PERFORMANCE_HINT":"THROUGHPUT"}) + # or the “latency” mode: + compiled_model = core.compile_model(model=model, device_name="AUTO", config={"PERFORMANCE_HINT":"LATENCY"}) +#! [part3] + +def part4(): +#! [part4] + core = Core() + model = core.read_model(model_path) + + # Example 1 + compiled_model0 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"HIGH"}) + compiled_model1 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"MEDIUM"}) + compiled_model2 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"LOW"}) + # Assume that all the devices (CPU, GPU, and MYRIAD) can support all the networks. + # Result: compiled_model0 will use GPU, compiled_model1 will use MYRIAD, compiled_model2 will use CPU. + + # Example 2 + compiled_model3 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"HIGH"}) + compiled_model4 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"MEDIUM"}) + compiled_model5 = core.compile_model(model=model, device_name="AUTO", config={"MODEL_PRIORITY":"LOW"}) + # Assume that all the devices (CPU, GPU, and MYRIAD) can support all the networks. + # Result: compiled_model3 will use GPU, compiled_model4 will use GPU, compiled_model5 will use MYRIAD. +#! [part4] + +def part5(): +#! [part5] + core = Core() + model = core.read_model(model_path) + core.set_property(device_name="CPU", properties={}) + core.set_property(device_name="MYRIAD", properties={}) + compiled_model = core.compile_model(model=model) + compiled_model = core.compile_model(model=model, device_name="AUTO") +#! [part5] + +def main(): + part0() + part1() + part3() + part4() + part5() + +if __name__ == '__main__': + sys.exit(main()) diff --git a/docs/snippets/ov_multi.py b/docs/snippets/ov_multi.py new file mode 100644 index 00000000000000..6b9629b9e4d48a --- /dev/null +++ b/docs/snippets/ov_multi.py @@ -0,0 +1,72 @@ +import sys +from openvino.runtime import Core +model_path = "/openvino_CI_CD/result/install_pkg/tests/test_model_zoo/core/models/ir/add_abc.xml" +path_to_model = "/openvino_CI_CD/result/install_pkg/tests/test_model_zoo/core/models/ir/add_abc.xml" +def Option_1(): +#! [Option_1] + core = Core() + + # Read a network in IR or ONNX format + model = core.read_model(model_path) + compiled_model = core.compile_model(model=model, device_name="MULTI:CPU,GPU") +#! [Option_1] + +def Option_2(): +#! [Option_2] + core = Core() + + # Read a network in IR or ONNX format + model = core.read_model(model_path) + core.set_property(device_name="MULTI", properties={"MULTI_DEVICE_PRIORITIES":"HDDL,GPU"}) + # Change priorities + core.set_property(device_name="MULTI", properties={"MULTI_DEVICE_PRIORITIES":"GPU,HDDL"}) + core.set_property(device_name="MULTI", properties={"MULTI_DEVICE_PRIORITIES":"GPU"}) + core.set_property(device_name="MULTI", properties={"MULTI_DEVICE_PRIORITIES":"HDDL,GPU"}) + core.set_property(device_name="MULTI", properties={"MULTI_DEVICE_PRIORITIES":"CPU,HDDL,GPU"}) +#! [Option_2] + +def available_devices_1(): +#! [available_devices_1] + all_devices = "MULTI:" + core = Core() + model = core.read_model(model_path) + all_devices += ",".join(core.available_devices) + compiled_model = core.compile_model(model=model, device_name=all_devices) +#! [available_devices_1] + +def available_devices_2(): +#! [available_devices_2] + match_list = [] + all_devices = "MULTI:" + dev_match_str = "MYRIAD" + core = Core() + model = core.read_model(model_path) + for d in core.available_devices: + if dev_match_str in d: + match_list.append(d) + all_devices += ",".join(match_list) + compiled_model = core.compile_model(model=model, device_name=all_devices) +#! [available_devices_2] + +def set_property(): +#! [set_property] + core = Core() + cpu_config = {} + gpu_config = {} + model = core.read_model(model_path) + core.set_property(device_name="CPU", properties=cpu_config) + core.set_property(device_name="GPU", properties=gpu_config) + compiled_model = core.compile_model(model=model, device_name="MULTI:GPU,CPU") + # Query the optimal number of requests + nireq = compiled_model.get_property("OPTIMAL_NUMBER_OF_INFER_REQUESTS") +#! [set_property] + +def main(): + Option_1() + Option_2() + available_devices_1() + available_devices_2() + set_property() + +if __name__ == '__main__': + sys.exit(main()) From 1e65668aa4a697a04d2ec1b75a48e3b5ac4bc00b Mon Sep 17 00:00:00 2001 From: Maksim Kutakov Date: Mon, 21 Mar 2022 11:06:42 +0300 Subject: [PATCH 4/9] [CPU] CPU plugin docs refactoring backport to the release branch (#11039) * CPU device documentation refresh * Bfloat16 inference page aligned with the new API * Bfloat16 inference section moved to CPU main * First review comments applied * Second review step comments applied * OneDNN reference changed to the GitHub page * AvgPool added to the oneDNN ops list * Updated note about latency, added note about mem usage with dynamic shapes --- docs/OV_Runtime_UG/Bfloat16Inference.md | 214 --------------- docs/OV_Runtime_UG/supported_plugins/CPU.md | 248 +++++++++++------- .../supported_plugins/Device_Plugins.md | 2 +- docs/img/conv_depth_01.png | 3 - docs/img/conv_simple_01.png | 3 - docs/img/conv_sum_relu_01.png | 3 - docs/img/fullyconnected_activation_01.png | 3 - docs/img/group_convolutions_01.png | 3 - docs/img/mkldnn_conv_sum.png | 3 - docs/img/mkldnn_conv_sum_result.png | 3 - docs/img/mkldnn_group_conv.png | 3 - docs/img/pooling_fakequant_01.png | 3 - docs/snippets/Bfloat16Inference0.cpp | 10 - docs/snippets/Bfloat16Inference1.cpp | 13 - docs/snippets/Bfloat16Inference2.cpp | 11 - docs/snippets/cpu/Bfloat16Inference0.cpp | 9 + docs/snippets/cpu/Bfloat16Inference1.cpp | 13 + docs/snippets/cpu/Bfloat16Inference2.cpp | 11 + docs/snippets/cpu/compile_model.cpp | 20 ++ docs/snippets/cpu/dynamic_shape.cpp | 25 ++ 20 files changed, 236 insertions(+), 367 deletions(-) delete mode 100644 docs/OV_Runtime_UG/Bfloat16Inference.md delete mode 100644 docs/img/conv_depth_01.png delete mode 100644 docs/img/conv_simple_01.png delete mode 100644 docs/img/conv_sum_relu_01.png delete mode 100644 docs/img/fullyconnected_activation_01.png delete mode 100644 docs/img/group_convolutions_01.png delete mode 100644 docs/img/mkldnn_conv_sum.png delete mode 100644 docs/img/mkldnn_conv_sum_result.png delete mode 100644 docs/img/mkldnn_group_conv.png delete mode 100644 docs/img/pooling_fakequant_01.png delete mode 100644 docs/snippets/Bfloat16Inference0.cpp delete mode 100644 docs/snippets/Bfloat16Inference1.cpp delete mode 100644 docs/snippets/Bfloat16Inference2.cpp create mode 100644 docs/snippets/cpu/Bfloat16Inference0.cpp create mode 100644 docs/snippets/cpu/Bfloat16Inference1.cpp create mode 100644 docs/snippets/cpu/Bfloat16Inference2.cpp create mode 100644 docs/snippets/cpu/compile_model.cpp create mode 100644 docs/snippets/cpu/dynamic_shape.cpp diff --git a/docs/OV_Runtime_UG/Bfloat16Inference.md b/docs/OV_Runtime_UG/Bfloat16Inference.md deleted file mode 100644 index 5091901e986df5..00000000000000 --- a/docs/OV_Runtime_UG/Bfloat16Inference.md +++ /dev/null @@ -1,214 +0,0 @@ -# Bfloat16 Inference {#openvino_docs_IE_DG_Bfloat16Inference} - -## Bfloat16 Inference Usage (C++) - -@sphinxdirective -.. raw:: html - -
C++
-@endsphinxdirective - -### Disclaimer - -Inference Engine with the bfloat16 inference implemented on CPU must support the native *avx512_bf16* instruction and therefore the bfloat16 data format. It is possible to use bfloat16 inference in simulation mode on platforms with Intel® Advanced Vector Extensions 512 (Intel® AVX-512), but it leads to significant performance degradation in comparison with FP32 or native *avx512_bf16* instruction usage. - -### Introduction -Bfloat16 computations (referred to as BF16) is the Brain Floating-Point format with 16 bits. This is a truncated 16-bit version of the 32-bit IEEE 754 single-precision floating-point format FP32. BF16 preserves 8 exponent bits as FP32 but reduces precision of the sign and mantissa from 24 bits to 8 bits. - -![bf16_format] - -Preserving the exponent bits keeps BF16 to the same range as the FP32 (~1e-38 to ~3e38). This simplifies conversion between two data types: you just need to skip or flush to zero 16 low bits. Truncated mantissa leads to occasionally less precision, but according to [investigations](https://cloud.google.com/blog/products/ai-machine-learning/bfloat16-the-secret-to-high-performance-on-cloud-tpus), neural networks are more sensitive to the size of the exponent than the mantissa size. Also, in lots of models, precision is needed close to zero but not so much at the maximum range. Another useful feature of BF16 is possibility to encode INT8 in BF16 without loss of accuracy, because INT8 range completely fits in BF16 mantissa field. It reduces data flow in conversion from INT8 input image data to BF16 directly without intermediate representation in FP32, or in combination of [INT8 inference](Int8Inference.md) and BF16 layers. - -See the [BFLOAT16 – Hardware Numerics Definition white paper](https://software.intel.com/content/dam/develop/external/us/en/documents/bf16-hardware-numerics-definition-white-paper.pdf) for more bfloat16 format details. - -There are two ways to check if CPU device can support bfloat16 computations for models: - -1. Query the instruction set using one of these system commands: - * `lscpu | grep avx512_bf16` - * `cat /proc/cpuinfo | grep avx512_bf16` -2. Use the [Configure devices](supported_plugins/config_properties.md) with `METRIC_KEY(OPTIMIZATION_CAPABILITIES)`, which should return `BF16` in the list of CPU optimization options: - -@snippet snippets/Bfloat16Inference0.cpp part0 - -The current Inference Engine solution for bfloat16 inference uses the Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) and supports inference of the significant number of layers in BF16 computation mode. - -### Lowering Inference Precision - -Lowering precision to increase performance is [widely used](https://software.intel.com/content/www/us/en/develop/articles/lower-numerical-precision-deep-learning-inference-and-training.html) for optimization of inference. The bfloat16 data type usage on CPU for the first time opens the possibility of default optimization approach. The embodiment of this approach is to use the optimization capabilities of the current platform to achieve maximum performance while maintaining the accuracy of calculations within the acceptable range. - -Using Bfloat16 precision provides the following performance benefits: - -1. Faster multiplication of two BF16 numbers because of shorter mantissa of bfloat16 data. -2. No need to support denormals and handling exceptions as this is a performance optimization. -3. Fast conversion of float32 to bfloat16 and vice versa. -4. Reduced size of data in memory, as a result, larger models fit in the same memory bounds. -5. Reduced amount of data that must be transferred, as a result, reduced data transition time. - -For default optimization on CPU, the source model is converted from FP32 or FP16 to BF16 and executed internally on platforms with native BF16 support. In this case, `KEY_ENFORCE_BF16` is set to `YES` in the `PluginConfigParams` for `GetConfig()`. The code below demonstrates how to check if the key is set: - -@snippet snippets/Bfloat16Inference1.cpp part1 - -To disable BF16 internal transformations in C++ API, set the `KEY_ENFORCE_BF16` to `NO`. In this case, the model infers as is without modifications with precisions that were set on each layer edge. - -@snippet snippets/Bfloat16Inference2.cpp part2 - -To disable BF16 in C API: - -``` -ie_config_t config = { "ENFORCE_BF16", "NO", NULL}; -ie_core_load_network(core, network, device_name, &config, &exe_network); -``` - -An exception with the message `Platform doesn't support BF16 format` is formed in case of setting `KEY_ENFORCE_BF16` to `YES` on CPU without native BF16 support or BF16 simulation mode. - -Low-Precision 8-bit integer models cannot be converted to BF16, even if bfloat16 optimization is set by default. - -### Bfloat16 Simulation Mode - -Bfloat16 simulation mode is available on CPU and Intel® AVX-512 platforms that do not support the native `avx512_bf16` instruction. The simulator does not guarantee good performance. Note that the CPU must still support the AVX-512 extensions. - -To enable the simulation of Bfloat16: -* In the [Benchmark App](../../samples/cpp/benchmark_app/README.md), add the `-enforcebf16=true` option -* In C++ API, set `KEY_ENFORCE_BF16` to `YES` -* In C API: -``` -ie_config_t config = { "ENFORCE_BF16", "YES", NULL}; -ie_core_load_network(core, network, device_name, &config, &exe_network); -``` - -### Performance Counters - -Information about layer precision is stored in the performance counters that are available from the Inference Engine API. The layers have the following marks: - -* Suffix `BF16` for layers that had bfloat16 data type input and were computed in BF16 precision -* Suffix `FP32` for layers computed in 32-bit precision - -For example, the performance counters table for the Inception model can look as follows: - -``` -pool5 EXECUTED layerType: Pooling realTime: 143 cpu: 143 execType: jit_avx512_BF16 -fc6 EXECUTED layerType: FullyConnected realTime: 47723 cpu: 47723 execType: jit_gemm_BF16 -relu6 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef -fc7 EXECUTED layerType: FullyConnected realTime: 7558 cpu: 7558 execType: jit_gemm_BF16 -relu7 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef -fc8 EXECUTED layerType: FullyConnected realTime: 2193 cpu: 2193 execType: jit_gemm_BF16 -prob EXECUTED layerType: SoftMax realTime: 68 cpu: 68 execType: jit_avx512_FP32 -``` - -The **execType** column of the table includes inference primitives with specific suffixes. - -## Bfloat16 Inference Usage (Python) - -@sphinxdirective -.. raw:: html - -
Python
-@endsphinxdirective - -### Disclaimer - -Inference Engine with the bfloat16 inference implemented on CPU must support the native *avx512_bf16* instruction and therefore the bfloat16 data format. It is possible to use bfloat16 inference in simulation mode on platforms with Intel® Advanced Vector Extensions 512 (Intel® AVX-512), but it leads to significant performance degradation in comparison with FP32 or native *avx512_bf16* instruction usage. - -### Introduction -Bfloat16 computations (referred to as BF16) is the Brain Floating-Point format with 16 bits. This is a truncated 16-bit version of the 32-bit IEEE 754 single-precision floating-point format FP32. BF16 preserves 8 exponent bits as FP32 but reduces precision of the sign and mantissa from 24 bits to 8 bits. - -![bf16_format] - -Preserving the exponent bits keeps BF16 to the same range as the FP32 (~1e-38 to ~3e38). This simplifies conversion between two data types: you just need to skip or flush to zero 16 low bits. Truncated mantissa leads to occasionally less precision, but according to investigations, neural networks are more sensitive to the size of the exponent than the mantissa size. Also, in lots of models, precision is needed close to zero but not so much at the maximum range. Another useful feature of BF16 is possibility to encode INT8 in BF16 without loss of accuracy, because INT8 range completely fits in BF16 mantissa field. It reduces data flow in conversion from INT8 input image data to BF16 directly without intermediate representation in FP32, or in combination of [INT8 inference](Int8Inference.md) and BF16 layers. - -See the [BFLOAT16 – Hardware Numerics Definition white paper](https://software.intel.com/content/dam/develop/external/us/en/documents/bf16-hardware-numerics-definition-white-paper.pdf) for more bfloat16 format details. - -There are two ways to check if CPU device can support bfloat16 computations for models: - -1. Query the instruction set using one of these system commands: - * `lscpu | grep avx512_bf16` - * `cat /proc/cpuinfo | grep avx512_bf16` -2. Use the Query API with METRIC_KEY(OPTIMIZATION_CAPABILITIES), which should return BF16 in the list of CPU optimization options: - -```python -from openvino.inference_engine import IECore - -ie = IECore() -net = ie.read_network(path_to_xml_file) -cpu_caps = ie.get_metric(metric_name="OPTIMIZATION_CAPABILITIES", device_name="CPU") -``` - -The current Inference Engine solution for bfloat16 inference uses the Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) and supports inference of the significant number of layers in BF16 computation mode. - -### Lowering Inference Precision - -Lowering precision to increase performance is widely used for optimization of inference. The bfloat16 data type usage on CPU for the first time opens the possibility of default optimization approach. The embodiment of this approach is to use the optimization capabilities of the current platform to achieve maximum performance while maintaining the accuracy of calculations within the acceptable range. - -Using Bfloat16 precision provides the following performance benefits: - -1. Faster multiplication of two BF16 numbers because of shorter mantissa of bfloat16 data. -2. No need to support denormals and handling exceptions as this is a performance optimization. -3. Fast conversion of float32 to bfloat16 and vice versa. -4. Reduced size of data in memory, as a result, larger models fit in the same memory bounds. -5. Reduced amount of data that must be transferred, as a result, reduced data transition time. - -For default optimization on CPU, the source model is converted from FP32 or FP16 to BF16 and executed internally on platforms with native BF16 support. In this case, ENFORCE_BF16 is set to YES. The code below demonstrates how to check if the key is set: - -```python -from openvino.inference_engine import IECore - -ie = IECore() -net = ie.read_network(path_to_xml_file) -exec_net = ie.load_network(network=net, device_name="CPU") -exec_net.get_config("ENFORCE_BF16") -``` - -To enable BF16 internal transformations, set the key "ENFORCE_BF16" to "YES" in the ExecutableNetwork configuration. - -```python -bf16_config = {"ENFORCE_BF16" : "YES"} -exec_net = ie.load_network(network=net, device_name="CPU", config = bf16_config) -``` - -To disable BF16 internal transformations, set the key "ENFORCE_BF16" to "NO". In this case, the model infers as is without modifications with precisions that were set on each layer edge. - -An exception with the message `Platform doesn't support BF16 format` is formed in case of setting "ENFORCE_BF16" to "YES"on CPU without native BF16 support or BF16 simulation mode. - -Low-Precision 8-bit integer models cannot be converted to BF16, even if bfloat16 optimization is set by default. - -### Bfloat16 Simulation Mode - -Bfloat16 simulation mode is available on CPU and Intel® AVX-512 platforms that do not support the native avx512_bf16 instruction. The simulator does not guarantee good performance. Note that the CPU must still support the AVX-512 extensions. - -#### To Enable the simulation of Bfloat16: - -* In the Benchmark App, add the -enforcebf16=true option -* In Python, use the following code as an example: - -```python -from openvino.inference_engine import IECore - -ie = IECore() -net = ie.read_network(path_to_xml_file) -bf16_config = {"ENFORCE_BF16" : "YES"} -exec_net = ie.load_network(network=net, device_name="CPU", config=bf16_config) -``` - -### Performance Counters - -Information about layer precision is stored in the performance counters that are available from the Inference Engine API. The layers have the following marks: - -* Suffix *BF16* for layers that had bfloat16 data type input and were computed in BF16 precision -* Suffix *FP32* for layers computed in 32-bit precision - -For example, the performance counters table for the Inception model can look as follows: - -``` -pool5 EXECUTED layerType: Pooling realTime: 143 cpu: 143 execType: jit_avx512_BF16 -fc6 EXECUTED layerType: FullyConnected realTime: 47723 cpu: 47723 execType: jit_gemm_BF16 -relu6 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef -fc7 EXECUTED layerType: FullyConnected realTime: 7558 cpu: 7558 execType: jit_gemm_BF16 -relu7 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef -fc8 EXECUTED layerType: FullyConnected realTime: 2193 cpu: 2193 execType: jit_gemm_BF16 -prob EXECUTED layerType: SoftMax realTime: 68 cpu: 68 execType: jit_avx512_FP32 -``` - - -The **execType** column of the table includes inference primitives with specific suffixes. - -[bf16_format]: img/bf16_format.png diff --git a/docs/OV_Runtime_UG/supported_plugins/CPU.md b/docs/OV_Runtime_UG/supported_plugins/CPU.md index 71c3dab270eafa..6515d346834a70 100644 --- a/docs/OV_Runtime_UG/supported_plugins/CPU.md +++ b/docs/OV_Runtime_UG/supported_plugins/CPU.md @@ -1,148 +1,214 @@ # CPU device {#openvino_docs_OV_UG_supported_plugins_CPU} -@sphinxdirective +The CPU plugin is developed to achieve high performance inference of neural networks on Intel® x86-64 CPUs. +For an in-depth description of CPU plugin, see -.. toctree:: - :maxdepth: 1 - :hidden: +- [CPU plugin developers documentation](https://github.com/openvinotoolkit/openvino/wiki/CPUPluginDevelopersDocs) - openvino_docs_IE_DG_Bfloat16Inference +- [OpenVINO Runtime CPU plugin source files](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_cpu/) -@endsphinxdirective -## Introducing the CPU Plugin -The CPU plugin was developed to achieve high performance of neural networks on CPU, using the Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN). +The CPU plugin is a part of the Intel® Distribution of OpenVINO™ toolkit. -Currently, the CPU plugin uses Intel® Threading Building Blocks (Intel® TBB) in order to parallelize calculations. Please refer to the [Optimization Guide](../../optimization_guide/dldt_optimization_guide.md) for associated performance considerations. +## Device name +For the CPU plugin `"CPU"` device name is used, and even though there can be more than one socket on a platform, from the plugin's point of view, there is only one `"CPU"` device. +On multi-socket platforms, load balancing and memory usage distribution between NUMA nodes are handled automatically. +In order to use CPU for inference the device name should be passed to `ov::Core::compile_model()` method: -The set of supported layers can be expanded with [the Extensibility mechanism](../../Extensibility_UG/Intro.md). +@snippet snippets/cpu/compile_model.cpp compile_model_default -## Supported Platforms +## Supported inference data types +CPU plugin supports the following data types as inference precision of internal primitives: -OpenVINO™ toolkit, including the CPU plugin, is officially supported and validated on the following platforms: +- Floating-point data types: + - f32 + - bf16 +- Integer data types: + - i32 +- Quantized data types: + - u8 + - i8 + - u1 + +[Hello Query Device C++ Sample](../../../samples/cpp/hello_query_device/README.md) can be used to print out supported data types for all detected devices. -| Host | OS (64-bit) | -| :--- | :--- | -| Development | Ubuntu* 18.04 or 20.04, CentOS* 7.6, MS Windows* 10, macOS* 10.15 | -| Target | Ubuntu* 18.04 or 20.04, CentOS* 7.6, MS Windows* 10, macOS* 10.15 | +### Quantized data types specifics -The CPU plugin supports inference on Intel® Xeon® with Intel® Advanced Vector Extensions 2 (Intel® AVX2), Intel® Advanced Vector Extensions 512 (Intel® AVX-512), and AVX512_BF16, Intel® Core™ -Processors with Intel® AVX2, Intel Atom® Processors with Intel® Streaming SIMD Extensions (Intel® SSE). +Selected precision of each primitive depends on the operation precision in IR, quantization primitives, and available hardware capabilities. +u1/u8/i8 data types are used for quantized operations only, i.e. those are not selected automatically for non-quantized operations. -You can use the `-pc` flag for samples to know which configuration is used by a layer. -This flag shows execution statistics that you can use to get information about layer name, layer type, -execution status, execution time, and the type of the execution primitive. +See [low-precision optimization guide](@ref pot_docs_LowPrecisionOptimizationGuide) for more details on how to get quantized model. -## Internal CPU Plugin Optimizations +> **NOTE**: Platforms that do not support Intel® AVX512-VNNI have a known "saturation issue" which in some cases leads to reduced computational accuracy for u8/i8 precision calculations. +> See [saturation (overflow) issue section](@ref pot_saturation_issue) to get more information on how to detect such issues and possible workarounds. -The CPU plugin supports several graph optimization algorithms, such as fusing or removing layers. -Refer to the sections below for details. +### Floating point data types specifics -> **NOTE**: For layer descriptions, see the [IR Notation Reference](../../ops/opset.md). +Default floating-point precision of a CPU primitive is f32. To support f16 IRs the plugin internally converts all the f16 values to f32 and all the calculations are performed using native f32 precision. +On platforms that natively support bfloat16 calculations (have AVX512_BF16 extension) bf16 type is automatically used instead of f32 to achieve better performance, thus no special steps are required to run a model with bf16 precision. +See the [BFLOAT16 – Hardware Numerics Definition white paper](https://software.intel.com/content/dam/develop/external/us/en/documents/bf16-hardware-numerics-definition-white-paper.pdf) for more details about bfloat16 format. -### Lowering Inference Precision +Using bf16 precision provides the following performance benefits: -The CPU plugin follows a default optimization approach. This approach means that inference is made with lower precision if it is possible on a given platform to reach better performance with an acceptable range of accuracy. +- Faster multiplication of two bfloat16 numbers because of shorter mantissa of the bfloat16 data. +- Reduced memory consumption since bfloat16 data size is two times less than 32-bit float. -> **NOTE**: For details, see the [Using Bfloat16 Inference](../Bfloat16Inference.md). +To check if the CPU device can support the bfloat16 data type use the [query device properties interface](./config_properties.md) to query ov::device::capabilities property, which should contain `BF16` in the list of CPU capabilities: -### Fusing Convolution and Simple Layers +@snippet snippets/cpu/Bfloat16Inference0.cpp part0 -Merge of a convolution layer and any of the simple layers listed below: -- Activation: ReLU, ELU, Sigmoid, Clamp -- Depthwise: ScaleShift, PReLU -- FakeQuantize +In case if the model was converted to bf16, ov::hint::inference_precision is set to ov::element::bf16 and can be checked via ov::CompiledModel::get_property call. The code below demonstrates how to get the element type: -> **NOTE**: You can have any number and order of simple layers. +@snippet snippets/cpu/Bfloat16Inference1.cpp part1 -A combination of a convolution layer and simple layers results in a single fused layer called -*Convolution*: +To infer the model in f32 precision instead of bf16 on targets with native bf16 support, set the ov::hint::inference_precision to ov::element::f32. -![conv_simple_01] +@snippet snippets/cpu/Bfloat16Inference2.cpp part2 +Bfloat16 software simulation mode is available on CPUs with Intel® AVX-512 instruction set that do not support the native `avx512_bf16` instruction. This mode is used for development purposes and it does not guarantee good performance. +To enable the simulation, one have to explicitly set ov::hint::inference_precision to ov::element::bf16. -### Fusing Pooling and FakeQuantize Layers +> **NOTE**: An exception is thrown in case of setting ov::hint::inference_precision to ov::element::bf16 on CPU without native bfloat16 support or bfloat16 simulation mode. -A combination of Pooling and FakeQuantize layers results in a single fused layer called *Pooling*: +> **NOTE**: Due to the reduced mantissa size of the bfloat16 data type, the resulting bf16 inference accuracy may differ from the f32 inference, especially for models that were not trained using the bfloat16 data type. If the bf16 inference accuracy is not acceptable, it is recommended to switch to the f32 precision. + +## Supported features -![pooling_fakequant_01] +### Multi-device execution +If a machine has OpenVINO supported devices other than CPU (for example integrated GPU), then any supported model can be executed on CPU and all the other devices simultaneously. +This can be achieved by specifying `"MULTI:CPU,GPU.0"` as a target device in case of simultaneous usage of CPU and GPU. -### Fusing FullyConnected and Activation Layers +@snippet snippets/cpu/compile_model.cpp compile_model_multi -A combination of FullyConnected and Activation layers results in a single fused layer called -*FullyConnected*: +See [Multi-device execution page](../multi_device.md) for more details. -![fullyconnected_activation_01] +### Multi-stream execution +If either `ov::num_streams(n_streams)` with `n_streams > 1` or `ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)` property is set for CPU plugin, +then multiple streams are created for the model. In case of CPU plugin each stream has its own host thread which means that incoming infer requests can be processed simultaneously. +Each stream is pinned to its own group of physical cores with respect to NUMA nodes physical memory usage to minimize overhead on data transfer between NUMA nodes. +See [optimization guide](@ref openvino_docs_deployment_optimization_guide_dldt_optimization_guide) for more details. -### Fusing Convolution and Depthwise Convolution Layers Grouped with Simple Layers +> **NOTE**: When it comes to latency, one needs to keep in mind that running only one stream on multi-socket platform may introduce additional overheads on data transfer between NUMA nodes. +> In that case it is better to use ov::hint::PerformanceMode::LATENCY performance hint (please see [performance hints overview](@ref openvino_docs_OV_UG_Performance_Hints) for details). -> **NOTE**: This pattern is possible only on CPUs with support of Streaming SIMD Extensions 4.2 -> (SSE 4.2) and Intel AVX2 Instruction Set Architecture (ISA). +### Dynamic shapes +CPU plugin provides full functional support for models with dynamic shapes in terms of the opset coverage. -A combination of a group of a Convolution (or Binary Convolution) layer and simple layers and a group of a Depthwise Convolution -layer and simple layers results in a single layer called *Convolution* (or *Binary Convolution*): -> **NOTE**: Depthwise convolution layers should have the same values for the `group`, input channels, and output channels parameters. +> **NOTE**: CPU plugin does not support tensors with dynamically changing rank. In case of an attempt to infer a model with such tensors, an exception will be thrown. -![conv_depth_01] +Dynamic shapes support introduce some additional overheads on memory management and may limit internal runtime optimizations. +The more degrees of freedom we have, the more difficult it is to achieve the best performance. +The most flexible configuration is the fully undefined shape, when we do not apply any constraints to the shape dimensions, which is the most convenient approach. +But reducing the level of uncertainty will bring performance gains. +We can reduce memory consumption through memory reuse, and as a result achieve better cache locality, which in its turn leads to better inference performance, if we explicitly set dynamic shapes with defined upper bounds. -### Fusing Convolution and Sum Layers +@snippet snippets/cpu/dynamic_shape.cpp defined_upper_bound -A combination of convolution, simple, and Eltwise layers with the sum operation results in a single layer called *Convolution*: +> **NOTE**: Using fully undefined shapes may result in significantly higher memory consumption compared to inferring the same model with static shapes. +> If the memory consumption is unacceptable but dynamic shapes are still required, one can reshape the model using shapes with defined upper bound to reduce memory footprint. -![conv_sum_relu_01] +Some runtime optimizations works better if the model shapes are known in advance. +Therefore, if the input data shape is not changed between inference calls, it is recommended to use a model with static shapes or reshape the existing model with the static input shape to get the best performance. -### Fusing a Group of Convolutions +@snippet snippets/cpu/dynamic_shape.cpp static_shape -If a topology contains the following pipeline, a CPU plugin merges split, convolution, and concatenation layers into a single convolution layer with the group parameter: +See [dynamic shapes guide](../ov_dynamic_shapes.md) for more details. -![group_convolutions_01] +### Preprocessing acceleration +CPU plugin supports a full set of the preprocessing operations, providing high performance implementations for them. -> **NOTE**: Parameters of the convolution layers must coincide. +See [preprocessing API guide](../preprocessing_overview.md) for more details. +@sphinxdirective +.. dropdown:: The CPU plugin support for handling tensor precision conversion is limited to the following ov::element types: + + * bf16 + * f16 + * f32 + * f64 + * i8 + * i16 + * i32 + * i64 + * u8 + * u16 + * u32 + * u64 + * boolean +@endsphinxdirective -### Removing a Power Layer +### Models caching +CPU plugin supports Import/Export network capability. If the model caching is enabled via common OpenVINO™ `ov::cache_dir` property, the plugin will automatically create a cached blob inside the specified directory during model compilation. +This cached blob contains some intermediate representation of the network that it has after common runtime optimizations and low precision transformations. +The next time the model is compiled, the cached representation will be loaded to the plugin instead of the initial IR, so the aforementioned transformation steps will be skipped. +These transformations take a significant amount of time during model compilation, so caching this representation reduces time spent for subsequent compilations of the model, +thereby reducing first inference latency (FIL). -CPU plugin removes a Power layer from a topology if it has the following parameters: - - power = 1 - - scale = 1 - - offset = 0 +See [model caching overview](@ref openvino_docs_IE_DG_Model_caching_overview) for more details. - -## Supported Configuration Parameters +### Extensibility +CPU plugin supports fallback on `ov::Op` reference implementation if the plugin do not have its own implementation for such operation. +That means that [OpenVINO™ Extensibility Mechanism](@ref openvino_docs_Extensibility_UG_Intro) can be used for the plugin extension as well. +To enable fallback on a custom operation implementation, one have to override `ov::Op::evaluate` method in the derived operation class (see [custom OpenVINO™ operations](@ref openvino_docs_Extensibility_UG_add_openvino_ops) for details). -The plugin supports the configuration parameters listed below. -All parameters must be set with the `InferenceEngine::Core::LoadNetwork()` method. -When specifying key values as raw strings (that is, when using Python API), omit the `KEY_` prefix. -Refer to the OpenVINO samples for usage examples: [Benchmark App](../../../samples/cpp/benchmark_app/README.md). +> **NOTE**: At the moment, custom operations with internal dynamism (when the output tensor shape can only be determined as a result of performing the operation) are not supported by the plugin. -These are general options, also supported by other plugins: +### Stateful models +CPU plugin supports stateful models without any limitations. -| Parameter name | Parameter values | Default | Description | -| :--- | :--- | :--- | :----------------------------------------------------------------------------------------------------------------------------| -| KEY_EXCLUSIVE_ASYNC_REQUESTS | YES/NO | NO | Forces async requests (also from different executable networks) to execute serially. This prevents potential oversubscription| -| KEY_PERF_COUNT | YES/NO | NO | Enables gathering performance counters | +See [stateful models guide](@ref openvino_docs_IE_DG_network_state_intro) for details. -CPU-specific settings: +## Supported properties +The plugin supports the properties listed below. -| Parameter name | Parameter values | Default | Description | -| :--- | :--- | :--- | :--- | -| KEY_CPU_THREADS_NUM | positive integer values| 0 | Specifies the number of threads that CPU plugin should use for inference. Zero (default) means using all (logical) cores| -| KEY_CPU_BIND_THREAD | YES/NUMA/NO | YES | Binds inference threads to CPU cores. 'YES' (default) binding option maps threads to cores - this works best for static/synthetic scenarios like benchmarks. The 'NUMA' binding is more relaxed, binding inference threads only to NUMA nodes, leaving further scheduling to specific cores to the OS. This option might perform better in the real-life/contended scenarios. Note that for the latency-oriented cases (number of the streams is less or equal to the number of NUMA nodes, see below) both YES and NUMA options limit number of inference threads to the number of hardware cores (ignoring hyper-threading) on the multi-socket machines. | -| KEY_CPU_THROUGHPUT_STREAMS | KEY_CPU_THROUGHPUT_NUMA, KEY_CPU_THROUGHPUT_AUTO, or positive integer values| 1 | Specifies number of CPU "execution" streams for the throughput mode. Upper bound for the number of inference requests that can be executed simultaneously. All available CPU cores are evenly distributed between the streams. The default value is 1, which implies latency-oriented behavior for single NUMA-node machine, with all available cores processing requests one by one. On the multi-socket (multiple NUMA nodes) machine, the best latency numbers usually achieved with a number of streams matching the number of NUMA-nodes.
KEY_CPU_THROUGHPUT_NUMA creates as many streams as needed to accommodate NUMA and avoid associated penalties.
KEY_CPU_THROUGHPUT_AUTO creates bare minimum of streams to improve the performance; this is the most portable option if you don't know how many cores your target machine has (and what would be the optimal number of streams). Note that your application should provide enough parallel slack (for example, run many inference requests) to leverage the throughput mode.
Non-negative integer value creates the requested number of streams. If a number of streams is 0, no internal streams are created and user threads are interpreted as stream master threads.| -| KEY_ENFORCE_BF16 | YES/NO| YES | The name for setting to execute in [bfloat16 precision](../Bfloat16Inference.md) whenever it is possible. This option lets plugin know to downscale the precision where it sees performance benefits from bfloat16 execution. Such option does not guarantee accuracy of the network, you need to verify the accuracy in this mode separately, based on performance and accuracy results. It should be your decision whether to use this option or not. | +### Read-write properties +All parameters must be set before calling `ov::Core::compile_model()` in order to take effect or passed as additional argument to `ov::Core::compile_model()` -> **NOTE**: To disable all internal threading, use the following set of configuration parameters: `KEY_CPU_THROUGHPUT_STREAMS=0`, `KEY_CPU_THREADS_NUM=1`, `KEY_CPU_BIND_THREAD=NO`. +- ov::enable_profiling +- ov::hint::inference_precision +- ov::hint::performance_mode +- ov::hint::num_request +- ov::num_streams +- ov::affinity +- ov::inference_num_threads + + +### Read-only properties +- ov::cache_dir +- ov::supported_properties +- ov::available_devices +- ov::range_for_async_infer_requests +- ov::range_for_streams +- ov::device::full_name +- ov::device::capabilities + +## External dependencies +For some performance-critical DL operations, the CPU plugin uses optimized implementations from the oneAPI Deep Neural Network Library ([oneDNN](https://github.com/oneapi-src/oneDNN)). + +@sphinxdirective +.. dropdown:: The following operations are implemented using primitives from the OneDNN library: + + * AvgPool + * Concat + * Convolution + * ConvolutionBackpropData + * GroupConvolution + * GroupConvolutionBackpropData + * GRUCell + * GRUSequence + * LRN + * LSTMCell + * LSTMSequence + * MatMul + * MaxPool + * RNNCell + * RNNSequence + * SoftMax +@endsphinxdirective ## See Also * [Supported Devices](Supported_Devices.md) +* [Optimization guide](@ref openvino_docs_optimization_guide_dldt_optimization_guide) +* [СPU plugin developers documentation](https://github.com/openvinotoolkit/openvino/wiki/CPUPluginDevelopersDocs) -[mkldnn_group_conv]: ../img/mkldnn_group_conv.png -[mkldnn_conv_sum]: ../img/mkldnn_conv_sum.png -[mkldnn_conv_sum_result]: ../img/mkldnn_conv_sum_result.png -[conv_simple_01]: ../img/conv_simple_01.png -[pooling_fakequant_01]: ../img/pooling_fakequant_01.png -[fullyconnected_activation_01]: ../img/fullyconnected_activation_01.png -[conv_depth_01]: ../img/conv_depth_01.png -[group_convolutions_01]: ../img/group_convolutions_01.png -[conv_sum_relu_01]: ../img/conv_sum_relu_01.png diff --git a/docs/OV_Runtime_UG/supported_plugins/Device_Plugins.md b/docs/OV_Runtime_UG/supported_plugins/Device_Plugins.md index d9515d6d4abd4c..2e79c9a7bc73ce 100644 --- a/docs/OV_Runtime_UG/supported_plugins/Device_Plugins.md +++ b/docs/OV_Runtime_UG/supported_plugins/Device_Plugins.md @@ -19,7 +19,7 @@ The OpenVINO Runtime provides capabilities to infer deep learning models on the | Plugin | Device types | |--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| -|[CPU](CPU.md) |Intel® Xeon® with Intel® Advanced Vector Extensions 2 (Intel® AVX2), Intel® Advanced Vector Extensions 512 (Intel® AVX-512), and AVX512_BF16, Intel® Core™ Processors with Intel® AVX2, Intel® Atom® Processors with Intel® Streaming SIMD Extensions (Intel® SSE) | +|[CPU](CPU.md) |Intel® Xeon®, Intel® Core™ and Intel® Atom® processors with Intel® Streaming SIMD Extensions (Intel® SSE4.2), Intel® Advanced Vector Extensions 2 (Intel® AVX2), Intel® Advanced Vector Extensions 512 (Intel® AVX-512), Intel® Vector Neural Network Instructions (Intel® AVX512-VNNI) and bfloat16 extension for AVX-512 (Intel® AVX-512_BF16 Extension)| |[GPU](GPU.md) |Intel® Graphics, including Intel® HD Graphics, Intel® UHD Graphics, Intel® Iris® Graphics, Intel® Xe Graphics, Intel® Xe MAX Graphics | |[VPUs](VPU.md) |Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X, Intel® Vision Accelerator Design with Intel® Movidius™ VPUs | |[GNA](GNA.md) |[Intel® Speech Enabling Developer Kit](https://www.intel.com/content/www/us/en/support/articles/000026156/boards-and-kits/smart-home.html); [Amazon Alexa\* Premium Far-Field Developer Kit](https://developer.amazon.com/en-US/alexa/alexa-voice-service/dev-kits/amazon-premium-voice); [Intel® Pentium® Silver Processors N5xxx, J5xxx and Intel® Celeron® Processors N4xxx, J4xxx (formerly codenamed Gemini Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/83915/gemini-lake.html): [Intel® Pentium® Silver J5005 Processor](https://ark.intel.com/content/www/us/en/ark/products/128984/intel-pentium-silver-j5005-processor-4m-cache-up-to-2-80-ghz.html), [Intel® Pentium® Silver N5000 Processor](https://ark.intel.com/content/www/us/en/ark/products/128990/intel-pentium-silver-n5000-processor-4m-cache-up-to-2-70-ghz.html), [Intel® Celeron® J4005 Processor](https://ark.intel.com/content/www/us/en/ark/products/128992/intel-celeron-j4005-processor-4m-cache-up-to-2-70-ghz.html), [Intel® Celeron® J4105 Processor](https://ark.intel.com/content/www/us/en/ark/products/128989/intel-celeron-j4105-processor-4m-cache-up-to-2-50-ghz.html), [Intel® Celeron® J4125 Processor](https://ark.intel.com/content/www/us/en/ark/products/197305/intel-celeron-processor-j4125-4m-cache-up-to-2-70-ghz.html), [Intel® Celeron® Processor N4100](https://ark.intel.com/content/www/us/en/ark/products/128983/intel-celeron-processor-n4100-4m-cache-up-to-2-40-ghz.html), [Intel® Celeron® Processor N4000](https://ark.intel.com/content/www/us/en/ark/products/128988/intel-celeron-processor-n4000-4m-cache-up-to-2-60-ghz.html); [Intel® Pentium® Processors N6xxx, J6xxx, Intel® Celeron® Processors N6xxx, J6xxx and Intel Atom® x6xxxxx (formerly codenamed Elkhart Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/128825/products-formerly-elkhart-lake.html); [Intel® Core™ Processors (formerly codenamed Cannon Lake)](https://ark.intel.com/content/www/us/en/ark/products/136863/intel-core-i3-8121u-processor-4m-cache-up-to-3-20-ghz.html); [10th Generation Intel® Core™ Processors (formerly codenamed Ice Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/74979/ice-lake.html): [Intel® Core™ i7-1065G7 Processor](https://ark.intel.com/content/www/us/en/ark/products/196597/intel-core-i71065g7-processor-8m-cache-up-to-3-90-ghz.html), [Intel® Core™ i7-1060G7 Processor](https://ark.intel.com/content/www/us/en/ark/products/197120/intel-core-i71060g7-processor-8m-cache-up-to-3-80-ghz.html), [Intel® Core™ i5-1035G4 Processor](https://ark.intel.com/content/www/us/en/ark/products/196591/intel-core-i51035g4-processor-6m-cache-up-to-3-70-ghz.html), [Intel® Core™ i5-1035G7 Processor](https://ark.intel.com/content/www/us/en/ark/products/196592/intel-core-i51035g7-processor-6m-cache-up-to-3-70-ghz.html), [Intel® Core™ i5-1035G1 Processor](https://ark.intel.com/content/www/us/en/ark/products/196603/intel-core-i51035g1-processor-6m-cache-up-to-3-60-ghz.html), [Intel® Core™ i5-1030G7 Processor](https://ark.intel.com/content/www/us/en/ark/products/197119/intel-core-i51030g7-processor-6m-cache-up-to-3-50-ghz.html), [Intel® Core™ i5-1030G4 Processor](https://ark.intel.com/content/www/us/en/ark/products/197121/intel-core-i51030g4-processor-6m-cache-up-to-3-50-ghz.html), [Intel® Core™ i3-1005G1 Processor](https://ark.intel.com/content/www/us/en/ark/products/196588/intel-core-i31005g1-processor-4m-cache-up-to-3-40-ghz.html), [Intel® Core™ i3-1000G1 Processor](https://ark.intel.com/content/www/us/en/ark/products/197122/intel-core-i31000g1-processor-4m-cache-up-to-3-20-ghz.html), [Intel® Core™ i3-1000G4 Processor](https://ark.intel.com/content/www/us/en/ark/products/197123/intel-core-i31000g4-processor-4m-cache-up-to-3-20-ghz.html); [11th Generation Intel® Core™ Processors (formerly codenamed Tiger Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/88759/tiger-lake.html); [12th Generation Intel® Core™ Processors (formerly codenamed Alder Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/147470/products-formerly-alder-lake.html)| diff --git a/docs/img/conv_depth_01.png b/docs/img/conv_depth_01.png deleted file mode 100644 index 516b01d6d1b0d3..00000000000000 --- a/docs/img/conv_depth_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80edd1da1c5673d18afa44bc2c0503ba9ecdcc37c2acb94960303b61c602ceee -size 12649 diff --git a/docs/img/conv_simple_01.png b/docs/img/conv_simple_01.png deleted file mode 100644 index 6de6f46e36e3af..00000000000000 --- a/docs/img/conv_simple_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3e8856aa175d6fcf940af57a53f962ff6c58acf0a3838bfccc6a093bff1756d -size 9015 diff --git a/docs/img/conv_sum_relu_01.png b/docs/img/conv_sum_relu_01.png deleted file mode 100644 index 7007115294fbac..00000000000000 --- a/docs/img/conv_sum_relu_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7d53ce33f180cf4d170bbeb69635ee7c49a67d3f6ee8b1c01ec12568fe1cca38 -size 17157 diff --git a/docs/img/fullyconnected_activation_01.png b/docs/img/fullyconnected_activation_01.png deleted file mode 100644 index 776b14b46feb2a..00000000000000 --- a/docs/img/fullyconnected_activation_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:88745fd132531e943d59afe59ed6af8eaae6b62ba1fda2493dfef76080d31a25 -size 7788 diff --git a/docs/img/group_convolutions_01.png b/docs/img/group_convolutions_01.png deleted file mode 100644 index 237523823c3503..00000000000000 --- a/docs/img/group_convolutions_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9709bc83f903943b4d737d379babf80a391a72ad8eab98e71abcc0de5424fbfc -size 12361 diff --git a/docs/img/mkldnn_conv_sum.png b/docs/img/mkldnn_conv_sum.png deleted file mode 100644 index d1c56f77128b3f..00000000000000 --- a/docs/img/mkldnn_conv_sum.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:af2641e8e685b027123681ab542162932b008eff257ef5b7105950bfe8b4ade8 -size 10373 diff --git a/docs/img/mkldnn_conv_sum_result.png b/docs/img/mkldnn_conv_sum_result.png deleted file mode 100644 index 67dc87cd3263b7..00000000000000 --- a/docs/img/mkldnn_conv_sum_result.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02efdda675c16def7c2705e978964ce8bf65d1ec6cedfdb0a5afc837fb57abf0 -size 5660 diff --git a/docs/img/mkldnn_group_conv.png b/docs/img/mkldnn_group_conv.png deleted file mode 100644 index c433a6b5484a1b..00000000000000 --- a/docs/img/mkldnn_group_conv.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e69242d80da7676311e20e5db67c01bd6562008ecf3a53df8fdedaefabb91b70 -size 7226 diff --git a/docs/img/pooling_fakequant_01.png b/docs/img/pooling_fakequant_01.png deleted file mode 100644 index 2310488df403a9..00000000000000 --- a/docs/img/pooling_fakequant_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37c7908d2379cc2ba1909965c58de7bc55d131a330c47e173321c718846d6745 -size 7809 diff --git a/docs/snippets/Bfloat16Inference0.cpp b/docs/snippets/Bfloat16Inference0.cpp deleted file mode 100644 index a5b91778e6b0e3..00000000000000 --- a/docs/snippets/Bfloat16Inference0.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part0] -InferenceEngine::Core core; -auto cpuOptimizationCapabilities = core.GetMetric("CPU", METRIC_KEY(OPTIMIZATION_CAPABILITIES)).as>(); -//! [part0] -return 0; -} diff --git a/docs/snippets/Bfloat16Inference1.cpp b/docs/snippets/Bfloat16Inference1.cpp deleted file mode 100644 index c3dbd23e1cd915..00000000000000 --- a/docs/snippets/Bfloat16Inference1.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part1] -InferenceEngine::Core core; -auto network = core.ReadNetwork("sample.xml"); -auto exeNetwork = core.LoadNetwork(network, "CPU"); -auto enforceBF16 = exeNetwork.GetConfig(PluginConfigParams::KEY_ENFORCE_BF16).as(); -//! [part1] - -return 0; -} diff --git a/docs/snippets/Bfloat16Inference2.cpp b/docs/snippets/Bfloat16Inference2.cpp deleted file mode 100644 index 2d231830677ff7..00000000000000 --- a/docs/snippets/Bfloat16Inference2.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part2] -InferenceEngine::Core core; -core.SetConfig({ { CONFIG_KEY(ENFORCE_BF16), CONFIG_VALUE(NO) } }, "CPU"); -//! [part2] - -return 0; -} diff --git a/docs/snippets/cpu/Bfloat16Inference0.cpp b/docs/snippets/cpu/Bfloat16Inference0.cpp new file mode 100644 index 00000000000000..8df7ddaf3f7c7f --- /dev/null +++ b/docs/snippets/cpu/Bfloat16Inference0.cpp @@ -0,0 +1,9 @@ +#include + +int main() { +//! [part0] +ov::Core core; +auto cpuOptimizationCapabilities = core.get_property("CPU", ov::device::capabilities); +//! [part0] +return 0; +} diff --git a/docs/snippets/cpu/Bfloat16Inference1.cpp b/docs/snippets/cpu/Bfloat16Inference1.cpp new file mode 100644 index 00000000000000..51850c6018db69 --- /dev/null +++ b/docs/snippets/cpu/Bfloat16Inference1.cpp @@ -0,0 +1,13 @@ +#include + +int main() { +using namespace InferenceEngine; +//! [part1] +ov::Core core; +auto network = core.read_model("sample.xml"); +auto exec_network = core.compile_model(network, "CPU"); +auto inference_precision = exec_network.get_property(ov::hint::inference_precision); +//! [part1] + +return 0; +} diff --git a/docs/snippets/cpu/Bfloat16Inference2.cpp b/docs/snippets/cpu/Bfloat16Inference2.cpp new file mode 100644 index 00000000000000..c06a6491b89432 --- /dev/null +++ b/docs/snippets/cpu/Bfloat16Inference2.cpp @@ -0,0 +1,11 @@ +#include + +int main() { +using namespace InferenceEngine; +//! [part2] +ov::Core core; +core.set_property("CPU", ov::hint::inference_precision(ov::element::f32)); +//! [part2] + +return 0; +} diff --git a/docs/snippets/cpu/compile_model.cpp b/docs/snippets/cpu/compile_model.cpp new file mode 100644 index 00000000000000..be84b353cd740b --- /dev/null +++ b/docs/snippets/cpu/compile_model.cpp @@ -0,0 +1,20 @@ +#include + + +int main() { + { + //! [compile_model_default] + ov::Core core; + auto model = core.read_model("model.xml"); + auto compiled_model = core.compile_model(model, "CPU"); + //! [compile_model_default] + } + + { + //! [compile_model_multi] + ov::Core core; + auto model = core.read_model("model.xml"); + auto compiled_model = core.compile_model(model, "MULTI:CPU,GPU.0"); + //! [compile_model_multi] + } +} diff --git a/docs/snippets/cpu/dynamic_shape.cpp b/docs/snippets/cpu/dynamic_shape.cpp new file mode 100644 index 00000000000000..74a0ac7637a0b1 --- /dev/null +++ b/docs/snippets/cpu/dynamic_shape.cpp @@ -0,0 +1,25 @@ +#include + + +int main() { + { + //! [defined_upper_bound] + ov::Core core; + auto model = core.read_model("model.xml"); + + model->reshape({{ov::Dimension(1, 10), ov::Dimension(1, 20), ov::Dimension(1, 30), ov::Dimension(1, 40)}}); + //! [defined_upper_bound] + } + + { + //! [static_shape] + ov::Core core; + auto model = core.read_model("model.xml"); + ov::Shape static_shape = {10, 20, 30, 40}; + + model->reshape(static_shape); + //! [static_shape] + } + + return 0; +} From b6479bec08302b34bc8264f0511824ced31dd218 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 21 Mar 2022 12:05:04 +0300 Subject: [PATCH 5/9] DOCS: API Reference (#11063) * Renamed API reference * Try to fix API reference for new API * Fixes after self-review * Reworked OpenVINO Plugin dev guide structure * Properties * Try to fix links * Mark properties for MYRIAD & HDDL --- docs/IE_PLUGIN_DG/Intro.md | 7 +- docs/IE_PLUGIN_DG/detailed_guides.md | 18 ++++ docs/IE_PLUGIN_DG/dev_api_references.md | 17 ++++ .../PluginTransformationPipeline.md | 17 ---- docs/api/api_reference.rst | 5 +- docs/documentation.md | 2 - docs/doxyrest-config.lua | 2 +- .../include/transformations_visibility.hpp | 1 - .../include/openvino/core/core_visibility.hpp | 29 +++++++ src/core/include/openvino/core/model.hpp | 6 +- .../include/openvino/runtime/allocator.hpp | 1 + src/core/include/openvino/runtime/tensor.hpp | 5 +- src/inference/include/ie/ie_api.h | 7 +- src/inference/include/ie/ie_version.hpp | 1 - .../include/openvino/runtime/common.hpp | 1 + .../openvino/runtime/compiled_model.hpp | 1 + .../include/openvino/runtime/core.hpp | 1 + .../include/openvino/runtime/exception.hpp | 7 +- .../openvino/runtime/infer_request.hpp | 1 + .../openvino/runtime/intel_gna/properties.hpp | 18 ++++ .../openvino/runtime/intel_gpu/ocl/dx.hpp | 5 +- .../openvino/runtime/intel_gpu/ocl/ocl.hpp | 11 +++ .../openvino/runtime/intel_gpu/ocl/va.hpp | 2 + .../openvino/runtime/intel_gpu/properties.hpp | 42 +++++++++- .../runtime/intel_gpu/remote_properties.hpp | 12 +++ .../runtime/intel_myriad/hddl_properties.hpp | 20 +++++ .../intel_myriad/myriad_properties.hpp | 23 ++++- .../openvino/runtime/profiling_info.hpp | 2 + .../include/openvino/runtime/properties.hpp | 84 +++++++++++++++---- .../openvino/runtime/remote_context.hpp | 1 + .../openvino/runtime/remote_tensor.hpp | 3 +- .../openvino/runtime/variable_state.hpp | 1 + 32 files changed, 294 insertions(+), 59 deletions(-) create mode 100644 docs/IE_PLUGIN_DG/detailed_guides.md create mode 100644 docs/IE_PLUGIN_DG/dev_api_references.md delete mode 100644 docs/IE_PLUGIN_DG/plugin_transformation_pipeline/PluginTransformationPipeline.md diff --git a/docs/IE_PLUGIN_DG/Intro.md b/docs/IE_PLUGIN_DG/Intro.md index 99cbffbec9c950..5d2b467d742e6a 100644 --- a/docs/IE_PLUGIN_DG/Intro.md +++ b/docs/IE_PLUGIN_DG/Intro.md @@ -9,11 +9,12 @@ Implement Plugin Functionality Implement Executable Network Functionality - openvino_docs_ie_plugin_dg_quantized_networks Implement Synchronous Inference Request Implement Asynchronous Inference Request openvino_docs_ie_plugin_dg_plugin_build openvino_docs_ie_plugin_dg_plugin_testing + openvino_docs_ie_plugin_detailed_guides + openvino_docs_ie_plugin_api_references @endsphinxdirective @@ -61,5 +62,5 @@ Detailed guides API References ----------------------- -* [Inference Engine Plugin API](groupie_dev_api.html) -* [Inference Engine Transformation API](groupie_transformation_api.html) +* [Inference Engine Plugin API](@ref ie_dev_api) +* [Inference Engine Transformation API](@ref ie_transformation_api) diff --git a/docs/IE_PLUGIN_DG/detailed_guides.md b/docs/IE_PLUGIN_DG/detailed_guides.md new file mode 100644 index 00000000000000..bc681cde3465a5 --- /dev/null +++ b/docs/IE_PLUGIN_DG/detailed_guides.md @@ -0,0 +1,18 @@ +# Advanced Topics {#openvino_docs_ie_plugin_detailed_guides} + +@sphinxdirective + +.. toctree:: + :maxdepth: 1 + :hidden: + + openvino_docs_ie_plugin_dg_quantized_networks + openvino_docs_IE_DG_lpt + +@endsphinxdirective + +The guides below provides extra information about specific features of OpenVINO needed for understanding during OpenVINO plugin development: + +* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks) +* [Low precision transformations](@ref openvino_docs_IE_DG_lpt) guide +* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide diff --git a/docs/IE_PLUGIN_DG/dev_api_references.md b/docs/IE_PLUGIN_DG/dev_api_references.md new file mode 100644 index 00000000000000..51f26b18799832 --- /dev/null +++ b/docs/IE_PLUGIN_DG/dev_api_references.md @@ -0,0 +1,17 @@ +# Plugin API Reference {#openvino_docs_ie_plugin_api_references} + +@sphinxdirective + +.. toctree:: + :maxdepth: 1 + :hidden: + + ../groupie_dev_api + ../groupie_transformation_api + +@endsphinxdirective + +The guides below provides extra API references needed for OpenVINO plugin development: + +* [OpenVINO Plugin API](@ref ie_dev_api) +* [OpenVINO Transformation API](@ref ie_transformation_api) diff --git a/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/PluginTransformationPipeline.md b/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/PluginTransformationPipeline.md deleted file mode 100644 index 7e13077f44f98f..00000000000000 --- a/docs/IE_PLUGIN_DG/plugin_transformation_pipeline/PluginTransformationPipeline.md +++ /dev/null @@ -1,17 +0,0 @@ -# Plugin Transformation Pipeline {#openvino_docs_IE_DG_plugin_transformation_pipeline} - -@sphinxdirective - -.. toctree:: - :maxdepth: 1 - :caption: Executable Network - :hidden: - - Low Precision Transformations - -@endsphinxdirective - -Typical plugin transformation pipeline includes steps: - 1. Common transformations - 2. [Low precision transformations](@ref openvino_docs_IE_DG_lpt) - 3. Plugin specific transformations \ No newline at end of file diff --git a/docs/api/api_reference.rst b/docs/api/api_reference.rst index 7010d07c2830a6..5c34983b59c9e3 100644 --- a/docs/api/api_reference.rst +++ b/docs/api/api_reference.rst @@ -10,6 +10,7 @@ API references available: .. toctree:: :maxdepth: 2 - - ../groupie_cpp_api + + ../groupov_cpp_api + ../groupie_c_api ie_python_api/api diff --git a/docs/documentation.md b/docs/documentation.md index 4730497de1806e..f12ac83d476c5c 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -74,8 +74,6 @@ openvino_docs_Extensibility_UG_Intro openvino_docs_transformations OpenVINO Plugin Developer Guide - groupie_dev_api - Plugin Transformation Pipeline .. toctree:: :maxdepth: 1 diff --git a/docs/doxyrest-config.lua b/docs/doxyrest-config.lua index afc534d77c7eb0..1c420e04da3316 100644 --- a/docs/doxyrest-config.lua +++ b/docs/doxyrest-config.lua @@ -79,7 +79,7 @@ EXTRA_PAGE_LIST = {} --! is not set (otherwise, the title of intro file will be used). --! -INDEX_TITLE = "Inference Engine C++ API Reference" +INDEX_TITLE = "OpenVINO Runtime C++ API Reference" --! --! File with project introduction (reStructuredText). When non-nil, this file diff --git a/src/common/transformations/include/transformations_visibility.hpp b/src/common/transformations/include/transformations_visibility.hpp index b75bc4b898a73d..a5445844ee643e 100644 --- a/src/common/transformations/include/transformations_visibility.hpp +++ b/src/common/transformations/include/transformations_visibility.hpp @@ -12,7 +12,6 @@ */ /** - * @ingroup ie_cpp_api * @defgroup ie_transformation_api Inference Engine Transformation API * @brief Defines Inference Engine Transformations API which is used to transform ngraph::Function * diff --git a/src/core/include/openvino/core/core_visibility.hpp b/src/core/include/openvino/core/core_visibility.hpp index 18154e50b138de..ea41a2287cf309 100644 --- a/src/core/include/openvino/core/core_visibility.hpp +++ b/src/core/include/openvino/core/core_visibility.hpp @@ -11,6 +11,35 @@ // OPENVINO_API is used for the public API symbols. It either DLL imports or DLL exports // (or does nothing for static build) +/** + * @defgroup ov_cpp_api OpenVINO Runtime C++ API + * OpenVINO Runtime C++ API + * + * @defgroup ov_model_cpp_api Basics + * @ingroup ov_cpp_api + * OpenVINO Core C++ API to work with ov::Model, dynamic and static shapes, types + * + * @defgroup ov_ops_cpp_api Operations + * @ingroup ov_cpp_api + * OpenVINO C++ API to create operations from different opsets. Such API is used to + * creation models from code, write transformations and traverse the model graph + * + * @defgroup ov_opset_cpp_api Operation sets + * @ingroup ov_cpp_api + * OpenVINO C++ API to work with operation sets + * + * @defgroup ov_runtime_cpp_api Inference + * @ingroup ov_cpp_api + * OpenVINO Inference C++ API provides ov::Core, ov::CompiledModel, ov::InferRequest + * and ov::Tensor classes + */ + +/** + * @brief OpenVINO C++ API + * @ingroup ov_cpp_api + */ +namespace ov {} // namespace ov + #ifdef _WIN32 # pragma warning(disable : 4251) # pragma warning(disable : 4275) diff --git a/src/core/include/openvino/core/model.hpp b/src/core/include/openvino/core/model.hpp index a5a357ad865db0..a97d7800ffe790 100644 --- a/src/core/include/openvino/core/model.hpp +++ b/src/core/include/openvino/core/model.hpp @@ -34,7 +34,11 @@ class FrontEnd; } class ModelAccessor; -/// A user-defined model. + +/** + * @brief A user-defined model + * @ingroup ov_model_cpp_api + */ class OPENVINO_API Model : public std::enable_shared_from_this { friend class frontend::FrontEnd; friend OPENVINO_API std::shared_ptr clone_model(const Model& func, diff --git a/src/core/include/openvino/runtime/allocator.hpp b/src/core/include/openvino/runtime/allocator.hpp index a0f64dc4bc92fd..80d3e164b419e4 100644 --- a/src/core/include/openvino/runtime/allocator.hpp +++ b/src/core/include/openvino/runtime/allocator.hpp @@ -61,6 +61,7 @@ class Tensor; /** * @brief Wraps allocator implementation to provide safe way to store allocater loaded from shared library * And constructs default based on `new` `delete` c++ calls allocator if created without parameters + * @ingroup ov_runtime_cpp_api */ class OPENVINO_API Allocator { AllocatorImpl::Ptr _impl; diff --git a/src/core/include/openvino/runtime/tensor.hpp b/src/core/include/openvino/runtime/tensor.hpp index b58f39c0fca076..d7421f2e2d8674 100644 --- a/src/core/include/openvino/runtime/tensor.hpp +++ b/src/core/include/openvino/runtime/tensor.hpp @@ -30,8 +30,8 @@ class VariableState; /** * @brief Tensor API holding host memory - * * It can throw exceptions safely for the application, where it is properly handled. + * @ingroup ov_runtime_cpp_api */ class OPENVINO_API Tensor { protected: @@ -208,6 +208,9 @@ class OPENVINO_API Tensor { } }; +/** + * @brief A vector of Tensor's + */ using TensorVector = std::vector; namespace runtime { diff --git a/src/inference/include/ie/ie_api.h b/src/inference/include/ie/ie_api.h index 9543b532deeb44..4d05f42a2c141d 100644 --- a/src/inference/include/ie/ie_api.h +++ b/src/inference/include/ie/ie_api.h @@ -2,16 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -/** - * @defgroup ie_cpp_api Inference Engine C++ API - * Inference Engine C++ API - */ - /** * @brief The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS. - * * @file ie_api.h */ + #pragma once #if defined(OPENVINO_STATIC_LIBRARY) || defined(USE_STATIC_IE) || (defined(__GNUC__) && (__GNUC__ < 4)) diff --git a/src/inference/include/ie/ie_version.hpp b/src/inference/include/ie/ie_version.hpp index 3ea974baf1f913..a36031e58ef15d 100644 --- a/src/inference/include/ie/ie_version.hpp +++ b/src/inference/include/ie/ie_version.hpp @@ -27,7 +27,6 @@ #include "ie_api.h" /** - * @ingroup ie_cpp_api * @brief Inference Engine C++ API */ namespace InferenceEngine { diff --git a/src/inference/include/openvino/runtime/common.hpp b/src/inference/include/openvino/runtime/common.hpp index 772d1ed78639b7..4d5da824b38302 100644 --- a/src/inference/include/openvino/runtime/common.hpp +++ b/src/inference/include/openvino/runtime/common.hpp @@ -46,6 +46,7 @@ namespace ie = InferenceEngine; /** * @brief This type of map is used for result of Core::query_model + * @ingroup ov_runtime_cpp_api * - `key` means operation name * - `value` means device name supporting this operation */ diff --git a/src/inference/include/openvino/runtime/compiled_model.hpp b/src/inference/include/openvino/runtime/compiled_model.hpp index 5d81f69242c96c..4ee42d225317be 100644 --- a/src/inference/include/openvino/runtime/compiled_model.hpp +++ b/src/inference/include/openvino/runtime/compiled_model.hpp @@ -32,6 +32,7 @@ class InferRequest; /** * @brief This class represents a compiled model. + * @ingroup ov_runtime_cpp_api * A model is compiled by a specific device by applying multiple optimization * transformations, then mapping to compute kernels. */ diff --git a/src/inference/include/openvino/runtime/core.hpp b/src/inference/include/openvino/runtime/core.hpp index e98928f32a3244..c2f20af36ea3d6 100644 --- a/src/inference/include/openvino/runtime/core.hpp +++ b/src/inference/include/openvino/runtime/core.hpp @@ -34,6 +34,7 @@ namespace ov { /** * @brief This class represents an OpenVINO runtime Core entity. + * @ingroup ov_runtime_cpp_api * User applications can create several Core class instances, but in this case the underlying plugins * are created multiple times and not shared between several Core instances. The recommended way is to have * a single Core instance per application. diff --git a/src/inference/include/openvino/runtime/exception.hpp b/src/inference/include/openvino/runtime/exception.hpp index 1a1735eb8c33a7..4046dbcbd1b6c0 100644 --- a/src/inference/include/openvino/runtime/exception.hpp +++ b/src/inference/include/openvino/runtime/exception.hpp @@ -11,16 +11,19 @@ namespace ov { /** * @brief Thrown in case of cancelled asynchronous operation. + * @ingroup ov_runtime_cpp_api */ class OPENVINO_RUNTIME_API Cancelled : public Exception { using Exception::Exception; }; /** - * @brief Thrown in case of calling the InferRequest methods while the request is busy with compute operation. + * @brief Thrown in case of calling the InferRequest methods while the request is + * busy with compute operation. + * @ingroup ov_runtime_cpp_api */ class OPENVINO_RUNTIME_API Busy : public Exception { using Exception::Exception; }; -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/inference/include/openvino/runtime/infer_request.hpp b/src/inference/include/openvino/runtime/infer_request.hpp index 4c85e55dade9c7..3465ea1ef18a94 100644 --- a/src/inference/include/openvino/runtime/infer_request.hpp +++ b/src/inference/include/openvino/runtime/infer_request.hpp @@ -29,6 +29,7 @@ class CompiledModel; /** * @brief This is a class of infer request that can be run in asynchronous or synchronous manners. + * @ingroup ov_runtime_cpp_api */ class OPENVINO_RUNTIME_API InferRequest { std::shared_ptr _impl; diff --git a/src/inference/include/openvino/runtime/intel_gna/properties.hpp b/src/inference/include/openvino/runtime/intel_gna/properties.hpp index fc7d5d3599f1ac..e0420ea4d14256 100644 --- a/src/inference/include/openvino/runtime/intel_gna/properties.hpp +++ b/src/inference/include/openvino/runtime/intel_gna/properties.hpp @@ -14,6 +14,12 @@ namespace ov { +/** + * @defgroup ov_runtime_gna_prop_cpp_api Intel GNA specific properties + * @ingroup ov_runtime_cpp_api + * Set of Intel GNA specific properties. + */ + /** * @brief Namespace with Intel GNA specific properties */ @@ -22,12 +28,14 @@ namespace intel_gna { /** * @brief Property to get an std::string of GNA Library version, usually in the form * ... + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property library_full_version{"GNA_LIBRARY_FULL_VERSION"}; /** * @brief Scale factor provided by the user to use static quantization. * This option should be used with floating point value serialized to string with . (dot) as a decimal separator + * @ingroup ov_runtime_gna_prop_cpp_api * @details In the case of multiple inputs, individual scale factors can be provided using the * map where key is layer name and value is scale factor * Example: @@ -45,11 +53,13 @@ static constexpr Property> scale_factors_per_input{ /** * @brief if turned on, dump GNA firmware model into specified file + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property firmware_model_image_path{"GNA_FIRMWARE_MODEL_IMAGE"}; /** * @brief Enum to define software acceleration mode + * @ingroup ov_runtime_gna_prop_cpp_api */ enum class ExecutionMode { AUTO = 0, //!< Uses Intel GNA if available, otherwise uses software execution mode on CPU. @@ -103,6 +113,7 @@ inline std::istream& operator>>(std::istream& is, ExecutionMode& execution_mode) /** * @brief Enum to define HW compile and execution targets + * @ingroup ov_runtime_gna_prop_cpp_api */ enum class HWGeneration { UNDEFINED = 0, //!< GNA HW generation is undefined @@ -143,6 +154,7 @@ inline std::istream& operator>>(std::istream& is, HWGeneration& hw_generation) { /** * @brief GNA proc_type setting that should be one of AUTO, HW, GNA_HW_WITH_SW_FBACK, * GNA_SW_EXACT or SW_FP32 + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property execution_mode{"GNA_DEVICE_MODE"}; @@ -153,22 +165,26 @@ static constexpr Property execution_mode{"GNA_DEVICE_MODE"}; * If HW is not present, use the option corresponding to the latest fully supported GNA HW generation. * A fully supported GNA HW generation means it must be supported by both the OV GNA Plugin and the core GNA Library. * Currently, the latest supported GNA HW generation corresponds to GNA_3_0. + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property execution_target{"GNA_HW_EXECUTION_TARGET"}; /** * @brief The option to override the GNA HW compile target. May be one of GNA_2_0, GNA_3_0. * By default the same as execution_target. + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property compile_target{"GNA_HW_COMPILE_TARGET"}; /** * @brief if enabled produced minimum memory footprint for compiled model in GNA memory, default value is true + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property memory_reuse{"GNA_COMPACT_MODE"}; /** * @brief Enum to define PWL design algorithm + * @ingroup ov_runtime_gna_prop_cpp_api */ enum class PWLDesignAlgorithm { UNDEFINED = 0, //!< PWL approximation algorithm is undefined @@ -213,6 +229,7 @@ inline std::istream& operator>>(std::istream& is, PWLDesignAlgorithm& pwl_design * If value is UNIFORM_DISTRIBUTION then simple uniform distribution is used to create * PWL approximation of activation functions. * Uniform distribution usually gives poor approximation with the same number of segments + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property pwl_design_algorithm{"GNA_PWL_DESIGN_ALGORITHM"}; @@ -220,6 +237,7 @@ static constexpr Property pwl_design_algorithm{"GNA_PWL_DESI * @brief The option to allow to specify the maximum error percent that the optimized algorithm finding * will be used to find PWL functions. * By default (in case of NO value set), 1.0 value is used. + * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property pwl_max_error_percent{"GNA_PWL_MAX_ERROR_PERCENT"}; diff --git a/src/inference/include/openvino/runtime/intel_gpu/ocl/dx.hpp b/src/inference/include/openvino/runtime/intel_gpu/ocl/dx.hpp index 11aaab765c5174..7df9f2098995a4 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/ocl/dx.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/ocl/dx.hpp @@ -3,7 +3,7 @@ // /** - * @brief a header that defines wrappers for internal GPU plugin-specific + * @brief A header that defines wrappers for internal GPU plugin-specific * shared Video Acceleration device contexts * and shared memory tensors which contain Video Acceleration surfaces * @@ -35,6 +35,7 @@ namespace ocl { * which is shared with Direct3D 11 buffer. * The plugin object derived from this class can be obtained with D3DContext::create_tensor() call. * @note User can also obtain OpenCL buffer handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class D3DBufferTensor : public ClBufferTensor { public: @@ -62,6 +63,7 @@ class D3DBufferTensor : public ClBufferTensor { * which is shared with Direct3D 11 2D texture. * The plugin object derived from this class can be obtained with D3DContext::create_tensor() call. * @note User can also obtain OpenCL 2D image handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class D3DSurface2DTensor : public ClImage2DTensor { public: @@ -99,6 +101,7 @@ class D3DSurface2DTensor : public ClImage2DTensor { * The plugin object derived from this class can be obtained either with * CompiledModel::get_context() or Core::create_context() calls. * @note User can also obtain OpenCL context handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class D3DContext : public ClContext { public: diff --git a/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl.hpp b/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl.hpp index 3923fb2d81c733..34cbb408f31d85 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl.hpp @@ -22,6 +22,12 @@ namespace ov { namespace intel_gpu { +/** + * @defgroup ov_runtime_ocl_gpu_cpp_api Intel GPU OpenCL interoperability + * @ingroup ov_runtime_cpp_api + * Set of C++ classes and properties to work with Remote API for Intel GPU OpenCL plugin. + */ + /** * @brief Namespace with Intel GPU OpenCL specific remote objects */ @@ -29,6 +35,7 @@ namespace ocl { /** * @brief Shortcut for defining a handle parameter + * @ingroup ov_runtime_ocl_gpu_cpp_api */ using gpu_handle_param = void*; @@ -37,6 +44,7 @@ using gpu_handle_param = void*; * which can be shared with user-supplied OpenCL buffer. * The plugin object derived from this class can be obtained with ClContext::create_tensor() call. * @note User can obtain OpenCL buffer handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class ClBufferTensor : public RemoteTensor { public: @@ -81,6 +89,7 @@ class ClBufferTensor : public RemoteTensor { * which can be shared with user-supplied OpenCL 2D Image. * The plugin object derived from this class can be obtained with ClContext::create_tensor() call. * @note User can obtain OpenCL image handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class ClImage2DTensor : public RemoteTensor { public: @@ -125,6 +134,7 @@ class ClImage2DTensor : public RemoteTensor { * which can be shared with user-supplied USM device pointer. * The plugin object derived from this class can be obtained with ClContext::create_tensor() call. * @note User can obtain USM pointer from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class USMTensor : public RemoteTensor { public: @@ -155,6 +165,7 @@ class USMTensor : public RemoteTensor { * which is shared with OpenCL context object. * The plugin object derived from this class can be obtained either with * CompiledModel::get_context() or Core::create_context() calls. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class ClContext : public RemoteContext { protected: diff --git a/src/inference/include/openvino/runtime/intel_gpu/ocl/va.hpp b/src/inference/include/openvino/runtime/intel_gpu/ocl/va.hpp index 7ab313d4d655cf..89f51fe1ac31b6 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/ocl/va.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/ocl/va.hpp @@ -33,6 +33,7 @@ namespace ocl { * which is shared with VA output surface. * The plugin object derived from this class can be obtained with VAContext::create_tensor() call. * @note User can also obtain OpenCL 2D image handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class VASurfaceTensor : public ClImage2DTensor { public: @@ -69,6 +70,7 @@ class VASurfaceTensor : public ClImage2DTensor { * The plugin object derived from this class can be obtained either with * CompiledModel::get_context() or Core::create_context() calls. * @note User can also obtain OpenCL context handle from this class. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ class VAContext : public ClContext { public: diff --git a/src/inference/include/openvino/runtime/intel_gpu/properties.hpp b/src/inference/include/openvino/runtime/intel_gpu/properties.hpp index d363056a45e039..4cbe906d47db81 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/properties.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/properties.hpp @@ -14,6 +14,12 @@ namespace ov { +/** + * @defgroup ov_runtime_ocl_gpu_prop_cpp_api Intel GPU OpenCL specific properties + * @ingroup ov_runtime_cpp_api + * Set of Intel GPU OpenCL specific properties. + */ + /** * @brief Namespace with Intel GPU specific properties */ @@ -22,22 +28,26 @@ namespace intel_gpu { /** * @brief Read-only property which defines size of memory in bytes available for the device. For iGPU it returns host * memory size, for dGPU - dedicated gpu memory size + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property device_total_mem_size{"GPU_DEVICE_TOTAL_MEM_SIZE"}; /** * @brief Read-only property to get microarchitecture identifier in major.minor.revision format + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property uarch_version{"GPU_UARCH_VERSION"}; /** * @brief Read-only property to get count of execution units for current GPU + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property execution_units_count{"GPU_EXECUTION_UNITS_COUNT"}; /** * @brief Read-only property to get statistics of GPU memory allocated by engine for each allocation type * It contains information about current memory usage + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> memory_statistics{ "GPU_MEMORY_STATISTICS"}; @@ -48,7 +58,9 @@ static constexpr Property, PropertyMutability::R * not too many iteration counts (less than 16, as a rule of thumb). Turning this key off will achieve better * performance for both graph loading time and inference time with many iteration counts (greater than 16). Note that * turning this key on will increase the graph loading time in proportion to the iteration counts. - * Thus, this key should be turned off if graph loading time is considered to be most important target to optimize.*/ + * Thus, this key should be turned off if graph loading time is considered to be most important target to optimize. + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api + */ static constexpr Property enable_loop_unrolling{"GPU_ENABLE_LOOP_UNROLLING"}; namespace hint { @@ -57,6 +69,7 @@ namespace hint { * - LOW is used for CL_QUEUE_THROTTLE_LOW_KHR OpenCL throttle hint * - MEDIUM (DEFAULT) is used for CL_QUEUE_THROTTLE_MED_KHR OpenCL throttle hint * - HIGH is used for CL_QUEUE_THROTTLE_HIGH_KHR OpenCL throttle hint + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ using ThrottleLevel = ov::hint::Priority; @@ -64,6 +77,7 @@ using ThrottleLevel = ov::hint::Priority; * @brief This key instructs the GPU plugin to use OpenCL queue throttle hints * as defined in https://www.khronos.org/registry/OpenCL/specs/opencl-2.1-extensions.pdf, * chapter 9.19. This option should be used with ov::intel_gpu::hint::ThrottleLevel values. + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property queue_throttle{"GPU_QUEUE_THROTTLE"}; @@ -74,6 +88,7 @@ static constexpr Property queue_throttle{"GPU_QUEUE_THROTTLE"}; * - LOW is used for CL_QUEUE_PRIORITY_LOW_KHR OpenCL priority hint * - MEDIUM (DEFAULT) is used for CL_QUEUE_PRIORITY_MED_KHR OpenCL priority hint * - HIGH is used for CL_QUEUE_PRIORITY_HIGH_KHR OpenCL priority hint + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property queue_priority{"GPU_QUEUE_PRIORITY"}; @@ -83,11 +98,13 @@ static constexpr Property queue_priority{"GPU_QUEUE_PRIORITY * - LOW - instructs the GPU Plugin to use LITTLE cores if they are available * - MEDIUM (DEFAULT) - instructs the GPU Plugin to use any available cores (BIG or LITTLE cores) * - HIGH - instructs the GPU Plugin to use BIG cores if they are available + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property host_task_priority{"GPU_HOST_TASK_PRIORITY"}; /** * @brief This key identifies available device memory size in bytes + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api */ static constexpr Property available_device_mem{"AVAILABLE_DEVICE_MEM_SIZE"}; } // namespace hint @@ -96,15 +113,32 @@ static constexpr Property available_device_mem{"AVAILABLE_DEVICE_MEM_SI * @brief These keys instruct the GPU plugin to use surface/buffer memory type. */ namespace memory_type { -static constexpr auto surface = "GPU_SURFACE"; //!< Native video decoder surface -static constexpr auto buffer = "GPU_BUFFER"; //!< OpenCL buffer + +/** + * @brief Native video decoder surface + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api + */ +static constexpr auto surface = "GPU_SURFACE"; + +/* + * @brief OpenCL buffer + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api + */ +static constexpr auto buffer = "GPU_BUFFER"; + } // namespace memory_type /** * @brief Possible return value for ov::device::capabilities property */ namespace capability { -constexpr static const auto HW_MATMUL = "GPU_HW_MATMUL"; //!< Device has hardware block for matrix multiplication + +/** + * @brief Device has hardware block for matrix multiplication + * @ingroup ov_runtime_ocl_gpu_prop_cpp_api + */ +constexpr static const auto HW_MATMUL = "GPU_HW_MATMUL"; + } // namespace capability } // namespace intel_gpu } // namespace ov diff --git a/src/inference/include/openvino/runtime/intel_gpu/remote_properties.hpp b/src/inference/include/openvino/runtime/intel_gpu/remote_properties.hpp index 2487c16a6b23dd..a0218b9b4514be 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/remote_properties.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/remote_properties.hpp @@ -19,6 +19,7 @@ using gpu_handle_param = void*; /** * @brief Enum to define the type of the shared context + * @ingroup ov_runtime_ocl_gpu_cpp_api */ enum class ContextType { OCL = 0, //!< Pure OpenCL context @@ -54,40 +55,47 @@ inline std::istream& operator>>(std::istream& is, ContextType& context_type) { /** * @brief Shared device context type: can be either pure OpenCL (OCL) * or shared video decoder (VA_SHARED) context + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property context_type{"CONTEXT_TYPE"}; /** * @brief This key identifies OpenCL context handle * in a shared context or shared memory blob parameter map + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property ocl_context{"OCL_CONTEXT"}; /** * @brief This key identifies ID of device in OpenCL context * if multiple devices are present in the context + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property ocl_context_device_id{"OCL_CONTEXT_DEVICE_ID"}; /** * @brief In case of multi-tile system, * this key identifies tile within given context + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property tile_id{"TILE_ID"}; /** * @brief This key identifies OpenCL queue handle in a shared context + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property ocl_queue{"OCL_QUEUE"}; /** * @brief This key identifies video acceleration device/display handle * in a shared context or shared memory blob parameter map + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property va_device{"VA_DEVICE"}; /** * @brief Enum to define the type of the shared memory buffer + * @ingroup ov_runtime_ocl_gpu_cpp_api */ enum class SharedMemType { OCL_BUFFER = 0, //!< Shared OpenCL buffer blob @@ -148,18 +156,21 @@ inline std::istream& operator>>(std::istream& is, SharedMemType& share_mem_type) /** * @brief This key identifies type of internal shared memory * in a shared memory blob parameter map. + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property shared_mem_type{"SHARED_MEM_TYPE"}; /** * @brief This key identifies OpenCL memory handle * in a shared memory blob parameter map + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property mem_handle{"MEM_HANDLE"}; /** * @brief This key identifies video decoder surface handle * in a shared memory blob parameter map + * @ingroup ov_runtime_ocl_gpu_cpp_api */ #ifdef _WIN32 static constexpr Property dev_object_handle{"DEV_OBJECT_HANDLE"}; @@ -170,6 +181,7 @@ static constexpr Property dev_object_handle{"DEV_OBJECT_HANDLE"}; /** * @brief This key identifies video decoder surface plane * in a shared memory blob parameter map + * @ingroup ov_runtime_ocl_gpu_cpp_api */ static constexpr Property va_plane{"VA_PLANE"}; diff --git a/src/inference/include/openvino/runtime/intel_myriad/hddl_properties.hpp b/src/inference/include/openvino/runtime/intel_myriad/hddl_properties.hpp index f24d71a73d3f5f..bef69a5f31ff8c 100644 --- a/src/inference/include/openvino/runtime/intel_myriad/hddl_properties.hpp +++ b/src/inference/include/openvino/runtime/intel_myriad/hddl_properties.hpp @@ -18,68 +18,81 @@ namespace hddl { /** * @brief Property to get a int of the device number + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property device_num{"HDDL_DEVICE_NUM"}; /** * @brief Property to get a std::vector of device names + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_name{"HDDL_DEVICE_NAME"}; /** * @brief Property to get a std::vector of device thermal + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_thermal{"HDDL_DEVICE_THERMAL"}; /** * @brief Property to get a std::vector of device ids + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_id{"HDDL_DEVICE_ID"}; /** * @brief Property to get a std::vector of device subclasses + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_subclass{"HDDL_DEVICE_SUBCLASS"}; /** * @brief Property to get a std::vector of device total memory + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_memory_total{ "HDDL_DEVICE_MEMORY_TOTAL"}; /** * @brief Property to get a std::vector of device used memory + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_memory_used{ "HDDL_DEVICE_MEMORY_USED"}; /** * @brief Property to get a std::vector of device utilization + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_utilization{"HDDL_DEVICE_UTILIZATION"}; /** * @brief Property to get a std::vector of stream ids + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> stream_id{"HDDL_STREAM_ID"}; /** * @brief Property to get a std::vector of device tags + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> device_tag{"HDDL_DEVICE_TAG"}; /** * @brief Property to get a std::vector of group ids + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property, PropertyMutability::RO> group_id{"HDDL_GROUP_ID"}; /** * @brief Property to get a int number of device be using for group + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property device_group_using_num{"HDDL_DEVICE_GROUP_USING_NUM"}; /** * @brief Property to get a int number of total device + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property device_total_num{"HDDL_DEVICE_TOTAL_NUM"}; @@ -100,6 +113,7 @@ static constexpr Property device_total_num{"HDDL_DE * } * } * It means that an executable network marked with tagA will be executed on 3 devices + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property graph_tag{"HDDL_GRAPH_TAG"}; @@ -116,6 +130,7 @@ static constexpr Property graph_tag{"HDDL_G * "stream_device_number":5 * } * It means that 5 device will be used for stream-affinity + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property set_stream_id{"HDDL_SET_STREAM_ID"}; @@ -132,6 +147,7 @@ static constexpr Property set_stream_id{"HD * "bypass_device_number": 5 * } * It means that 5 device will be used for Bypass scheduler. + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property set_device_tag{"HDDL_SET_DEVICE_TAG"}; @@ -145,6 +161,7 @@ static constexpr Property set_device_tag{"H * If "NO", the network allocated is not bind to the device (with the specified "DEVICE_TAG"). If the same network * is allocated on multiple other devices (also set BIND_DEVICE to "False"), then inference through any handle of these * networks may be executed on any of these devices those have the network loaded. + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property bind_device{"HDDL_BIND_DEVICE"}; @@ -155,6 +172,7 @@ static constexpr Property bind_device{"HDDL_BIND_D * When there are multiple devices running a certain network (a same network running on multiple devices in Bypass * Scheduler), the device with a larger number has a higher priority, and more inference tasks will be fed to it with * priority. + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property runtime_priority{"HDDL_RUNTIME_PRIORITY"}; @@ -164,6 +182,7 @@ static constexpr Property runtime_priority{ * SGAD is short for "Single Graph All Device". With this scheduler, once application allocates 1 network, all devices * (managed by SGAD scheduler) will be loaded with this graph. The number of network that can be loaded to one device * can exceed one. Once application deallocates 1 network from device, all devices will unload the network from them. + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property use_sgad{"HDDL_USE_SGAD"}; @@ -173,6 +192,7 @@ static constexpr Property use_sgad{"HDDL_USE_SGAD" * This config gives a "group id" for a certain device when this device has been reserved for certain client, client * can use this device grouped by calling this group id while other client can't use this device * Each device has their own group id. Device in one group shares same group id. + * @ingroup ov_runtime_hddl_prop_cpp_api */ static constexpr Property group_device{"HDDL_GROUP_DEVICE"}; diff --git a/src/inference/include/openvino/runtime/intel_myriad/myriad_properties.hpp b/src/inference/include/openvino/runtime/intel_myriad/myriad_properties.hpp index db4b4403256eba..4640dcf1141276 100644 --- a/src/inference/include/openvino/runtime/intel_myriad/myriad_properties.hpp +++ b/src/inference/include/openvino/runtime/intel_myriad/myriad_properties.hpp @@ -9,6 +9,20 @@ namespace ov { +/** + * @defgroup ov_runtime_myriad_hddl_prop_cpp_api Intel MYRIAD & HDDL specific properties + * @ingroup ov_runtime_cpp_api + * Set of Intel MYRIAD & HDDL specific properties. + * + * @defgroup ov_runtime_myriad_prop_cpp_api Intel MYRIAD specific properties + * @ingroup ov_runtime_cpp_api + * Set of Intel MYRIAD specific properties. + * + * @defgroup ov_runtime_hddl_prop_cpp_api Intel HDDL specific properties + * @ingroup ov_runtime_cpp_api + * Set of Intel HDDL specific properties. + */ + /** * @brief Namespace with Intel MYRIAD specific properties */ @@ -16,11 +30,13 @@ namespace intel_myriad { /** * @brief Turn on HW stages usage (applicable for MyriadX devices only). + * @ingroup ov_runtime_myriad_hddl_prop_cpp_api */ static constexpr Property enable_hw_acceleration{"MYRIAD_ENABLE_HW_ACCELERATION"}; /** * @brief The flag for adding to the profiling information the time of obtaining a tensor. + * @ingroup ov_runtime_myriad_hddl_prop_cpp_api */ static constexpr Property enable_receiving_tensor_time{ "MYRIAD_ENABLE_RECEIVING_TENSOR_TIME"}; @@ -28,11 +44,13 @@ static constexpr Property enable_receiving_tensor_ /** * @brief This option allows to pass custom layers binding xml. * If layer is present in such an xml, it would be used during inference even if the layer is natively supported + * @ingroup ov_runtime_myriad_hddl_prop_cpp_api */ static constexpr Property custom_layers{"MYRIAD_CUSTOM_LAYERS"}; /** * @brief Enum to define possible device protocols + * @ingroup ov_runtime_myriad_hddl_prop_cpp_api */ enum class Protocol { PCIE = 0, //!< Will use a device with PCIE protocol @@ -68,16 +86,19 @@ inline std::istream& operator>>(std::istream& is, Protocol& protocol) { /** * @brief This option allows to specify protocol. + * @ingroup ov_runtime_myriad_prop_cpp_api */ static constexpr Property protocol{"MYRIAD_PROTOCOL"}; /** * @brief The flag to reset stalled devices. + * @ingroup ov_runtime_myriad_prop_cpp_api */ static constexpr Property enable_force_reset{"MYRIAD_ENABLE_FORCE_RESET"}; /** * @brief Enum to define possible device mymory types + * @ingroup ov_runtime_myriad_prop_cpp_api */ enum class DDRType { MYRIAD_DDR_AUTO = 0, //!< Automatic setting of DDR memory type @@ -127,8 +148,8 @@ inline std::istream& operator>>(std::istream& is, DDRType& ddrType) { /** * @brief This option allows to specify device memory type. + * @ingroup ov_runtime_myriad_prop_cpp_api */ - static constexpr Property ddr_type{"MYRIAD_DDR_TYPE"}; } // namespace intel_myriad } // namespace ov diff --git a/src/inference/include/openvino/runtime/profiling_info.hpp b/src/inference/include/openvino/runtime/profiling_info.hpp index 701cf719c848d2..1ab9056940ef17 100644 --- a/src/inference/include/openvino/runtime/profiling_info.hpp +++ b/src/inference/include/openvino/runtime/profiling_info.hpp @@ -18,6 +18,7 @@ namespace ov { /** * @struct ProfilingInfo * @brief Represents basic inference profiling information per operation. + * @ingroup ov_runtime_cpp_api * * If the operation is executed using tiling, the sum time per each tile is indicated as the total execution time. * Due to parallel execution, the total execution time for all nodes might be greater than the total inference time. @@ -41,6 +42,7 @@ struct ProfilingInfo { * @brief The absolute time, in microseconds, that the node ran (in total). */ std::chrono::microseconds real_time; + /** * @brief The net host CPU time that the node ran. */ diff --git a/src/inference/include/openvino/runtime/properties.hpp b/src/inference/include/openvino/runtime/properties.hpp index 90a5a8e8e68f09..a9780511942b2a 100644 --- a/src/inference/include/openvino/runtime/properties.hpp +++ b/src/inference/include/openvino/runtime/properties.hpp @@ -23,6 +23,11 @@ namespace ov { +/** + * @defgroup ov_runtime_cpp_prop_api Device properties + * @ingroup ov_runtime_cpp_api + */ + /** * @brief Enum to define property value mutability */ @@ -197,25 +202,27 @@ struct Property : public util::BaseProperty of supported read-only properties. - * * This can be used as a compiled model property as well. - * + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property, PropertyMutability::RO> supported_properties{ "SUPPORTED_PROPERTIES"}; /** * @brief Read-only property to get a std::vector of available device IDs + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property, PropertyMutability::RO> available_devices{"AVAILABLE_DEVICES"}; /** * @brief Read-only property to get a name of name of a model + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property model_name{"NETWORK_NAME"}; /** * @brief Read-only property to get an unsigned integer value of optimal number of compiled model infer requests. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property optimal_number_of_infer_requests{ "OPTIMAL_NUMBER_OF_INFER_REQUESTS"}; @@ -227,17 +234,19 @@ namespace hint { /** * @brief Hint for device to use specified precision for inference + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property inference_precision{"INFERENCE_PRECISION_HINT"}; /** * @brief Enum to define possible priorities hints + * @ingroup ov_runtime_cpp_prop_api */ enum class Priority { - LOW = 0, - MEDIUM = 1, - HIGH = 2, - DEFAULT = MEDIUM, + LOW = 0, //!< Low priority + MEDIUM = 1, //!< Medium priority + HIGH = 2, //!< High priority + DEFAULT = MEDIUM, //!< Default priority is MEDIUM }; /** @cond INTERNAL */ @@ -273,16 +282,18 @@ inline std::istream& operator>>(std::istream& is, Priority& priority) { /** * @brief High-level OpenVINO model priority hint * Defines what model should be provided with more performant bounded resource first + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property model_priority{"MODEL_PRIORITY"}; /** * @brief Enum to define possible performance mode hints + * @ingroup ov_runtime_cpp_prop_api */ enum class PerformanceMode { - UNDEFINED = -1, - LATENCY = 1, - THROUGHPUT = 2, + UNDEFINED = -1, //!< Undefined value, performance setting may vary from device to device + LATENCY = 1, //!< Optimize for latency + THROUGHPUT = 2, //!< Optimize for throughput }; /** @cond INTERNAL */ @@ -319,6 +330,7 @@ inline std::istream& operator>>(std::istream& is, PerformanceMode& performance_m * @brief High-level OpenVINO Performance Hints * unlike low-level properties that are individual (per-device), the hints are something that every device accepts * and turns into device-specific settings + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property performance_mode{"PERFORMANCE_HINT"}; @@ -326,25 +338,27 @@ static constexpr Property performance_mode{"PERFORMANCE_HINT"}; * @brief (Optional) property that backs the (above) Performance Hints * by giving additional information on how many inference requests the application will be keeping in flight * usually this value comes from the actual use-case (e.g. number of video-cameras, or other sources of inputs) + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property num_requests{"PERFORMANCE_HINT_NUM_REQUESTS"}; /** * @brief This key identifies shared pointer to the ov::Model, required for some properties (ov::max_batch_size and * ov::optimal_batch_size) + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property> model{"MODEL_PTR"}; /** * @brief Special key for auto batching feature configuration. Enabled by default + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property allow_auto_batching{"ALLOW_AUTO_BATCHING"}; } // namespace hint /** * @brief The name for setting performance counters option. - * - * It is passed to Core::set_property() + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property enable_profiling{"PERF_COUNT"}; @@ -355,6 +369,7 @@ namespace log { /** * @brief Enum to define possible log levels + * @ingroup ov_runtime_cpp_prop_api */ enum class Level { NO = -1, //!< disable any logging @@ -409,12 +424,14 @@ inline std::istream& operator>>(std::istream& is, Level& level) { /** * @brief the property for setting desirable log level. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property level{"LOG_LEVEL"}; } // namespace log /** * @brief This property defines the directory which will be used to store any data cached by plugins. + * @ingroup ov_runtime_cpp_prop_api * * The underlying cache structure is not defined and might differ between OpenVINO releases * Cached data might be platform / device specific and might be invalid after OpenVINO version change @@ -435,6 +452,7 @@ static constexpr Property cache_dir{"CACHE_DIR"}; /** * @brief Read-only property to provide information about a range for streams on platforms where streams are supported. + * @ingroup ov_runtime_cpp_prop_api * * Property returns a value of std::tuple type, where: * - First value is bottom bound. @@ -445,6 +463,7 @@ static constexpr Property, PropertyMutabi /** * @brief Read-only property to query information optimal batch size for the given device and the network + * @ingroup ov_runtime_cpp_prop_api * * Property returns a value of unsigned int type, * Returns optimal batch size for a given network on the given device. The returned value is aligned to power of 2. @@ -459,18 +478,21 @@ static constexpr Property optimal_batch_si /** * @brief Read-only property to get maximum batch size which does not cause performance degradation due to memory swap * impact. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property max_batch_size{"MAX_BATCH_SIZE"}; /** * @brief Read-write property to set the timeout used to collect the inputs for the auto-batching * impact. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property auto_batch_timeout{"AUTO_BATCH_TIMEOUT"}; /** * @brief Read-only property to provide a hint for a range for number of async infer requests. If device supports * streams, the metric provides range for number of IRs per stream. + * @ingroup ov_runtime_cpp_prop_api * * Property returns a value of std::tuple type, where: * - First value is bottom bound. @@ -488,11 +510,13 @@ namespace device { /** * @brief the property for setting of required device to execute on * values: device id starts from "0" - first device, "1" - second device, etc + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property id{"DEVICE_ID"}; /** * @brief Type for device Priorities config option, with comma-separated devices listed in the desired priority + * @ingroup ov_runtime_cpp_prop_api */ struct Priorities : public Property { private: @@ -523,11 +547,13 @@ struct Priorities : public Property { /** * @brief Device Priorities config option, with comma-separated devices listed in the desired priority + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Priorities priorities{"MULTI_DEVICE_PRIORITIES"}; /** * @brief Type for property to pass set of properties to specified device + * @ingroup ov_runtime_cpp_prop_api */ struct Properties { /** @@ -557,6 +583,7 @@ struct Properties { /** * @brief Property to pass set of property values to specified device + * @ingroup ov_runtime_cpp_prop_api * Usage Example: * @code * core.compile_model("HETERO" @@ -569,16 +596,19 @@ static constexpr Properties properties; /** * @brief Read-only property to get a std::string value representing a full device name. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property full_name{"FULL_DEVICE_NAME"}; /** * @brief Read-only property which defines the device architecture. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property architecture{"DEVICE_ARCHITECTURE"}; /** * @brief Enum to define possible device types + * @ingroup ov_runtime_cpp_prop_api */ enum class Type { INTEGRATED = 0, //!< Device is integrated into host system @@ -613,22 +643,26 @@ inline std::istream& operator>>(std::istream& is, Type& device_type) { /** * @brief Read-only property to get a type of device. See Type enum definition for possible return values + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property type{"DEVICE_TYPE"}; /** * @brief Read-only property which defines Giga OPS per second count (GFLOPS or GIOPS) for a set of precisions supported * by specified device + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property, PropertyMutability::RO> gops{"DEVICE_GOPS"}; /** - * @brief Read-only property to get a float of device thermal + * @brief Read-only property to get a float of device thermal + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property thermal{"DEVICE_THERMAL"}; /** * @brief Read-only property to get a std::vector of capabilities options per device. + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property, PropertyMutability::RO> capabilities{"OPTIMIZATION_CAPABILITIES"}; @@ -636,6 +670,10 @@ static constexpr Property, PropertyMutability::RO> capa * @brief Namespace with possible values for ov::device::capabilities property */ namespace capability { +/** + * @addtogroup ov_runtime_cpp_prop_api + * @{ + */ constexpr static const auto FP32 = "FP32"; //!< Device supports fp32 inference constexpr static const auto BF16 = "BF16"; //!< Device supports bf16 inference constexpr static const auto FP16 = "FP16"; //!< Device supports fp16 inference @@ -644,6 +682,7 @@ constexpr static const auto INT16 = "INT16"; //!< Device suppor constexpr static const auto BIN = "BIN"; //!< Device supports binary inference constexpr static const auto WINOGRAD = "WINOGRAD"; //!< Device supports winograd optimization constexpr static const auto EXPORT_IMPORT = "EXPORT_IMPORT"; //!< Device supports compiled model export and import +/** @}*/ } // namespace capability } // namespace device @@ -654,6 +693,7 @@ constexpr static const auto EXPORT_IMPORT = "EXPORT_IMPORT"; //!< Device suppor namespace streams { /** * @brief Class to represent number of streams in streams executor + * @ingroup ov_runtime_cpp_prop_api */ struct Num { using Base = std::tuple; //!< NumStreams is representable as int32_t @@ -671,12 +711,21 @@ struct Num { /** * @brief The number of executor logical partitions + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property num{"NUM_STREAMS"}; -static constexpr Num AUTO{-1}; //!< Creates bare minimum of streams to improve the performance -static constexpr Num NUMA{ - -2}; //!< Creates as many streams as needed to accommodate NUMA and avoid associated penalties +/** + * @brief Creates bare minimum of streams to improve the performance + * @ingroup ov_runtime_cpp_prop_api + */ +static constexpr Num AUTO{-1}; + +/** + * @brief Creates as many streams as needed to accommodate NUMA and avoid associated penalties + * @ingroup ov_runtime_cpp_prop_api + */ +static constexpr Num NUMA{-2}; /** @cond INTERNAL */ inline std::ostream& operator<<(std::ostream& os, const Num& num_val) { @@ -711,21 +760,25 @@ inline std::istream& operator>>(std::istream& is, Num& num_val) { /** * @brief The number of executor logical partitions + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property num_streams{"NUM_STREAMS"}; /** * @brief Maximum number of threads that can be used for inference tasks + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property inference_num_threads{"INFERENCE_NUM_THREADS"}; /** * @brief Maximum number of threads that can be used for compilation tasks + * @ingroup ov_runtime_cpp_prop_api */ static constexpr Property compilation_num_threads{"COMPILATION_NUM_THREADS"}; /** * @brief Enum to define possible affinity patterns + * @ingroup ov_runtime_cpp_prop_api */ enum class Affinity { NONE = -1, //!< Disable threads affinity pinning @@ -772,6 +825,7 @@ inline std::istream& operator>>(std::istream& is, Affinity& affinity) { /** * @brief The name for setting CPU affinity per thread option. + * @ingroup ov_runtime_cpp_prop_api * @note The setting is ignored, if the OpenVINO compiled with OpenMP and any affinity-related OpenMP's * environment variable is set (as affinity is configured explicitly) */ diff --git a/src/inference/include/openvino/runtime/remote_context.hpp b/src/inference/include/openvino/runtime/remote_context.hpp index 876ab77174e129..819347b15a8635 100644 --- a/src/inference/include/openvino/runtime/remote_context.hpp +++ b/src/inference/include/openvino/runtime/remote_context.hpp @@ -29,6 +29,7 @@ class CompiledModel; /** * @brief This class represents an abstraction + * @ingroup ov_runtime_cpp_api * for remote (non-CPU) accelerator device-specific inference context. * Such context represents a scope on the device within which compiled * models and remote memory tensors can exist, function, and exchange data. diff --git a/src/inference/include/openvino/runtime/remote_tensor.hpp b/src/inference/include/openvino/runtime/remote_tensor.hpp index bb0312b63ec028..82259e2957a97c 100644 --- a/src/inference/include/openvino/runtime/remote_tensor.hpp +++ b/src/inference/include/openvino/runtime/remote_tensor.hpp @@ -17,7 +17,8 @@ namespace ov { class RemoteContext; /** - * @brief Remote memory access and interpretation API. + * @brief Remote memory access and interoperability API. + * @ingroup ov_runtime_cpp_api */ class OPENVINO_RUNTIME_API RemoteTensor : public Tensor { using Tensor::Tensor; diff --git a/src/inference/include/openvino/runtime/variable_state.hpp b/src/inference/include/openvino/runtime/variable_state.hpp index 94b724da3560b3..42ccf7a7747005 100644 --- a/src/inference/include/openvino/runtime/variable_state.hpp +++ b/src/inference/include/openvino/runtime/variable_state.hpp @@ -25,6 +25,7 @@ class InferRequest; /** * @brief VariableState class + * @ingroup ov_runtime_cpp_api */ class OPENVINO_RUNTIME_API VariableState { std::shared_ptr _impl; From 1c616d4ed153532358eb6c15b3e4493c11dbbb73 Mon Sep 17 00:00:00 2001 From: Sergey Lyalin Date: Mon, 21 Mar 2022 13:12:07 +0300 Subject: [PATCH 6/9] Extensibility guide with FE extensions and remove OV_FRAMEWORK_MAP from docs * Rework of Extensibility Intro, adopted examples to missing OPENVINO_FRAMEWORK_MAP * Removed OPENVINO_FRAMEWORK_MAP reference * Frontend extension detailed documentation * Fixed distributed snippets * Fixed snippet inclusion in FE extension document and chapter headers * Fixed wrong name in a snippet reference * Fixed test for template extension due to changed number of loaded extensions * Update docs/Extensibility_UG/frontend_extensions.md Co-authored-by: Ivan Tikhonov * Minor fixes in extension snippets * Small grammar fix Co-authored-by: Ivan Tikhonov Co-authored-by: Ivan Tikhonov --- docs/Extensibility_UG/Intro.md | 96 ++++++++++++---- docs/Extensibility_UG/add_openvino_ops.md | 9 +- docs/Extensibility_UG/frontend_extensions.md | 105 ++++++++++++++++++ docs/snippets/ov_extensions.cpp | 110 ++++++++++++++++++- docs/snippets/ov_extensions.py | 7 +- docs/template_extension/new/CMakeLists.txt | 6 - docs/template_extension/new/identity.hpp | 9 -- docs/template_extension/new/ov_extension.cpp | 8 +- src/core/tests/extension.cpp | 4 +- 9 files changed, 303 insertions(+), 51 deletions(-) create mode 100644 docs/Extensibility_UG/frontend_extensions.md diff --git a/docs/Extensibility_UG/Intro.md b/docs/Extensibility_UG/Intro.md index 1291060b2c53ac..5473e4b37a60ee 100644 --- a/docs/Extensibility_UG/Intro.md +++ b/docs/Extensibility_UG/Intro.md @@ -1,4 +1,4 @@ -# OpenVINO Extensibility Mechanism {#openvino_docs_Extensibility_UG_Intro} +# OpenVINO Extensibility Mechanism {#openvino_docs_Extensibility_UG_Intro} @sphinxdirective @@ -7,41 +7,67 @@ :hidden: openvino_docs_Extensibility_UG_add_openvino_ops + openvino_docs_Extensibility_UG_Frontend_Extensions openvino_docs_Extensibility_UG_GPU openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer @endsphinxdirective The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with various frameworks, including -TensorFlow, PyTorch, ONNX, PaddlePaddle, MXNet, Caffe, and Kaldi. The list of supported operations (layers) is different for +TensorFlow, PyTorch, ONNX, PaddlePaddle, MXNet, Caffe, and Kaldi. The list of supported operations is different for each of the supported frameworks. To see the operations supported by your framework, refer to [Supported Framework Operations](../MO_DG/prepare_model/Supported_Frameworks_Layers.md). -Custom operations, that is those not included in the list, are not recognized by OpenVINO™ out-of-the-box. Therefore, creating Intermediate Representation (IR) for a model using them requires additional steps. This guide illustrates the workflow for running inference on topologies featuring custom operations, allowing you to plug in your own implementation for existing or completely new operations. +Custom operations, that is those not included in the list, are not recognized by OpenVINO™ out-of-the-box. The need in custom operation may appear in two main cases: -If your model contains operations not normally supported by OpenVINO™, the OpenVINO™ Extensibility API lets you add support for those custom operations and use one implementation for Model Optimizer and OpenVINO™ Runtime. +1. A regular framework operation that is new or rarely used and that’s why hasn’t been supported in OpenVINO yet. -There are two steps to support inference of a model with custom operation(s): -1. Add support for a [custom operation in the Model Optimizer](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) so -the Model Optimizer can generate the IR with the operation. -2. Create a custom operation in it as described in the [Custom Operation](add_openvino_ops.md). +2. A new user operation that was created for some specific model topology by a model author using framework extension capabilities. -## OpenVINO™ Extensions +Importing models with such operations requires additional steps. This guide illustrates the workflow for running inference on models featuring custom operations, allowing you to plug in your own implementation for them. OpenVINO™ Extensibility API lets you add support for those custom operations and use one implementation for Model Optimizer and OpenVINO™ Runtime. -OpenVINO™ provides extensions for: +Defining a new custom operation basically consist of two parts: - * [Custom OpenVINO™ Operation](add_openvino_ops.md): - - Enables the creation of unsupported operations - - Enables the use of `ov::Core::read_model` to read models with unsupported operations - - Provides a shape inference mechanism for custom operations - - Provides an evaluate method that allows you to support the operation on CPU or perform constant folding - * [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md): - - Enables support of new operations to generate IR - - Enables support of custom transformations to replace sub-graphs for performance optimization +1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). -> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details. You can review the complete code, which is fully compilable and up-to-date, to see how it works. +2. Mapping rule that facilitates conversion of framework operation representation to OpenVINO defined operation semantics. -## Load extensions to OpenVINO™ Runtime +The first part is required for inference, the second part is required for successful import of a model containing such operations from the original framework model format. There are several options to implement each part, the next sections will describe them in detail. + +## Definition of Operation Semantics + + +If the custom operation can be mathematically represented as a combination of exiting OpenVINO operations and such decomposition gives desired performance, then low-level operation implementation is not required. When deciding feasibility of such decomposition refer to the latest OpenVINO operation set. You can use any valid combination of exiting operations. How to map a custom operation is described in the next section of this document. + +If such decomposition is not possible or appears too bulky with lots of consisting operations that are not performing well, then a new class for the custom operation should be implemented as described in the [Custom Operation Guide](add_openvino_ops.md). + +Prefer implementing a custom operation class if you already have a generic C++ implementation of operation kernel. Otherwise try to decompose the operation first as described above and then after verifying correctness of inference and resulting performance, optionally invest to implementing bare metal C++ implementation. + +## Mapping from Framework Operation + +Depending on model format used for import, mapping of custom operation is implemented differently, choose one of: + +1. If model is represented in ONNX (including models exported from Pytorch in ONNX) or PaddlePaddle formats, then one of the classes from [Frontend Extension API](frontend_extensions.md) should be used. It consists of several classes available in C++ which can be used with Model Optimizer `--extensions` option or when model is imported directly to OpenVINO run-time using read_model method. Python API is also available for run-time model importing. + +2. If model is represented in TensorFlow, Caffe, Kaldi or MXNet formats, then [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) should be used. This approach is available for model conversion in Model Optimizer only. + +Existing of two approaches simultaneously is explained by two different types of frontends used for model conversion in OpenVINO: new frontends (ONNX, PaddlePaddle) and legacy frontends (TensorFlow, Caffe, Kaldi and MXNet). Model Optimizer can use both front-ends in contrast to the direct import of model with `read_model` method which can use new frontends only. Follow one of the appropriate guides referenced above to implement mappings depending on framework frontend. + +If you are implementing extensions for ONNX or PaddlePaddle new frontends and plan to use Model Optimizer `--extension` option for model conversion, then the extensions should be + +1. Implemented in C++ only + +2. Compiled as a separate shared library (see details how to do that later in this guide). + +You cannot write new frontend extensions using Python API if you plan to use them with Model Optimizer. + +Remaining part of this guide uses Frontend Extension API applicable for new frontends. + +## Registering Extensions + +A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime. + +> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works. To load the extensions to the `ov::Core` object, use the `ov::Core::add_extension` method, this method allows to load library with extensions or extensions from the code. @@ -65,11 +91,34 @@ Extensions can be loaded from code with `ov::Core::add_extension` method: @endsphinxdirective +`Identity` is custom operation class defined in [Custom Operation Guide](add_openvino_ops.md). This is enough to enable reading IR which uses `Identity` extension operation emitted by Model Optimizer. To be able to load original model directly to the runtime, you need to add also a mapping extension: + +@sphinxdirective + +.. tab:: C++ + + .. doxygensnippet:: docs/snippets/ov_extensions.cpp + :language: cpp + :fragment: add_frontend_extension + +.. tab:: Python + + .. doxygensnippet:: docs/snippets/ov_extensions.py + :language: python + :fragment: add_frontend_extension + +@endsphinxdirective + +When Python API is used there is no way to implement a custom OpenVINO operation. Also, even if custom OpenVINO operation is implemented in C++ and loaded to the runtime through a shared library, there is still no way to add a frontend mapping extension that refers to this custom operation. Use C++ shared library approach to implement both operations semantics and framework mapping in this case. + +You still can use Python for operation mapping and decomposition in case if operations from the standard OpenVINO operation set is used only. + ### Create library with extensions -You need to create extension library in following cases: - - Load extensions to Model Optimizer - - Load extensions to Python application +You need to create extension library in the following cases: + - Convert model with custom operations in Model Optimizer + - Load model with custom operations in Python application. It is applicable for both framework model and IR. + - Loading models with custom operations in tools that support loading extensions from a library, for example `benchmark_app`. If you want to create an extension library, for example in order to load these extensions to the Model Optimizer, you need to do next steps: Create an entry point for extension library. OpenVINO™ provides an `OPENVINO_CREATE_EXTENSIONS()` macro, which allows to define an entry point to a library with OpenVINO™ Extensions. @@ -118,3 +167,4 @@ After the build you can use path to your extension library to load your extensio * [OpenVINO Transformations](./ov_transformations.md) * [Using OpenVINO Runtime Samples](../OV_Runtime_UG/Samples_Overview.md) * [Hello Shape Infer SSD sample](../../samples/cpp/hello_reshape_ssd/README.md) + diff --git a/docs/Extensibility_UG/add_openvino_ops.md b/docs/Extensibility_UG/add_openvino_ops.md index 7c5ed06f1fdfc9..1c7a30bc576d3c 100644 --- a/docs/Extensibility_UG/add_openvino_ops.md +++ b/docs/Extensibility_UG/add_openvino_ops.md @@ -1,4 +1,4 @@ -# Custom OpenVINO™ Operations {#openvino_docs_Extensibility_UG_add_openvino_ops} +# Custom OpenVINO™ Operations {#openvino_docs_Extensibility_UG_add_openvino_ops} OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box. @@ -20,14 +20,10 @@ Follow the steps below to add a custom operation: 5. Override the `visit_attributes` method, which enables serialization and deserialization of operation attributes. An `AttributeVisitor` is passed to the method, and the implementation is expected to walk over all the attributes in the op using the type-aware `on_attribute` helper. Helpers are already implemented for standard C++ types like `int64_t`, `float`, `bool`, `vector`, and for existing OpenVINO defined types. -6. Override `evaluate`, which is an optional method that enables fallback of some devices to this implementation and the application of constant folding if there is a custom operation on the constant branch. If your operation contains `evaluate` method you also need to override the `has_evaluate` method, this method allow to get information about availability of `evaluate` method for the operation. - -7. Add the `OPENVINO_FRAMEWORK_MAP` macro if you want to map custom operation to framework operation with the same name. It is an optional macro which can be used for one to one mapping. In order to use this macro please include frontend specific headers: - @snippet template_extension/new/identity.hpp op:frontend_include +6. Override `evaluate`, which is an optional method that enables fallback of some devices to this implementation and the application of constant folding if there is a custom operation on the constant branch. If your operation contains `evaluate` method you also need to override the `has_evaluate` method, this method allows to get information about availability of `evaluate` method for the operation. Based on that, declaration of an operation class can look as follows: -@snippet template_extension/new/identity.hpp op:header ### Operation Constructors @@ -60,3 +56,4 @@ OpenVINO™ operation contains two constructors: `ov::Node::evaluate` method enables you to apply constant folding to an operation. @snippet template_extension/new/identity.cpp op:evaluate + diff --git a/docs/Extensibility_UG/frontend_extensions.md b/docs/Extensibility_UG/frontend_extensions.md new file mode 100644 index 00000000000000..6278ab031aea95 --- /dev/null +++ b/docs/Extensibility_UG/frontend_extensions.md @@ -0,0 +1,105 @@ +# Frontend Extensions {#openvino_docs_Extensibility_UG_Frontend_Extensions} + +The goal of this chapter is to explain how to use Frontend extension classes to facilitate mapping of custom operations from framework model representation to OpenVINO representation. Refer to [Introduction to OpenVINO Extension](Intro.md) to understand entire flow. + +This API is applicable for new frontends only, which exist for ONNX and PaddlePaddle. If a different model format is used, follow legacy [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) guide. + +> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works. + +## Single Operation Mapping with OpExtension + +This section covers the case when a single operation in framework representation is mapped to a single operation in OpenVINO representation. This is called *one-to-one mapping*. There is `OpExtension` class that works well if all the following conditions are satisfied: + +1. Number of inputs to operation in the Framework representation is the same as in the OpenVINO representation. + +2. Number of outputs is also the same in both representations. + +3. Inputs can be indexed and are mapped in order correspondingly, e.g. input with index 0 in framework representation maps to input with index 0 in OpenVINO representation and so on. + +4. The same for outputs. + +5. Each attribute in OpenVINO operation can be initialized from one of the attributes of original operation or by some predefined constant value. Value of copied attributes cannot contain expressions, value is accepted as-is, so type of a value should be compatible. + +> **NOTE**: `OpExtension` class is currently available for ONNX frontend only. PaddlePaddle frontend has named inputs and outputs for operation (not indexed) therefore OpExtension mapping is not applicable for this case. + +The next example maps ONNX operation with type [“Identity”]( https://github.com/onnx/onnx/blob/main/docs/Operators.md#Identity) to OpenVINO template extension `Identity` class. + +@snippet ov_extensions.cpp frontend_extension_Identity_header +@snippet ov_extensions.cpp frontend_extension_Identity + +The mapping doesn’t involve any attributes, as operation Identity doesn’t have them. + +Extension objects, like just constructed `extension` can be used to add to the OpenVINO runtime just before the loading a model that contains custom operations: + +@snippet ov_extensions.cpp frontend_extension_read_model + +Or extensions can be constructed in a separately compiled shared library. Separately compiled library can be used in Model Optimizer or `benchmark_app`. Read about how to build and load such library in chapter “Create library with extensions” in [Introduction to OpenVINO Extension](Intro.md). + +If operation have multiple inputs and/or outputs they will be mapped in order. The type of elements in input/output tensors should match expected types in the surrounding operations. For example, if custom operation produces `f32` data type then operation that consumes this output should also support `f32`. Otherwise, model conversion fails with an error, there are no automatic type conversion happens. + +### Converting to Standard OpenVINO Operation + +`OpExtension` class can be used when mapping to one of the operations from standard OpenVINO operation set is what you need and there is no class like `TemplateExtension::Identity` implemented. + +Here is an example for a custom framework operation “MyRelu”. Suppose it is mathematically equivalent to standard `Relu` that exists in OpenVINO operation set, but for some reason has type name “MyRelu”. In this case you can directly say that “MyRelu” -> `Relu` mapping should be used: + +@snippet ov_extensions.cpp frontend_extension_MyRelu + +In the resulting converted OpenVINO model, “MyRelu” operation will be replaced by the standard operation `Relu` from the latest available OpenVINO operation set. Notice that when standard operation is used, it can be specified using just a type string (“Relu”) instead of using a `ov::opset8::Relu` class name as a template parameter for `OpExtension`. This method is available for operations from the standard operation set only. For a user custom OpenVINO operation the corresponding class should be always specified as a template parameter as it was demonstrated with `TemplateExtension::Identity`. + +### Attributes Mapping + +As described above, `OpExtension` is useful when attributes can be mapped one by one or initialized by a constant. If the set of attributes in framework representation and OpenVINO representation completely match by their names and types, nothing should be specified in OpExtension constructor parameters. The attributes are discovered and mapped automatically based on `visit_attributes` method that should be defined for any OpenVINO operation. + +Imagine you have CustomOperation class implementation that has two attributes with names `attr1` and `attr2`: + +@snippet ov_extensions.cpp frontend_extension_CustomOperation + +And original model in framework representation also has operation with name “CustomOperatoin” with the same `attr1` and `attr2` attributes. Then with the following code: + +@snippet ov_extensions.cpp frontend_extension_CustomOperation_as_is + +both `attr1` and `attr2` are copied from framework representation to OpenVINO representation automatically. If for some reason names of attributes are different but values still can be copied “as-is” you can pass attribute names mapping in `OpExtension` constructor: + +@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename + +Where `fw_attr1` and `fw_attr2` are names for corresponding attributes in framework operation representation. + +If copying of an attribute is not what you need, `OpExtension` also can set attribute to predefined constant value. For the same `CustomOperation`, imagine you want to set `attr2` to value 5 instead of copying from `fw_attr2`, to achieve that do the following: + +@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename_set + +So the conclusion is that each attribute of target OpenVINO operation should be initialized either by + +1. Setting automatically due to name matching + +2. Mapped by attribute name + +3. Set to a constant value + +This is achieved by specifying maps as arguments for `OpExtension` constructor. + + +## Mapping to Multiple Operations with ConversionExtension + +Previous sections cover the case when a single operation is mapped to a single operation with optional adjustment in names and attribute values. That is likely enough for your own custom operation with existing C++ kernel implementation. In this case your framework representation and OpenVINO representation for the operation are under your control and inputs/outpus/attributes can be aligned to make `OpExtension` usable. + +In case if one-to-one mapping is not possible, *decomposition to multiple operations* should be considered. It is achieved by using more verbose and less automated `ConversionExtension` class. It enables writing arbitrary code to replace a single framework operation by multiple connected OpenVINO operations constructing dependency graph of any complexity. + +`ConversionExtension` maps a single operation to a function which builds a graph using OpenVINO operation classes. Follow chapter “Build a Model in OpenVINO Runtime” in [](../OV_Runtime_UG/model_representation.md) to learn how to use OpenVINO operation classes to build a fragment of model for replacement. + +The next example illustrates using `ConversionExtension` for conversion of “ThresholdedRelu” from ONNX according to the formula: `ThresholdedRelu(x, alpha) -> Multiply(x, Convert(Greater(x, alpha), type=float))`. + +> **NOTE**: `ThresholdedRelu` is one of the standard ONNX operators which is supported by ONNX frontend natively out-of-the-box. Here we are re-implementing it to illustrate how you can add a similar support for your custom operation instead of `ThresholdedRelu`. + +@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU_header +@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU + +To access original framework operation attribute value and connect to inputs, `node` object of type `NodeContext` is used. It has two main methods: + +* `NodeContext::get_input` to get input with a given index, + +* `NodeContext::get_attribute` to get attribute value with a given name. + +The conversion function should return a vector of node outputs that are mapped to corresponding outputs of the original framework operation in the same order. + diff --git a/docs/snippets/ov_extensions.cpp b/docs/snippets/ov_extensions.cpp index 0abab9d3bfa772..9c3e9caf5fa4b2 100644 --- a/docs/snippets/ov_extensions.cpp +++ b/docs/snippets/ov_extensions.cpp @@ -2,20 +2,124 @@ // SPDX-License-Identifier: Apache-2.0 // #include -#include +//! [add_extension_header] +//#include +//! [add_extension_header] +//! [add_frontend_extension_header] +#include +//! [add_frontend_extension_header] + +//! [frontend_extension_Identity_header] +#include +//! [frontend_extension_Identity_header] + +//! [frontend_extension_ThresholdedReLU_header] +#include +//! [frontend_extension_ThresholdedReLU_header] + #include + int main() { { //! [add_extension] ov::Core core; -// Use operation type to add operation extension + +// Use operation type to add operation extension core.add_extension(); -// or you can add operation extension to this method + +// or you can add operation extension object which is equivalent form core.add_extension(ov::OpExtension()); //! [add_extension] } { +ov::Core core; + +//! [add_frontend_extension] +// Register mapping for new frontends: FW's "TemplateIdentity" operation to TemplateExtension::Identity +core.add_extension(ov::frontend::OpExtension("Identity")); + +// Register more sophisticated mapping with decomposition +core.add_extension(ov::frontend::ConversionExtension( + "Identity", + [](const ov::frontend::NodeContext& context) { + // Arbitrary decomposition code here + // Return a vector of operation outputs + return ov::OutputVector{ std::make_shared(context.get_input(0)) }; + })); +//! [add_frontend_extension] +} +{ +//! [frontend_extension_Identity] +auto extension1 = ov::frontend::OpExtension("Identity"); + +// or even simpler if original FW type and OV type of operations match, that is "Identity" +auto extension2 = ov::frontend::OpExtension(); +//! [frontend_extension_Identity] + +//! [frontend_extension_read_model] +ov::Core core; +// Add arbitrary number of extensions before calling read_model method +core.add_extension(ov::frontend::OpExtension()); +core.read_model("/path/to/model.onnx"); +//! [frontend_extension_read_model] + +//! [frontend_extension_MyRelu] +core.add_extension(ov::frontend::OpExtension<>("Relu", "MyRelu")); +//! [frontend_extension_MyRelu] + +//! [frontend_extension_CustomOperation] +class CustomOperation : public ov::op::Op { + + std::string attr1; + int attr2; + +public: + + OPENVINO_OP("CustomOperation"); + + bool visit_attributes(ov::AttributeVisitor& visitor) override { + visitor.on_attribute("attr1", attr1); + visitor.on_attribute("attr2", attr2); + return true; + } + + // ... implement other required methods + //! [frontend_extension_CustomOperation] + std::shared_ptr clone_with_new_inputs(const ov::OutputVector&) const override { return nullptr; } +}; + +//! [frontend_extension_CustomOperation_as_is] +core.add_extension(ov::frontend::OpExtension()); +//! [frontend_extension_CustomOperation_as_is] + +//! [frontend_extension_CustomOperation_rename] +core.add_extension(ov::frontend::OpExtension( + { {"attr1", "fw_attr1"}, {"attr2", "fw_attr2"} }, + {} +)); +//! [frontend_extension_CustomOperation_rename] + +//! [frontend_extension_CustomOperation_rename_set] +core.add_extension(ov::frontend::OpExtension( + { {"attr1", "fw_attr1"} }, + { {"attr2", 5} } +)); +//! [frontend_extension_CustomOperation_rename_set] + +//! [frontend_extension_ThresholdedReLU] +core.add_extension(ov::frontend::ConversionExtension( + "ThresholdedReLU", + [](const ov::frontend::NodeContext& node) { + auto greater = std::make_shared( + node.get_input(0), + ov::opset8::Constant::create(ov::element::f32, {}, {node.get_attribute("alpha")})); + auto casted = std::make_shared(greater, ov::element::f32); + return ov::OutputVector{ std::make_shared(node.get_input(0), casted) }; + })); +//! [frontend_extension_ThresholdedReLU] +} +{ //! [add_extension_lib] ov::Core core; // Load extensions library to ov::Core diff --git a/docs/snippets/ov_extensions.py b/docs/snippets/ov_extensions.py index 4f53700c746c41..8694f08442dc46 100644 --- a/docs/snippets/ov_extensions.py +++ b/docs/snippets/ov_extensions.py @@ -8,8 +8,13 @@ # Not implemented #! [add_extension] +#! [add_frontend_extension] +# Not implemented +#! [add_frontend_extension] + #! [add_extension_lib] core = ov.Core() -# Load extensions library to ov::Core +# Load extensions library to ov.Core core.add_extension("openvino_template_extension.so") #! [add_extension_lib] + diff --git a/docs/template_extension/new/CMakeLists.txt b/docs/template_extension/new/CMakeLists.txt index 20b81dc1adf4df..6cd1174cc844ac 100644 --- a/docs/template_extension/new/CMakeLists.txt +++ b/docs/template_extension/new/CMakeLists.txt @@ -15,12 +15,6 @@ add_library(${TARGET_NAME} MODULE ${SRC}) target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_OPENVINO_EXTENSION_API) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime) - -# To map custom operation to framework -if(OpenVINO_Frontend_ONNX_FOUND) - target_link_libraries(${TARGET_NAME} PRIVATE openvino::frontend::onnx) - target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_ONNX_FRONTEND_ENABLED) -endif() # [cmake:extension] # Enable code style check diff --git a/docs/template_extension/new/identity.hpp b/docs/template_extension/new/identity.hpp index b8c5160014dfdf..47a3efefcf91a4 100644 --- a/docs/template_extension/new/identity.hpp +++ b/docs/template_extension/new/identity.hpp @@ -7,11 +7,6 @@ //! [op:common_include] #include //! [op:common_include] -//! [op:frontend_include] -#ifdef OPENVINO_ONNX_FRONTEND_ENABLED -# include -#endif -//! [op:frontend_include] //! [op:header] namespace TemplateExtension { @@ -20,10 +15,6 @@ class Identity : public ov::op::Op { public: OPENVINO_OP("Identity"); -#ifdef OPENVINO_ONNX_FRONTEND_ENABLED - OPENVINO_FRAMEWORK_MAP(onnx) -#endif - Identity() = default; Identity(const ov::Output& arg); void validate_and_infer_types() override; diff --git a/docs/template_extension/new/ov_extension.cpp b/docs/template_extension/new/ov_extension.cpp index d2fa1e35361e23..770b57b02a7ed0 100644 --- a/docs/template_extension/new/ov_extension.cpp +++ b/docs/template_extension/new/ov_extension.cpp @@ -4,6 +4,7 @@ #include #include +#include #include "identity.hpp" @@ -11,7 +12,12 @@ //! [ov_extension:entry_point] OPENVINO_CREATE_EXTENSIONS( std::vector({ - std::make_shared>() + + // Register operation itself, required to be read from IR + std::make_shared>(), + + // Register operaton mapping, required when converted from framework model format + std::make_shared>() })); //! [ov_extension:entry_point] // clang-format on diff --git a/src/core/tests/extension.cpp b/src/core/tests/extension.cpp index e1974c42033324..187fa3e948153b 100644 --- a/src/core/tests/extension.cpp +++ b/src/core/tests/extension.cpp @@ -21,7 +21,7 @@ TEST(extension, load_extension) { TEST(extension, load_extension_and_cast) { std::vector so_extensions = ov::detail::load_extensions(get_extension_path()); - ASSERT_EQ(1, so_extensions.size()); + ASSERT_LE(1, so_extensions.size()); std::vector extensions; std::vector> so; for (const auto& ext : so_extensions) { @@ -31,7 +31,7 @@ TEST(extension, load_extension_and_cast) { } } so_extensions.clear(); - EXPECT_EQ(1, extensions.size()); + EXPECT_LE(1, extensions.size()); EXPECT_NE(nullptr, dynamic_cast(extensions[0].get())); EXPECT_NE(nullptr, std::dynamic_pointer_cast(extensions[0])); extensions.clear(); From 3caa77eb30502378ba8783ee397c5bb59b961036 Mon Sep 17 00:00:00 2001 From: Sergey Lyubimtsev Date: Mon, 21 Mar 2022 13:16:26 +0300 Subject: [PATCH 7/9] Update Benchmark guides (#11076) * - Update Benchmark Tool usage message - Remove not existed paths - Fix examples * remove reference on FPGA --- samples/cpp/benchmark_app/README.md | 148 ++++++++--------- tools/benchmark_tool/README.md | 238 +++++++++++----------------- 2 files changed, 169 insertions(+), 217 deletions(-) diff --git a/samples/cpp/benchmark_app/README.md b/samples/cpp/benchmark_app/README.md index 64be241a142c60..925f4784146acf 100644 --- a/samples/cpp/benchmark_app/README.md +++ b/samples/cpp/benchmark_app/README.md @@ -59,77 +59,46 @@ Also if latency of the CPU inference on the multi-socket machines is of concern, Running the application with the `-h` option yields the following usage message: ``` ./benchmark_app -h -InferenceEngine: - API version ............ - Build .................. -[ INFO ] Parsing input parameters benchmark_app [OPTION] Options: - -h, --help Print a usage message - -m "" Required. Path to an .xml/.onnx/.prototxt file with a trained model or to a .blob files with a trained compiled model. - -i "" Optional. Path to a folder with images and/or binaries or to specific image or binary file. - In case of dynamic shapes networks with several inputs provide the same number of files for each input (except cases with single file for any input): - "input1:1.jpg input2:1.bin", "input1:1.bin,2.bin input2:3.bin input3:4.bin,5.bin ". - Also you can pass specific keys for inputs: "random" - for fillling input with random data, "image_info" - for filling input with image size. - -d "" Optional. Specify a target device to infer on (the list of available devices is shown below). Default value is CPU. - Use "-d HETERO:" format to specify HETERO plugin. - Use "-d MULTI:" format to specify MULTI plugin. - Use "-d GPU.X" format to specify device id for GPU devices. - The application looks for a suitable plugin for the specified device. - -l "" Required for CPU custom layers. Absolute path to a shared library with the kernels implementations. + -h, --help Print a usage message + -m "" Required. Path to an .xml/.onnx file with a trained model or to a .blob files with a trained compiled model. + -i "" Optional. Path to a folder with images and/or binaries or to specific image or binary file. + In case of dynamic shapes networks with several inputs provide the same number of files for each input (except cases with single file for any input):"input1:1.jpg input2:1.bin", "input1:1.bin,2.bin input2:3.bin input3:4.bin,5.bin ". Also you can pass specific keys for inputs: "random" - for fillling input with random data, "image_info" - for filling input with image size. + You should specify either one files set to be used for all inputs (without providing input names) or separate files sets for every input of model (providing inputs names). + -d "" Optional. Specify a target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. Use "-d MULTI:" format to specify MULTI plugin. The application looks for a suitable plugin for the specified device. + -l "" Required for CPU custom layers. Absolute path to a shared library with the kernels implementations. Or - -c "" Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. + -c "" Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. -hint "performance hint (latency or throughput or none)" Optional. Performance hint allows the OpenVINO device to select the right network-specific settings. - 'throughput' or 'tput': device performance mode will be set to THROUGHPUT. - 'latency': device performance mode will be set to LATENCY. - 'none': no device performance mode will be set. - Using explicit 'nstreams' or other device-specific options, please set hint to 'none' - -api "" Optional (deprecated). Enable Sync/Async API. Default value is "async". - -niter "" Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device. - -nireq "" Optional. Number of infer requests. Default value is determined automatically for a device. - -b "" Optional. Batch size value. If not specified, the batch size value is determined from Intermediate Representation. - -stream_output Optional. Print progress as a plain text. When specified, an interactive progress bar is replaced with a multiline output. - -t Optional. Time, in seconds, to execute topology. - -progress Optional. Show progress bar (can affect performance measurement). Default values is "false". - -shape Optional. Set shape for network input. For example, "input1[1,3,224,224],input2[1,4]" or "[1,3,224,224]" in case of one input size. - This parameter affect model input shape and can be dynamic. For dynamic dimensions use symbol `?` or '-1'. Ex. [?,3,?,?]. - For bounded dimensions specify range 'min..max'. Ex. [1..10,3,?,?]. - -data_shape Required for networks with dynamic shapes. Set shape for input blobs. - In case of one input size: "[1,3,224,224]" or "input1[1,3,224,224],input2[1,4]". - In case of several input sizes provide the same number for - each input (except cases with single shape for any input): "[1,3,128,128][3,3,128,128][1,3,320,320]", - "input1[1,1,128,128][1,1,256,256],input2[80,1]" or "input1[1,192][1,384],input2[1,192][1,384],input3[1,192][1,384],input4[1,192][1,384]". - If network shapes are all static specifying the option will cause an exception. - -layout Optional. Prompts how network layouts should be treated by application. For example, "input1[NCHW],input2[NC]" or "[NCHW]" in case of one input size. - -cache_dir "" Optional. Enables caching of loaded models to specified directory. - -load_from_file Optional. Loads model from file directly without ReadNetwork. - -latency_percentile Optional. Defines the percentile to be reported in latency metric. The valid range is [1, 100]. The default value is 50 (median). - -inference_only Optional. Measure only inference stage. Default option for static models. - Dynamic models are measured in full mode which includes inputs setup stage, - inference only mode available for them with single input data shape only. - To enable full mode for static models pass \"false\" value to this argument: ex. -inference_only=false". - - CPU-specific performance options: - -nstreams "" Optional. Number of streams to use for inference on the CPU, GPU or MYRIAD devices - (for HETERO and MULTI device cases use format :,: or just ). - Default value is determined automatically for a device. - Please note that although the automatic selection usually provides a reasonable performance, - it still may be non-optimal for some cases, especially for very small networks. - Also, using nstreams>1 is inherently throughput-oriented option, while for the best-latency - estimations the number of streams should be set to 1. - -nthreads "" Optional. Number of threads to use for inference on the CPU (including HETERO and MULTI cases). - -pin ("YES"|"CORE")/"HYBRID_AWARE"/"NUMA"/("NO"|"NONE") - Optional. Explicit inference threads binding options (leave empty to let the OpenVINO to make a choice): - enabling threads->cores pinning ("YES", which is already default for a conventional CPU), - letting the runtime to decide on the threads->different core types ("HYBRID_AWARE", which is default on the hybrid CPUs) - threads->(NUMA)nodes ("NUMA") or completely disable ("NO") CPU inference threads pinning. - -infer_precision device_name:infer_precision1,device_name:infer_precision2 Optional. Hint to specifies inference precision - -ip "U8"/"FP16"/"FP32" Optional. Specifies precision for all input layers of the network. - -op "U8"/"FP16"/"FP32" Optional. Specifies precision for all output layers of the network. - -iop Optional. Specifies precision for input and output layers by name. Example: -iop "input:FP16, output:FP16". Notice that quotes are required. - Overwrites precision from ip and op options for specified layers. + 'throughput' or 'tput': device performance mode will be set to THROUGHPUT. + 'latency': device performance mode will be set to LATENCY. + 'none': no device performance mode will be set. + Using explicit 'nstreams' or other device-specific options, please set hint to 'none' + -api "" Optional (deprecated). Enable Sync/Async API. Default value is "async". + -niter "" Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device. + -nireq "" Optional. Number of infer requests. Default value is determined automatically for device. + -b "" Optional. Batch size value. If not specified, the batch size value is determined from Intermediate Representation. + -stream_output Optional. Print progress as a plain text. When specified, an interactive progress bar is replaced with a multiline output. + -t Optional. Time in seconds to execute topology. + -progress Optional. Show progress bar (can affect performance measurement). Default values is "false". + -shape Optional. Set shape for network input. For example, "input1[1,3,224,224],input2[1,4]" or "[1,3,224,224]" in case of one input size. This parameter affect model input shape and can be dynamic. For dynamic dimensions use symbol `?` or '-1'. Ex. [?,3,?,?]. For bounded dimensions specify range 'min..max'. Ex. [1..10,3,?,?]. + -data_shape Required for networks with dynamic shapes. Set shape for input blobs. In case of one input size: "[1,3,224,224]" or "input1[1,3,224,224],input2[1,4]". In case of several input sizes provide the same number for each input (except cases with single shape for any input): "[1,3,128,128][3,3,128,128][1,3,320,320]", "input1[1,1,128,128][1,1,256,256],input2[80,1]" or "input1[1,192][1,384],input2[1,192][1,384],input3[1,192][1,384],input4[1,192][1,384]". If network shapes are all static specifying the option will cause an exception. + -layout Optional. Prompts how network layouts should be treated by application. For example, "input1[NCHW],input2[NC]" or "[NCHW]" in case of one input size. + -cache_dir "" Optional. Enables caching of loaded models to specified directory. List of devices which support caching is shown at the end of this message. + -load_from_file Optional. Loads model from file directly without ReadNetwork. All CNNNetwork options (like re-shape) will be ignored + -latency_percentile Optional. Defines the percentile to be reported in latency metric. The valid range is [1, 100]. The default value is 50 (median). + + Device-specific performance options: + -nstreams "" Optional. Number of streams to use for inference on the CPU, GPU or MYRIAD devices (for HETERO and MULTI device cases use format :,: or just ). Default value is determined automatically for a device.Please note that although the automatic selection usually provides a reasonable performance, it still may be non - optimal for some cases, especially for very small networks. See sample's README for more details. Also, using nstreams>1 is inherently throughput-oriented option, while for the best-latency estimations the number of streams should be set to 1. + -nthreads "" Optional. Number of threads to use for inference on the CPU (including HETERO and MULTI cases). + -pin ("YES"|"CORE")/"HYBRID_AWARE"/("NO"|"NONE")/"NUMA" Optional. Explicit inference threads binding options (leave empty to let the OpenVINO to make a choice): + enabling threads->cores pinning("YES", which is already default for any conventional CPU), + letting the runtime to decide on the threads->different core types("HYBRID_AWARE", which is default on the hybrid CPUs) + threads->(NUMA)nodes("NUMA") or + completely disable("NO") CPU inference threads pinning Statistics dumping options: -report_type "" Optional. Enable collecting statistics report. "no_counters" report contains configuration options specified, resulting FPS and latency. @@ -141,6 +110,31 @@ Options: -pc Optional. Report performance counters. -dump_config Optional. Path to JSON file to dump IE parameters, which were set by application. -load_config Optional. Path to JSON file to load custom IE parameters. Please note, command line parameters have higher priority than parameters from configuration file. + + Statistics dumping options: + -report_type "" Optional. Enable collecting statistics report. "no_counters" report contains configuration options specified, resulting FPS and latency. "average_counters" report extends "no_counters" report and additionally includes average PM counters values for each layer from the network. "detailed_counters" report extends "average_counters" report and additionally includes per-layer PM counters and latency for each executed infer request. + -report_folder Optional. Path to a folder where statistics report is stored. + -json_stats Optional. Enables JSON-based statistics output (by default reporting system will use CSV format). Should be used together with -report_folder option. -exec_graph_path Optional. Path to a file where to store executable graph information serialized. + -pc Optional. Report performance counters. + -pcseq Optional. Report latencies for each shape in -data_shape sequence. + -dump_config Optional. Path to JSON file to dump IE parameters, which were set by application. + -load_config Optional. Path to JSON file to load custom IE parameters. Please note, command line parameters have higher priority then parameters from configuration file. + -infer_precision ""Optional. Inference precission + -ip Optional. Specifies precision for all input layers of the network. + -op Optional. Specifies precision for all output layers of the network. + -iop "" Optional. Specifies precision for input and output layers by name. + Example: -iop "input:FP16, output:FP16". + Notice that quotes are required. + Overwrites precision from ip and op options for specified layers. + -iscale Optional. Scale values to be used for the input image per channel. +Values to be provided in the [R, G, B] format. Can be defined for desired input of the model. +Example: -iscale data[255,255,255],info[255,255,255] + + -imean Optional. Mean values to be used for the input image per channel. +Values to be provided in the [R, G, B] format. Can be defined for desired input of the model, +Example: -imean data[255,255,255],info[255,255,255] + + -inference_only Optional. Measure only inference stage. Default option for static models. Dynamic models are measured in full mode which includes inputs setup stage, inference only mode available for them with single input data shape only. To enable full mode for static models pass "false" value to this argument: ex. "-inference_only=false". ``` Running the application with the empty list of options yields the usage message given above and an error message. @@ -158,30 +152,36 @@ To run the tool, you can use [public](@ref omz_models_group_public) or [Intel's] ## Examples of Running the Tool -This section provides step-by-step instructions on how to run the Benchmark Tool with the `googlenet-v1` public model on CPU or GPU devices. As an input, the `car.png` file from the `/samples/scripts/` directory is used. +This section provides step-by-step instructions on how to run the Benchmark Tool with the `googlenet-v1` public model on CPU or GPU devices. The [dog.bmp](https://storage.openvinotoolkit.org/data/test_data/images/224x224/dog.bmp) file is used as an input. > **NOTE**: The Internet access is required to execute the following steps successfully. If you have access to the Internet through the proxy server only, please make sure that it is configured in your OS environment. -1. Download the model. Go to the Model Downloader directory and run the `downloader.py` script with specifying the model name and directory to download the model to: - ```sh - cd /extras/open_model_zoo/tools/downloader +1. Install OpenVINO Development Tools to work with Caffe* models: + + ``` sh + pip install openvino-dev[caffe] ``` + +2. Download the model. Go to the Model Downloader directory and run the `omz_downloader` script with specifying the model name and directory to download the model to: + ```sh - python3 downloader.py --name googlenet-v1 -o + omz_downloader --name googlenet-v1 -o ``` -2. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format (which must be FP32 for CPU and FPG) and output directory to generate the IR files: +3. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format and output directory to generate the IR files: + ```sh mo --input_model /public/googlenet-v1/googlenet-v1.caffemodel --data_type FP32 --output_dir ``` -3. Run the tool with specifying the `/samples/scripts/car.png` file as an input image, the IR of the `googlenet-v1` model and a device to perform inference on. The following commands demonstrate running the Benchmark Tool in the asynchronous mode on CPU and GPU devices: + +4. Run the tool with specifying the `dog.bmp` file as an input image, the IR of the `googlenet-v1` model and a device to perform inference on. The following commands demonstrate running the Benchmark Tool in the asynchronous mode on CPU and GPU devices: * On CPU: ```sh - ./benchmark_app -m /googlenet-v1.xml -i /samples/scripts/car.png -d CPU -api async --progress true + ./benchmark_app -m /googlenet-v1.xml -i dog.bmp -d CPU -api async -progress ``` * On GPU: ```sh - ./benchmark_app -m /googlenet-v1.xml -i /samples/scripts/car.png -d GPU -api async --progress true + ./benchmark_app -m /googlenet-v1.xml -i dog.bmp -d GPU -api async -progress ``` The application outputs the number of executed iterations, total duration of execution, latency, and throughput. diff --git a/tools/benchmark_tool/README.md b/tools/benchmark_tool/README.md index fd2d542fb6cd88..df868b5b952431 100644 --- a/tools/benchmark_tool/README.md +++ b/tools/benchmark_tool/README.md @@ -44,20 +44,17 @@ A number of executions is defined by one of the two values: * Explicitly, with the `-niter` command-line argument * As _time_ duration specified with the `-t` command-line argument * Both of them (execution will continue until both conditions are met) -* Predefined duration if neither `-niter`nor `-t` are not specified. Predefined duration value depends on the device. +* Predefined duration if neither `-niter` nor `-t` are not specified. Predefined duration value depends on the device. ## Run the Tool -Before running the Benchmark tool, install the requirements: -```sh -pip install -r requirements.txt -``` +Before running the Benchmark tool, install [OpenVINO™ Development Tools](../../docs/install_guides/installing-model-dev-tools.md). Notice that the benchmark_app usually produces optimal performance for any device out of the box. - **So in most cases you don't need to play the app options explicitly and the plain device name is enough**, for example, for CPU: + ```sh -python3 benchmark_app.py -m -i -d CPU +benchmark_app -m -i -d CPU ``` But it is still may be sub-optimal for some cases, especially for very small networks. More details can read in [Performance Optimization Guide](../../docs/optimization_guide/dldt_optimization_guide.md). @@ -65,153 +62,104 @@ But it is still may be sub-optimal for some cases, especially for very small net Running the application with the `-h` or `--help`' option yields the following usage message: ``` -usage: benchmark_app.py [-h] [-i PATH_TO_INPUT] -m PATH_TO_MODEL - [-d TARGET_DEVICE] - [-l PATH_TO_EXTENSION] [-c PATH_TO_CLDNN_CONFIG] - [-hint {throughput, latency}] - [-api {sync,async}] [-niter NUMBER_ITERATIONS] - [-b BATCH_SIZE] - [-stream_output [STREAM_OUTPUT]] [-t TIME] - [-progress [PROGRESS]] [-nstreams NUMBER_STREAMS] - [-nthreads NUMBER_THREADS] [-pin {YES,NO,NUMA,HYBRID_AWARE}] - [--exec_graph_path EXEC_GRAPH_PATH] - [-pc [PERF_COUNTS]] +usage: benchmark_app [-h [HELP]] [-i PATHS_TO_INPUT [PATHS_TO_INPUT ...]] -m PATH_TO_MODEL + [-d TARGET_DEVICE] + [-l PATH_TO_EXTENSION] [-c PATH_TO_CLDNN_CONFIG] + [-api {sync,async}] + [-niter NUMBER_ITERATIONS] + [-nireq NUMBER_INFER_REQUESTS] + [-b BATCH_SIZE] + [-stream_output [STREAM_OUTPUT]] + [-t TIME] + [-progress [PROGRESS]] + [-shape SHAPE] + [-layout LAYOUT] + [-nstreams NUMBER_STREAMS] + [-enforcebf16 [{True,False}]] + [-nthreads NUMBER_THREADS] + [-pin {YES,NO,NUMA,HYBRID_AWARE}] + [-exec_graph_path EXEC_GRAPH_PATH] + [-pc [PERF_COUNTS]] + [-report_type {no_counters,average_counters,detailed_counters}] + [-report_folder REPORT_FOLDER] + [-dump_config DUMP_CONFIG] + [-load_config LOAD_CONFIG] + [-qb {8,16}] + [-ip {U8,FP16,FP32}] + [-op {U8,FP16,FP32}] + [-iop INPUT_OUTPUT_PRECISION] + [-cdir CACHE_DIR] + [-lfile [LOAD_FROM_FILE]] Options: - -h, --help Show this help message and exit. - -i PATH_TO_INPUT, --path_to_input PATH_TO_INPUT - Optional. Path to a folder with images and/or binaries - or to specific image or binary file. To map input files - to the specific input use next syntax: - "input1:image_path1/folder_path1,input2:image_path2/folder_path2" + -h [HELP], --help [HELP] + Show this help message and exit. + -i PATHS_TO_INPUT [PATHS_TO_INPUT ...], --paths_to_input PATHS_TO_INPUT [PATHS_TO_INPUT ...] + Optional. Path to a folder with images and/or binaries or to specific image or binary file. -m PATH_TO_MODEL, --path_to_model PATH_TO_MODEL - Required. Path to an .xml/.onnx/.prototxt file with a - trained model or to a .blob file with a trained - compiled model. + Required. Path to an .xml/.onnx/.prototxt file with a trained model or to a .blob file with a trained compiled model. -d TARGET_DEVICE, --target_device TARGET_DEVICE - Optional. Specify a target device to infer on: CPU, - GPU, HDDL or MYRIAD. - Use "-d HETERO:" format to specify HETERO plugin. - Use "-d MULTI:" format to specify MULTI plugin. - The application looks for a suitable plugin for the specified device. + Optional. Specify a target device to infer on (the list of available devices is shown below). Default value is CPU. Use '-d HETERO:' format to specify + HETERO plugin. Use '-d MULTI:' format to specify MULTI plugin. The application looks for a suitable plugin for the specified device. -l PATH_TO_EXTENSION, --path_to_extension PATH_TO_EXTENSION - Optional. Required for CPU custom layers. Absolute - path to a shared library with the kernels - implementations. + Optional. Required for CPU custom layers. Absolute path to a shared library with the kernels implementations. -c PATH_TO_CLDNN_CONFIG, --path_to_cldnn_config PATH_TO_CLDNN_CONFIG - Optional. Required for GPU custom kernels. Absolute - path to an .xml file with the kernels description. - -hint {throughput, latency, none}, --perf_hint {throughput, latency, none} - Optional. Performance hint (latency or throughput or - none). Performance hint allows the OpenVINO device to - select the right network-specific settings. - 'throughput': device performance mode will be set to - THROUGHPUT, default value for -api sync. - 'latency': device performance mode will be - set to LATENCY, default value for -api async. - 'none': no device performance mode - will be set. Using explicit 'nstreams' or other - device-specific options, please set hint to 'none' + Optional. Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. -api {sync,async}, --api_type {sync,async} - Optional. Enable using sync/async API. Default value - is async. + Optional. Enable using sync/async API. Default value is async. -niter NUMBER_ITERATIONS, --number_iterations NUMBER_ITERATIONS - Optional. Number of iterations. If not specified, the - number of iterations is calculated depending on a - device. + Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device. + -nireq NUMBER_INFER_REQUESTS, --number_infer_requests NUMBER_INFER_REQUESTS + Optional. Number of infer requests. Default value is determined automatically for device. -b BATCH_SIZE, --batch_size BATCH_SIZE - Optional. Batch size value. If not specified, the - batch size value is determined from IR + Optional. Batch size value. If not specified, the batch size value is determined from Intermediate Representation -stream_output [STREAM_OUTPUT] - Optional. Print progress as a plain text. When - specified, an interactive progress bar is replaced - with a multiline output. + Optional. Print progress as a plain text. When specified, an interactive progress bar is replaced with a multi-line output. -t TIME, --time TIME Optional. Time in seconds to execute topology. - -progress [PROGRESS] Optional. Show progress bar (can affect performance - measurement). Default values is "False". - -shape SHAPE Optional. Set shape for input. For example, - "input1[1,3,224,224],input2[1,4]" or "[1,3,224,224]" - in case of one input size. - -data_shape DATA_SHAPE - Optional. Define shape of data to infer dynamic - model. To process images with original shapes - this parameter can be ommited, but it's required - in other cases to benchmark dynamic model. - For example "[shape1],[shape2], ..." can be - used to set several data shapes in case one input - or to set shape1 to input1, shape2 to input2 - and so on in case several inputs. Input mapping - is also supported: "input1[shape1,shape2],input2[shape3,shape4]". - -layout LAYOUT Optional. Prompts how network layouts should be - treated by application. For example, - "input1[NCHW],input2[NC]" or "[NCHW]" in case of one - input size. Also can be defined partially - - "input1[N...],input2[N...C]" + -progress [PROGRESS] Optional. Show progress bar (can affect performance measurement). Default values is 'False'. + -shape SHAPE Optional. Set shape for input. For example, "input1[1,3,224,224],input2[1,4]" or "[1,3,224,224]" in case of one input size. + -layout LAYOUT Optional. Prompts how network layouts should be treated by application. For example, "input1[NCHW],input2[NC]" or "[NCHW]" in case of one input size. -nstreams NUMBER_STREAMS, --number_streams NUMBER_STREAMS - Optional. Number of streams to use for inference on the CPU/GPU/MYX in throughput mode - (for HETERO and MULTI device cases use format :,: or just ). - Default value is determined automatically for a device. - Please note that although the automatic selection usually provides a reasonable performance, - it still may be non-optimal for some cases, especially for very small networks. + Optional. Number of streams to use for inference on the CPU/GPU/MYRIAD (for HETERO and MULTI device cases use format :,: or just ). + Default value is determined automatically for a device. Please note that although the automatic selection usually provides a reasonable performance, it still may be non - optimal for + some cases, especially for very small networks. Also, using nstreams>1 is inherently throughput-oriented option, while for the best-latency estimations the number of streams should be + set to 1. See samples README for more details. + -enforcebf16 [{True,False}], --enforce_bfloat16 [{True,False}] + Optional. By default floating point operations execution in bfloat16 precision are enforced if supported by platform. 'true' - enable bfloat16 regardless of platform support. 'false' - + disable bfloat16 regardless of platform support. -nthreads NUMBER_THREADS, --number_threads NUMBER_THREADS - Number of threads to use for inference on the CPU - (including HETERO and MULTI cases). - --latency_percentile LATENCY_PERCENTILE - Optional. Defines the percentile to be reported in latency metric. - The valid range is [1, 100]. The default value is 50 (median). - -enforcebf16 ENFORCEBF16, --enforce_bfloat16 ENFORCEBF16 - Optional. By default floating point operations execution in bfloat16 precision are enforced if supported by platform. - True - enable bfloat16 regardless of platform support. - False - disable bfloat16 regardless of platform support. + Number of threads to use for inference on the CPU, GNA (including HETERO and MULTI cases). -pin {YES,NO,NUMA,HYBRID_AWARE}, --infer_threads_pinning {YES,NO,NUMA,HYBRID_AWARE} - Optional. Enable threads->cores ('YES' which is OpenVINO runtime's default for conventional CPUs), - threads->(NUMA)nodes ('NUMA'), - threads->appropriate core types ('HYBRID_AWARE', which is OpenVINO runtime's default for Hybrid CPUs) - or completely disable ('NO') - CPU threads pinning for CPU-involved inference. - --exec_graph_path EXEC_GRAPH_PATH - Optional. Path to a file where to store executable - graph information serialized. + Optional. Enable threads->cores ('YES' which is OpenVINO runtime's default for conventional CPUs), threads->(NUMA)nodes ('NUMA'), threads->appropriate core types ('HYBRID_AWARE', which + is OpenVINO runtime's default for Hybrid CPUs)or completely disable ('NO')CPU threads pinning for CPU-involved inference. + -exec_graph_path EXEC_GRAPH_PATH, --exec_graph_path EXEC_GRAPH_PATH + Optional. Path to a file where to store executable graph information serialized. -pc [PERF_COUNTS], --perf_counts [PERF_COUNTS] Optional. Report performance counters. - -pcseq PCSEQ --pcseq PCSEQ - Optional. Report latencies for each shape in -data_shape sequence. - -inference_only INFERENCE_ONLY, --inference_only INFERENCE_ONLY - Optional. If true inputs filling only once before measurements. - True - fill inputs once before the measurements loop, default value for static models - False - fill inputs each time before inference, default value for dynamic models - -report_type REPORT_TYPE, --report_type REPORT_TYPE - Optional. Enable collecting statistics report. - "--report_type no_counters" report contains configuration options specified, resulting FPS and latency. - "--report_type average_counters" - "report extends \"no_counters\" report and additionally includes average PM " - "counters values for each layer from the network. \"detailed_counters\" report " - "extends \"average_counters\" report and additionally includes per-layer PM " - "counters and latency for each executed infer request. + -report_type {no_counters,average_counters,detailed_counters}, --report_type {no_counters,average_counters,detailed_counters} + Optional. Enable collecting statistics report. "no_counters" report contains configuration options specified, resulting FPS and latency. "average_counters" report extends "no_counters" + report and additionally includes average PM counters values for each layer from the network. "detailed_counters" report extends "average_counters" report and additionally includes per- + layer PM counters and latency for each executed infer request. + -report_folder REPORT_FOLDER, --report_folder REPORT_FOLDER + Optional. Path to a folder where statistics report is stored. -dump_config DUMP_CONFIG - Optional. Path to JSON file to dump OpenVINO parameters, which were set by application. + Optional. Path to JSON file to dump IE parameters, which were set by application. -load_config LOAD_CONFIG - Optional. Path to JSON file to load custom OpenVINO parameters. - Please note, command line parameters have higher priority then parameters from configuration file. - -cdir CACHE_DIR -cache_dir - Optional. Enable model caching to specified directory. - -lfile LOAD_FROM_FILE --load_from_file LOAD_FROM_FILE + Optional. Path to JSON file to load custom IE parameters. Please note, command line parameters have higher priority then parameters from configuration file. + -qb {8,16}, --quantization_bits {8,16} + Optional. Weight bits for quantization: 8 (I8) or 16 (I16) + -ip {U8,FP16,FP32}, --input_precision {U8,FP16,FP32} + Optional. Specifies precision for all input layers of the network. + -op {U8,FP16,FP32}, --output_precision {U8,FP16,FP32} + Optional. Specifies precision for all output layers of the network. + -iop INPUT_OUTPUT_PRECISION, --input_output_precision INPUT_OUTPUT_PRECISION + Optional. Specifies precision for input and output layers by name. Example: -iop "input:FP16, output:FP16". Notice that quotes are required. Overwrites precision from ip and op options + for specified layers. + -cdir CACHE_DIR, --cache_dir CACHE_DIR + Optional. Enable model caching to specified directory + -lfile [LOAD_FROM_FILE], --load_from_file [LOAD_FROM_FILE] Optional. Loads model from file directly without read_network. - -qb QUANTIZATION_BITS --quantization_bits QUANTIZATION_BITS - Optional. Weight bits for quantization: 8 (I8) or 16 (I16) - -iscale INPUT_SCALE --input_scale INPUT_SCALE - Optional. Scale values to be used for the input image per channel. - Values to be provided in the [R, G, B] format. Can be defined for desired input of the model. - Example: -iscale data[255,255,255],info[255,255,255] - -imean INPUT_MEAN --input_mean INPUT_MEAN - Optional. Mean values to be used for the input image per channel. - Values to be provided in the [R, G, B] format. Can be defined for desired input of the model. - Example: -imean data[255,255,255],info[255,255,255] - -ip "u8"/"f16"/"f32" Optional. Specifies precision for all input layers of the network. - -op "u8"/"f16"/"f32" Optional. Specifies precision for all output layers of the network. - -iop Optional. Specifies precision for input and output layers by name. Example: -iop "input:FP16, output:FP16". Notice that quotes are required. Overwrites precision from ip and op options for specified layers. ``` - Running the application with the empty list of options yields the usage message given above and an error message. Application supports topologies with one or more inputs. If a topology is not data sensitive, you can skip the input parameter. In this case, inputs are filled with random values. @@ -225,30 +173,34 @@ To run the tool, you can use [public](@ref omz_models_group_public) or [Intel's] ## Examples of Running the Tool -This section provides step-by-step instructions on how to run the Benchmark Tool with the `googlenet-v1` public model on CPU or GPU devices. As an input, the `car.png` file from the `/samples/scripts/` directory is used. +This section provides step-by-step instructions on how to run the Benchmark Tool with the `googlenet-v1` public model on CPU or GPU devices. The [dog.bmp](https://storage.openvinotoolkit.org/data/test_data/images/224x224/dog.bmp) file is used as an input. > **NOTE**: The Internet access is required to execute the following steps successfully. If you have access to the Internet through the proxy server only, please make sure that it is configured in your OS environment. -1. Download the model. Go to the Model Downloader directory and run the `downloader.py` script with the model name and directory to download the model to: - ```sh - cd /extras/open_model_zoo/tools/downloader +1. Install OpenVINO Development Tools to work with Caffe* models: + + ``` sh + pip install openvino-dev[caffe] ``` + +2. Download the model. Go to the Model Downloader directory and run the `omz_downloader` tool with the model name and directory to download the model to: + ```sh - python3 downloader.py --name googlenet-v1 -o + omz_downloader --name googlenet-v1 -o ``` -2. Convert the model to the OpenVINO IR format. Run Model Optimizer with the path to the model, model format (which must be FP32 for CPU and FPG) and output directory to generate the IR files: +3. Convert the model to the OpenVINO IR format. Run Model Optimizer with the path to the model, model format and output directory to generate the IR files: ```sh mo --input_model /public/googlenet-v1/googlenet-v1.caffemodel --data_type FP32 --output_dir ``` -3. Run the tool with specifying the `/samples/scripts/car.png` file as an input image, the IR of the `googlenet-v1` model and a device to perform inference on. The following commands demonstrate running the Benchmark Tool in the asynchronous mode on CPU and GPU devices: +4. Run the tool with specifying the `dog.bmp` file as an input image, the IR of the `googlenet-v1` model and a device to perform inference on. The following commands demonstrate running the Benchmark Tool in the asynchronous mode on CPU and GPU devices: * On CPU: ```sh - python3 benchmark_app.py -m /googlenet-v1.xml -d CPU -api async -i /samples/scripts/car.png --progress true -b 1 + benchmark_app -m /googlenet-v1.xml -d CPU -api async -i dog.bmp -progress -b 1 ``` * On GPU: ```sh - python3 benchmark_app.py -m /googlenet-v1.xml -d GPU -api async -i /samples/scripts/car.png --progress true -b 1 + benchmark_app -m /googlenet-v1.xml -d GPU -api async -i dog.bmp -progress -b 1 ``` The application outputs number of executed iterations, total duration of execution, latency and throughput. From 2bf0c8a8da74b038ea1888f7ad600ccdc1bca05c Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Mon, 21 Mar 2022 13:19:21 +0300 Subject: [PATCH 8/9] Added groups for core headers (#11068) --- src/core/include/openvino/core/dimension.hpp | 1 + src/core/include/openvino/core/extension.hpp | 1 + src/core/include/openvino/core/graph_util.hpp | 7 +- src/core/include/openvino/core/layout.hpp | 21 +++++ src/core/include/openvino/core/node.hpp | 9 +- src/core/include/openvino/core/node_input.hpp | 2 + .../include/openvino/core/node_output.hpp | 3 + .../include/openvino/core/partial_shape.hpp | 1 + .../core/preprocess/pre_post_process.hpp | 1 + src/core/include/openvino/core/shape.hpp | 17 +++- src/core/include/openvino/core/type.hpp | 17 ++-- .../openvino/core/type/element_type.hpp | 83 +++++++++++++++---- src/core/include/openvino/op/abs.hpp | 1 + src/core/include/openvino/op/acos.hpp | 1 + src/core/include/openvino/op/acosh.hpp | 1 + .../include/openvino/op/adaptive_avg_pool.hpp | 1 + .../include/openvino/op/adaptive_max_pool.hpp | 1 + src/core/include/openvino/op/add.hpp | 1 + src/core/include/openvino/op/asin.hpp | 1 + src/core/include/openvino/op/assign.hpp | 2 + src/core/include/openvino/op/atan.hpp | 1 + src/core/include/openvino/op/atanh.hpp | 1 + src/core/include/openvino/op/batch_norm.hpp | 6 ++ .../include/openvino/op/batch_to_space.hpp | 1 + .../openvino/op/binary_convolution.hpp | 3 + src/core/include/openvino/op/broadcast.hpp | 2 + src/core/include/openvino/op/bucketize.hpp | 1 + src/core/include/openvino/op/ceiling.hpp | 1 + src/core/include/openvino/op/clamp.hpp | 1 + src/core/include/openvino/op/concat.hpp | 1 + src/core/include/openvino/op/constant.hpp | 1 + src/core/include/openvino/op/convert.hpp | 1 + src/core/include/openvino/op/convert_like.hpp | 1 + src/core/include/openvino/op/convolution.hpp | 2 + src/core/include/openvino/op/cos.hpp | 1 + src/core/include/openvino/op/cosh.hpp | 1 + .../openvino/op/ctc_greedy_decoder.hpp | 3 + .../op/ctc_greedy_decoder_seq_len.hpp | 1 + src/core/include/openvino/op/ctc_loss.hpp | 3 + src/core/include/openvino/op/cum_sum.hpp | 1 + .../openvino/op/deformable_convolution.hpp | 4 + .../openvino/op/deformable_psroi_pooling.hpp | 3 + .../include/openvino/op/depth_to_space.hpp | 1 + src/core/include/openvino/op/dft.hpp | 1 + src/core/include/openvino/op/divide.hpp | 1 + src/core/include/openvino/op/einsum.hpp | 1 + src/core/include/openvino/op/elu.hpp | 1 + .../openvino/op/embedding_segments_sum.hpp | 1 + .../openvino/op/embeddingbag_offsets_sum.hpp | 1 + .../openvino/op/embeddingbag_packedsum.hpp | 1 + src/core/include/openvino/op/equal.hpp | 1 + src/core/include/openvino/op/erf.hpp | 1 + src/core/include/openvino/op/exp.hpp | 1 + ...xperimental_detectron_detection_output.hpp | 1 + ...erimental_detectron_generate_proposals.hpp | 1 + ...imental_detectron_prior_grid_generator.hpp | 1 + .../op/experimental_detectron_roi_feature.hpp | 1 + .../op/experimental_detectron_topkrois.hpp | 1 + .../openvino/op/extractimagepatches.hpp | 3 + .../include/openvino/op/fake_quantize.hpp | 1 + src/core/include/openvino/op/floor.hpp | 1 + src/core/include/openvino/op/floor_mod.hpp | 1 + src/core/include/openvino/op/gather.hpp | 3 + .../include/openvino/op/gather_elements.hpp | 1 + src/core/include/openvino/op/gather_nd.hpp | 2 + src/core/include/openvino/op/gather_tree.hpp | 1 + src/core/include/openvino/op/gelu.hpp | 2 + src/core/include/openvino/op/greater.hpp | 1 + src/core/include/openvino/op/greater_eq.hpp | 1 + src/core/include/openvino/op/gru_cell.hpp | 1 + src/core/include/openvino/op/gru_sequence.hpp | 3 + src/core/include/openvino/op/hard_sigmoid.hpp | 1 + src/core/include/openvino/op/hsigmoid.hpp | 1 + src/core/include/openvino/op/hswish.hpp | 1 + src/core/include/openvino/op/i420_to_bgr.hpp | 1 + src/core/include/openvino/op/i420_to_rgb.hpp | 1 + src/core/include/openvino/op/idft.hpp | 1 + src/core/include/openvino/op/if.hpp | 1 + src/core/include/openvino/op/interpolate.hpp | 4 + src/core/include/openvino/op/less.hpp | 1 + src/core/include/openvino/op/less_eq.hpp | 1 + src/core/include/openvino/op/log.hpp | 1 + src/core/include/openvino/op/log_softmax.hpp | 3 + src/core/include/openvino/op/logical_and.hpp | 1 + src/core/include/openvino/op/logical_not.hpp | 1 + src/core/include/openvino/op/logical_or.hpp | 1 + src/core/include/openvino/op/logical_xor.hpp | 1 + src/core/include/openvino/op/loop.hpp | 1 + src/core/include/openvino/op/lrn.hpp | 1 + src/core/include/openvino/op/lstm_cell.hpp | 2 + .../include/openvino/op/lstm_sequence.hpp | 2 + src/core/include/openvino/op/matmul.hpp | 1 + src/core/include/openvino/op/matrix_nms.hpp | 1 + src/core/include/openvino/op/max_pool.hpp | 2 + src/core/include/openvino/op/maximum.hpp | 1 + src/core/include/openvino/op/minimum.hpp | 1 + src/core/include/openvino/op/mish.hpp | 1 + src/core/include/openvino/op/mod.hpp | 1 + .../include/openvino/op/multiclass_nms.hpp | 1 + src/core/include/openvino/op/multiply.hpp | 1 + src/core/include/openvino/op/mvn.hpp | 2 + src/core/include/openvino/op/negative.hpp | 1 + .../openvino/op/non_max_suppression.hpp | 4 + src/core/include/openvino/op/non_zero.hpp | 1 + src/core/include/openvino/op/normalize_l2.hpp | 1 + src/core/include/openvino/op/not_equal.hpp | 1 + src/core/include/openvino/op/nv12_to_bgr.hpp | 1 + src/core/include/openvino/op/nv12_to_rgb.hpp | 1 + src/core/include/openvino/op/one_hot.hpp | 3 + src/core/include/openvino/op/op.hpp | 3 +- src/core/include/openvino/op/pad.hpp | 1 + src/core/include/openvino/op/parameter.hpp | 1 + src/core/include/openvino/op/power.hpp | 1 + src/core/include/openvino/op/prelu.hpp | 1 + src/core/include/openvino/op/prior_box.hpp | 2 + .../openvino/op/prior_box_clustered.hpp | 1 + src/core/include/openvino/op/proposal.hpp | 6 ++ .../include/openvino/op/psroi_pooling.hpp | 3 + .../include/openvino/op/random_uniform.hpp | 1 + src/core/include/openvino/op/range.hpp | 2 + src/core/include/openvino/op/read_value.hpp | 2 + src/core/include/openvino/op/reduce_l1.hpp | 1 + src/core/include/openvino/op/reduce_l2.hpp | 1 + .../openvino/op/reduce_logical_and.hpp | 1 + .../include/openvino/op/reduce_logical_or.hpp | 1 + src/core/include/openvino/op/reduce_max.hpp | 3 + src/core/include/openvino/op/reduce_mean.hpp | 3 + src/core/include/openvino/op/reduce_min.hpp | 3 + src/core/include/openvino/op/reduce_prod.hpp | 1 + src/core/include/openvino/op/reduce_sum.hpp | 1 + src/core/include/openvino/op/region_yolo.hpp | 3 + src/core/include/openvino/op/relu.hpp | 1 + src/core/include/openvino/op/reorg_yolo.hpp | 3 + src/core/include/openvino/op/reshape.hpp | 1 + src/core/include/openvino/op/result.hpp | 3 + src/core/include/openvino/op/reverse.hpp | 3 + .../include/openvino/op/reverse_sequence.hpp | 3 + src/core/include/openvino/op/rnn_cell.hpp | 1 + src/core/include/openvino/op/rnn_sequence.hpp | 3 + src/core/include/openvino/op/roi_align.hpp | 3 + src/core/include/openvino/op/roi_pooling.hpp | 3 + src/core/include/openvino/op/roll.hpp | 1 + src/core/include/openvino/op/round.hpp | 1 + .../openvino/op/scatter_elements_update.hpp | 3 + .../include/openvino/op/scatter_nd_update.hpp | 1 + .../include/openvino/op/scatter_update.hpp | 1 + src/core/include/openvino/op/select.hpp | 1 + src/core/include/openvino/op/selu.hpp | 1 + src/core/include/openvino/op/shape_of.hpp | 2 + .../include/openvino/op/shuffle_channels.hpp | 1 + src/core/include/openvino/op/sigmoid.hpp | 3 + src/core/include/openvino/op/sign.hpp | 1 + src/core/include/openvino/op/sin.hpp | 1 + src/core/include/openvino/op/sinh.hpp | 1 + src/core/include/openvino/op/sink.hpp | 3 +- src/core/include/openvino/op/slice.hpp | 1 + src/core/include/openvino/op/softmax.hpp | 4 + src/core/include/openvino/op/softplus.hpp | 1 + .../include/openvino/op/space_to_batch.hpp | 1 + .../include/openvino/op/space_to_depth.hpp | 1 + src/core/include/openvino/op/split.hpp | 1 + src/core/include/openvino/op/sqrt.hpp | 1 + .../openvino/op/squared_difference.hpp | 1 + src/core/include/openvino/op/squeeze.hpp | 3 + .../include/openvino/op/strided_slice.hpp | 1 + src/core/include/openvino/op/subtract.hpp | 1 + src/core/include/openvino/op/swish.hpp | 1 + src/core/include/openvino/op/tan.hpp | 1 + src/core/include/openvino/op/tanh.hpp | 1 + .../include/openvino/op/tensor_iterator.hpp | 1 + src/core/include/openvino/op/tile.hpp | 1 + src/core/include/openvino/op/topk.hpp | 2 + src/core/include/openvino/op/transpose.hpp | 1 + src/core/include/openvino/op/unsqueeze.hpp | 3 + .../include/openvino/op/variadic_split.hpp | 1 + src/core/include/openvino/op/xor.hpp | 1 + src/core/include/openvino/opsets/opset.hpp | 37 ++++++++- 177 files changed, 416 insertions(+), 38 deletions(-) diff --git a/src/core/include/openvino/core/dimension.hpp b/src/core/include/openvino/core/dimension.hpp index c4963075e47407..cde49b731269fe 100644 --- a/src/core/include/openvino/core/dimension.hpp +++ b/src/core/include/openvino/core/dimension.hpp @@ -20,6 +20,7 @@ class TableOfEquivalence; /// /// Static dimensions may be implicitly converted from value_type. A dynamic dimension is /// constructed with Dimension() or Dimension::dynamic(). +/// \ingroup ov_model_cpp_api class OPENVINO_API Dimension { public: using value_type = int64_t; diff --git a/src/core/include/openvino/core/extension.hpp b/src/core/include/openvino/core/extension.hpp index 63e8db17051a32..c40ea0b7c0bfc2 100644 --- a/src/core/include/openvino/core/extension.hpp +++ b/src/core/include/openvino/core/extension.hpp @@ -26,6 +26,7 @@ class Extension; /** * @brief The class provides the base interface for OpenVINO extensions + * @ingroup ov_model_cpp_api */ class OPENVINO_API Extension { public: diff --git a/src/core/include/openvino/core/graph_util.hpp b/src/core/include/openvino/core/graph_util.hpp index edb88b265c61c1..73c1986a7a1015 100644 --- a/src/core/include/openvino/core/graph_util.hpp +++ b/src/core/include/openvino/core/graph_util.hpp @@ -263,12 +263,13 @@ std::vector> topological_sort(T root_nodes) { // NodeMap input may contain default node mapping i.e. pre-cloned nodes // NodeMap output (by reference) fully maps input and cloned Model ops OPENVINO_API -std::shared_ptr clone_model(const ov::Model& func, +std::shared_ptr clone_model(const ov::Model& model, std::unordered_map>& node_map); -// input model is cloned and returned +/// \brief input model is cloned and returned +/// \ingroup ov_model_cpp_api OPENVINO_API -std::shared_ptr clone_model(const ov::Model& func); +std::shared_ptr clone_model(const ov::Model& model); OPENVINO_API bool compare_constants(const std::shared_ptr& n1, const std::shared_ptr& n2); diff --git a/src/core/include/openvino/core/layout.hpp b/src/core/include/openvino/core/layout.hpp index 12135cefb1a347..ab0fc2296dfc05 100644 --- a/src/core/include/openvino/core/layout.hpp +++ b/src/core/include/openvino/core/layout.hpp @@ -16,6 +16,13 @@ namespace ov { +/** + * @defgroup ov_layout_cpp_api Layout + * @ingroup ov_model_cpp_api + * OpenVINO Layout API to work and configure layouts for ov::Model inputs or outputs + * + */ + /// \brief ov::Layout represents the text information of tensor's dimensions/axes. E.g. layout `NCHW` means that 4D /// tensor `{-1, 3, 480, 640}` will have: /// - 0: `N = -1`: batch dimension is dynamic @@ -33,6 +40,7 @@ namespace ov { /// in layout for appropriate inputs /// /// Refer also to `ov::layout` namespace for various additional helper functions of `ov::Layout` +/// \ingroup ov_layout_cpp_api class OPENVINO_API Layout { public: /// \brief Constructs a dynamic Layout with no layout information. @@ -101,66 +109,79 @@ class OPENVINO_API Layout { namespace layout { /// \brief Checks if layout has 'batch' dimension +/// \ingroup ov_layout_cpp_api OPENVINO_API bool has_batch(const Layout& layout); /// \brief Returns 'batch' dimension index. /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API std::int64_t batch_idx(const Layout& layout); /// \brief Checks if layout has 'channels' dimension /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API bool has_channels(const Layout& layout); /// \brief Returns 'channels' dimension index. /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API std::int64_t channels_idx(const Layout& layout); /// \brief Checks if layout has 'depth' dimension +/// \ingroup ov_layout_cpp_api OPENVINO_API bool has_depth(const Layout& layout); /// \brief Returns 'depth' dimension index. /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API std::int64_t depth_idx(const Layout& layout); /// \brief Checks if layout has 'height' dimension +/// \ingroup ov_layout_cpp_api OPENVINO_API bool has_height(const Layout& layout); /// \brief Returns 'height' dimension index. /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API std::int64_t height_idx(const Layout& layout); /// \brief Checks if layout has 'width' dimension +/// \ingroup ov_layout_cpp_api OPENVINO_API bool has_width(const Layout& layout); /// \brief Returns 'width' dimension index. /// /// \throws ov::AssertFailure if dimension doesn't exist. /// +/// \ingroup ov_layout_cpp_api OPENVINO_API std::int64_t width_idx(const Layout& layout); /// \brief Sets Layout of port /// /// \throws ov::Exception if port is not connected with Result or Parameter +/// \ingroup ov_layout_cpp_api OPENVINO_API void set_layout(ov::Output output, const ov::Layout& layout); /// \brief Gets Layout of port /// /// \return layout from port and empty layout in other case +/// \ingroup ov_layout_cpp_api OPENVINO_API ov::Layout get_layout(const ov::Output& output); /// \brief Gets Layout of port /// /// \return layout from port and empty layout in other case +/// \ingroup ov_layout_cpp_api OPENVINO_API ov::Layout get_layout(const ov::Output& output); } // namespace layout diff --git a/src/core/include/openvino/core/node.hpp b/src/core/include/openvino/core/node.hpp index 9472b9d718aa1f..35c4584cfeebda 100644 --- a/src/core/include/openvino/core/node.hpp +++ b/src/core/include/openvino/core/node.hpp @@ -110,9 +110,12 @@ std::string node_validation_failure_loc_string(const Node* node); class NodeAccessor; -/// Nodes are the backbone of the graph of Value dataflow. Every node has -/// zero or more nodes as arguments and one value, which is either a tensor -/// or a (possibly empty) tuple of values. +/** + * @brief Nodes are the backbone of the graph of Value dataflow. Every node has + * zero or more nodes as arguments and one value, which is either a tensor + * or a (possibly empty) tuple of values. + * @ingroup ov_model_cpp_api + */ class OPENVINO_API Node : public std::enable_shared_from_this { // For access to m_outputs. friend class descriptor::Input; diff --git a/src/core/include/openvino/core/node_input.hpp b/src/core/include/openvino/core/node_input.hpp index a2e30f28487e52..7db4ba8d395b82 100644 --- a/src/core/include/openvino/core/node_input.hpp +++ b/src/core/include/openvino/core/node_input.hpp @@ -24,6 +24,7 @@ template class Input {}; /// \brief A handle for one of a node's inputs. +/// \ingroup ov_model_cpp_api template <> class OPENVINO_API Input { public: @@ -75,6 +76,7 @@ class OPENVINO_API Input { }; /// \brief A handle for one of a node's inputs. +/// \ingroup ov_model_cpp_api template <> class OPENVINO_API Input { public: diff --git a/src/core/include/openvino/core/node_output.hpp b/src/core/include/openvino/core/node_output.hpp index 27cc2a555dfde8..e2a7734087c36d 100644 --- a/src/core/include/openvino/core/node_output.hpp +++ b/src/core/include/openvino/core/node_output.hpp @@ -25,6 +25,7 @@ template class Output {}; /// \brief A handle for one of a node's outputs. +/// \ingroup ov_model_cpp_api template <> class OPENVINO_API Output { public: @@ -108,6 +109,8 @@ class OPENVINO_API Output { size_t m_index{0}; }; +/// \brief A handle for one of a node's outputs. +/// \ingroup ov_model_cpp_api template <> class OPENVINO_API Output { public: diff --git a/src/core/include/openvino/core/partial_shape.hpp b/src/core/include/openvino/core/partial_shape.hpp index abb4bcc60d7229..e1046f95be0050 100644 --- a/src/core/include/openvino/core/partial_shape.hpp +++ b/src/core/include/openvino/core/partial_shape.hpp @@ -27,6 +27,7 @@ struct AutoBroadcastSpec; /// (Informal notation examples: `{1,2,?,4}`, `{?,?,?}`) /// \li Static rank, and static dimensions on all axes. /// (Informal notation examples: `{1,2,3,4}`, `{6}`, `{}`) +/// \ingroup ov_model_cpp_api class OPENVINO_API PartialShape { using Dimensions = std::vector; diff --git a/src/core/include/openvino/core/preprocess/pre_post_process.hpp b/src/core/include/openvino/core/preprocess/pre_post_process.hpp index 09a401511f9530..a1e0bd166b29bd 100644 --- a/src/core/include/openvino/core/preprocess/pre_post_process.hpp +++ b/src/core/include/openvino/core/preprocess/pre_post_process.hpp @@ -22,6 +22,7 @@ namespace preprocess { /// For advanced preprocessing scenarios, like combining several functions with multiple inputs/outputs into one, /// client's code can use transformation passes over ov::Model /// +/// \ingroup ov_model_cpp_api class OPENVINO_API PrePostProcessor final { class PrePostProcessorImpl; std::unique_ptr m_impl; diff --git a/src/core/include/openvino/core/shape.hpp b/src/core/include/openvino/core/shape.hpp index a2373140bdc706..24f6b41ee8e29a 100644 --- a/src/core/include/openvino/core/shape.hpp +++ b/src/core/include/openvino/core/shape.hpp @@ -14,7 +14,10 @@ #include "openvino/core/strides.hpp" namespace ov { -/// \brief Shape for a tensor. +/** + * @brief Shape for a tensor. + * @ingroup ov_model_cpp_api + */ class Shape : public std::vector { public: OPENVINO_API Shape(); @@ -36,7 +39,10 @@ class Shape : public std::vector { OPENVINO_API Shape& operator=(Shape&& v) noexcept; }; -/// Number of elements in spanned by a shape +/** + * @brief Number of elements in spanned by a shape + * @ingroup ov_model_cpp_api + */ template size_t shape_size(const SHAPE_TYPE& shape) { size_t size = 1; @@ -46,8 +52,11 @@ size_t shape_size(const SHAPE_TYPE& shape) { return size; } -/// Number of elements in a subset of dimensions of a shape. -/// Returns a product of dimensions in a range [start_dim;end_dim) +/** + * Number of elements in a subset of dimensions of a shape. + * Returns a product of dimensions in a range [start_dim;end_dim) + * @ingroup ov_model_cpp_api + */ template size_t shape_size(ForwardIt start_dim, const ForwardIt end_dim) { static_assert(std::is_arithmetic::value_type>::value, diff --git a/src/core/include/openvino/core/type.hpp b/src/core/include/openvino/core/type.hpp index 6c6f2119d98ced..c405e29e71e63c 100644 --- a/src/core/include/openvino/core/type.hpp +++ b/src/core/include/openvino/core/type.hpp @@ -18,13 +18,16 @@ namespace ov { -/// Supports three functions, ov::is_type, ov::as_type, and ov::as_type_ptr for type-safe -/// dynamic conversions via static_cast/static_ptr_cast without using C++ RTTI. -/// Type must have a static type_info member and a virtual get_type_info() member that -/// returns a reference to its type_info member. - -/// Type information for a type system without inheritance; instances have exactly one type not -/// related to any other type. +/** + * @brief Type information for a type system without inheritance; instances have exactly one type not + * related to any other type. + * + * Supports three functions, ov::is_type, ov::as_type, and ov::as_type_ptr for type-safe + * dynamic conversions via static_cast/static_ptr_cast without using C++ RTTI. + * Type must have a static type_info member and a virtual get_type_info() member that + * returns a reference to its type_info member. + * @ingroup ov_model_cpp_api + */ struct OPENVINO_API DiscreteTypeInfo { const char* name; uint64_t version; diff --git a/src/core/include/openvino/core/type/element_type.hpp b/src/core/include/openvino/core/type/element_type.hpp index 9de272a73005eb..5679e13e52a4bf 100644 --- a/src/core/include/openvino/core/type/element_type.hpp +++ b/src/core/include/openvino/core/type/element_type.hpp @@ -22,29 +22,40 @@ #include "openvino/core/type/bfloat16.hpp" #include "openvino/core/type/float16.hpp" +/** + * @defgroup ov_element_cpp_api Element types + * @ingroup ov_model_cpp_api + * OpenVINO Element API to work with OpenVINO element types + * + */ + namespace ov { namespace element { +/// \brief Enum to define possible element types +/// \ingroup ov_element_cpp_api enum class Type_t { - undefined, - dynamic, - boolean, - bf16, - f16, - f32, - f64, - i4, - i8, - i16, - i32, - i64, - u1, - u4, - u8, - u16, - u32, - u64 + undefined, //!< Undefined element type + dynamic, //!< Dynamic element type + boolean, //!< boolean element type + bf16, //!< bf16 element type + f16, //!< f16 element type + f32, //!< f32 element type + f64, //!< f64 element type + i4, //!< i4 element type + i8, //!< i8 element type + i16, //!< i16 element type + i32, //!< i32 element type + i64, //!< i64 element type + u1, //!< binary element type + u4, //!< u4 element type + u8, //!< u8 element type + u16, //!< u16 element type + u32, //!< u32 element type + u64 //!< u64 element type }; +/// \brief Base class to define element type +/// \ingroup ov_element_cpp_api class OPENVINO_API Type { public: Type() = default; @@ -110,23 +121,59 @@ class OPENVINO_API Type { using TypeVector = std::vector; +/// \brief undefined element type +/// \ingroup ov_element_cpp_api constexpr Type undefined(Type_t::undefined); +/// \brief dynamic element type +/// \ingroup ov_element_cpp_api constexpr Type dynamic(Type_t::dynamic); +/// \brief boolean element type +/// \ingroup ov_element_cpp_api constexpr Type boolean(Type_t::boolean); +/// \brief bf16 element type +/// \ingroup ov_element_cpp_api constexpr Type bf16(Type_t::bf16); +/// \brief f16 element type +/// \ingroup ov_element_cpp_api constexpr Type f16(Type_t::f16); +/// \brief f32 element type +/// \ingroup ov_element_cpp_api constexpr Type f32(Type_t::f32); +/// \brief f64 element type +/// \ingroup ov_element_cpp_api constexpr Type f64(Type_t::f64); +/// \brief i4 element type +/// \ingroup ov_element_cpp_api constexpr Type i4(Type_t::i4); +/// \brief i8 element type +/// \ingroup ov_element_cpp_api constexpr Type i8(Type_t::i8); +/// \brief i16 element type +/// \ingroup ov_element_cpp_api constexpr Type i16(Type_t::i16); +/// \brief i32 element type +/// \ingroup ov_element_cpp_api constexpr Type i32(Type_t::i32); +/// \brief i64 element type +/// \ingroup ov_element_cpp_api constexpr Type i64(Type_t::i64); +/// \brief binary element type +/// \ingroup ov_element_cpp_api constexpr Type u1(Type_t::u1); +/// \brief u4 element type +/// \ingroup ov_element_cpp_api constexpr Type u4(Type_t::u4); +/// \brief u8 element type +/// \ingroup ov_element_cpp_api constexpr Type u8(Type_t::u8); +/// \brief u16 element type +/// \ingroup ov_element_cpp_api constexpr Type u16(Type_t::u16); +/// \brief u32 element type +/// \ingroup ov_element_cpp_api constexpr Type u32(Type_t::u32); +/// \brief u64 element type +/// \ingroup ov_element_cpp_api constexpr Type u64(Type_t::u64); template diff --git a/src/core/include/openvino/op/abs.hpp b/src/core/include/openvino/op/abs.hpp index ac96d9f3b8b609..64bc37e5f57cd7 100644 --- a/src/core/include/openvino/op/abs.hpp +++ b/src/core/include/openvino/op/abs.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise absolute value operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Abs : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Abs", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/acos.hpp b/src/core/include/openvino/op/acos.hpp index 210830013a3815..418fac705f3ff6 100644 --- a/src/core/include/openvino/op/acos.hpp +++ b/src/core/include/openvino/op/acos.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise inverse cosine (arccos) operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Acos : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Acos", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/acosh.hpp b/src/core/include/openvino/op/acosh.hpp index 13454bf7dd8c30..1f91d38ca7ba87 100644 --- a/src/core/include/openvino/op/acosh.hpp +++ b/src/core/include/openvino/op/acosh.hpp @@ -13,6 +13,7 @@ namespace op { namespace v3 { /// \brief Elementwise inverse hyperbolic cos operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Acosh : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Acosh", "opset4", util::UnaryElementwiseArithmetic, 3); diff --git a/src/core/include/openvino/op/adaptive_avg_pool.hpp b/src/core/include/openvino/op/adaptive_avg_pool.hpp index 9a20b524c59dde..9514665690891c 100644 --- a/src/core/include/openvino/op/adaptive_avg_pool.hpp +++ b/src/core/include/openvino/op/adaptive_avg_pool.hpp @@ -12,6 +12,7 @@ namespace op { namespace v8 { /// \brief Adaptive average pooling operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API AdaptiveAvgPool : public Op { public: OPENVINO_OP("AdaptiveAvgPool", "opset8"); diff --git a/src/core/include/openvino/op/adaptive_max_pool.hpp b/src/core/include/openvino/op/adaptive_max_pool.hpp index 44eb38c33ac8bc..37828627fd9985 100644 --- a/src/core/include/openvino/op/adaptive_max_pool.hpp +++ b/src/core/include/openvino/op/adaptive_max_pool.hpp @@ -12,6 +12,7 @@ namespace op { namespace v8 { /// \brief Adaptive max pooling operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API AdaptiveMaxPool : public Op { public: OPENVINO_OP("AdaptiveMaxPool", "opset8"); diff --git a/src/core/include/openvino/op/add.hpp b/src/core/include/openvino/op/add.hpp index 0eaafaf52b0ef1..526d089a1e00e5 100644 --- a/src/core/include/openvino/op/add.hpp +++ b/src/core/include/openvino/op/add.hpp @@ -13,6 +13,7 @@ namespace op { namespace v1 { /// \brief Elementwise addition operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Add : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Add", "opset1", util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/asin.hpp b/src/core/include/openvino/op/asin.hpp index 637b0123993f46..5cb148805b7e61 100644 --- a/src/core/include/openvino/op/asin.hpp +++ b/src/core/include/openvino/op/asin.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise inverse sine (arcsin) operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Asin : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Asin", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/assign.hpp b/src/core/include/openvino/op/assign.hpp index fad9820cd851d3..57dff00f1dbd12 100644 --- a/src/core/include/openvino/op/assign.hpp +++ b/src/core/include/openvino/op/assign.hpp @@ -11,6 +11,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Assign operation sets an input value to the variable with `variable_id` +/// \ingroup ov_ops_cpp_api class OPENVINO_API Assign : public util::AssignBase { public: OPENVINO_OP("Assign", "opset3", op::Sink, 3); @@ -41,6 +42,7 @@ class OPENVINO_API Assign : public util::AssignBase { namespace v6 { /// \brief Assign operation sets an input value to the variable with `variable_id` +/// \ingroup ov_ops_cpp_api class OPENVINO_API Assign : public util::AssignBase { public: OPENVINO_OP("Assign", "opset6", op::Sink, 6); diff --git a/src/core/include/openvino/op/atan.hpp b/src/core/include/openvino/op/atan.hpp index 135d2cb7b2b6ae..9f61ffd7c3fe47 100644 --- a/src/core/include/openvino/op/atan.hpp +++ b/src/core/include/openvino/op/atan.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise inverse tangent (arctan) operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Atan : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Atan", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/atanh.hpp b/src/core/include/openvino/op/atanh.hpp index 6c571c2661dbfe..5b9aa04fe28004 100644 --- a/src/core/include/openvino/op/atanh.hpp +++ b/src/core/include/openvino/op/atanh.hpp @@ -13,6 +13,7 @@ namespace op { namespace v3 { /// \brief Elementwise inverse hyperbolic tangent operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Atanh : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Atanh", "opset4", util::UnaryElementwiseArithmetic, 3); diff --git a/src/core/include/openvino/op/batch_norm.hpp b/src/core/include/openvino/op/batch_norm.hpp index c29c4020215b78..d6d1204e376ed0 100644 --- a/src/core/include/openvino/op/batch_norm.hpp +++ b/src/core/include/openvino/op/batch_norm.hpp @@ -11,6 +11,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief BatchNormInference operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API BatchNormInference : public Op { public: OPENVINO_OP("BatchNormInference", "opset1"); @@ -52,6 +55,9 @@ class OPENVINO_API BatchNormInference : public Op { }; } // namespace v0 namespace v5 { +/// \brief BatchNormInference operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API BatchNormInference : public Op { public: OPENVINO_OP("BatchNormInference", "opset5", op::Op, 5); diff --git a/src/core/include/openvino/op/batch_to_space.hpp b/src/core/include/openvino/op/batch_to_space.hpp index 291ec4eb881bc5..8a25f81f2fd9fe 100644 --- a/src/core/include/openvino/op/batch_to_space.hpp +++ b/src/core/include/openvino/op/batch_to_space.hpp @@ -20,6 +20,7 @@ namespace v1 { /// D_2 * block_shape[2] - crops_begin[2] - crops_end[2], ..., /// D_{N - 1} * block_shape[N - 1] - crops_begin[N - 1] - crops_end[N - 1]` /// of the same type as `data` input. +/// \ingroup ov_ops_cpp_api class OPENVINO_API BatchToSpace : public Op { public: OPENVINO_OP("BatchToSpace", "opset2", op::Op, 1); diff --git a/src/core/include/openvino/op/binary_convolution.hpp b/src/core/include/openvino/op/binary_convolution.hpp index 6f09f6aaf4b41a..c83cb9096950e8 100644 --- a/src/core/include/openvino/op/binary_convolution.hpp +++ b/src/core/include/openvino/op/binary_convolution.hpp @@ -11,6 +11,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief BinaryConvolution operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API BinaryConvolution : public Op { public: OPENVINO_OP("BinaryConvolution", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/broadcast.hpp b/src/core/include/openvino/op/broadcast.hpp index 57759949d1d1f7..9279745a7f7436 100644 --- a/src/core/include/openvino/op/broadcast.hpp +++ b/src/core/include/openvino/op/broadcast.hpp @@ -14,6 +14,7 @@ namespace op { namespace v3 { /// \brief Operation which "adds" axes to an input tensor, replicating elements from the /// input as needed along the new axes. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Broadcast : public util::BroadcastBase { public: OPENVINO_OP("Broadcast", "opset3", op::util::BroadcastBase, 3); @@ -78,6 +79,7 @@ class OPENVINO_API Broadcast : public util::BroadcastBase { namespace v1 { /// \brief Operation which "adds" axes to an input tensor, replicating elements from the /// input as needed along the new axes. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Broadcast : public util::BroadcastBase { public: OPENVINO_OP("Broadcast", "opset1", op::util::BroadcastBase, 1); diff --git a/src/core/include/openvino/op/bucketize.hpp b/src/core/include/openvino/op/bucketize.hpp index 8541e7516000f5..63041c4cda71f1 100644 --- a/src/core/include/openvino/op/bucketize.hpp +++ b/src/core/include/openvino/op/bucketize.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Operation that bucketizes the input based on boundaries +/// \ingroup ov_ops_cpp_api class OPENVINO_API Bucketize : public Op { public: OPENVINO_OP("Bucketize", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/ceiling.hpp b/src/core/include/openvino/op/ceiling.hpp index d12f7d9a8c6d84..6429b646467478 100644 --- a/src/core/include/openvino/op/ceiling.hpp +++ b/src/core/include/openvino/op/ceiling.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise ceiling operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Ceiling : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Ceiling", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/clamp.hpp b/src/core/include/openvino/op/clamp.hpp index 3c68ad6d073618..e08341f11409fa 100644 --- a/src/core/include/openvino/op/clamp.hpp +++ b/src/core/include/openvino/op/clamp.hpp @@ -14,6 +14,7 @@ namespace v0 { /// All input values that are outside of the range are set to 'min' or 'max' /// depending on which side of the range they are. The values that fall into /// this range remain unchanged. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Clamp : public Op { public: OPENVINO_OP("Clamp", "opset1"); diff --git a/src/core/include/openvino/op/concat.hpp b/src/core/include/openvino/op/concat.hpp index 18d29b5ee062f6..0ee294e58619b2 100644 --- a/src/core/include/openvino/op/concat.hpp +++ b/src/core/include/openvino/op/concat.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Concatenation operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Concat : public Op { public: OPENVINO_OP("Concat", "opset1"); diff --git a/src/core/include/openvino/op/constant.hpp b/src/core/include/openvino/op/constant.hpp index e65a22cf11f830..6058eeb7dca0c2 100644 --- a/src/core/include/openvino/op/constant.hpp +++ b/src/core/include/openvino/op/constant.hpp @@ -19,6 +19,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Class for constants. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Constant : public Op { public: OPENVINO_OP("Constant", "opset1"); diff --git a/src/core/include/openvino/op/convert.hpp b/src/core/include/openvino/op/convert.hpp index a44d7bbbc64886..d2d907d49a4f54 100644 --- a/src/core/include/openvino/op/convert.hpp +++ b/src/core/include/openvino/op/convert.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise type conversion operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Convert : public Op { public: OPENVINO_OP("Convert", "opset1"); diff --git a/src/core/include/openvino/op/convert_like.hpp b/src/core/include/openvino/op/convert_like.hpp index 8ec601b84f29fa..ed63a2f5269072 100644 --- a/src/core/include/openvino/op/convert_like.hpp +++ b/src/core/include/openvino/op/convert_like.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise type conversion operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ConvertLike : public Op { public: OPENVINO_OP("ConvertLike", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/convolution.hpp b/src/core/include/openvino/op/convolution.hpp index c6005142855eab..e3b83f47d4d82b 100644 --- a/src/core/include/openvino/op/convolution.hpp +++ b/src/core/include/openvino/op/convolution.hpp @@ -13,6 +13,7 @@ namespace op { namespace v1 { /// \brief Batched convolution operation, with optional window dilation and stride. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Convolution : public Op { public: OPENVINO_OP("Convolution", "opset1", op::Op, 1); @@ -127,6 +128,7 @@ class OPENVINO_API Convolution : public Op { }; /// \brief Data batch backprop for batched convolution operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ConvolutionBackpropData : public Op { public: OPENVINO_OP("ConvolutionBackpropData", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/cos.hpp b/src/core/include/openvino/op/cos.hpp index 850db68858b6e0..b1d60596659574 100644 --- a/src/core/include/openvino/op/cos.hpp +++ b/src/core/include/openvino/op/cos.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise cosine operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Cos : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Cos", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/cosh.hpp b/src/core/include/openvino/op/cosh.hpp index bb7c7fd9dd69d6..7f44084d2b6fc6 100644 --- a/src/core/include/openvino/op/cosh.hpp +++ b/src/core/include/openvino/op/cosh.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise hyperbolic cosine (cosh) operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Cosh : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Cosh", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/ctc_greedy_decoder.hpp b/src/core/include/openvino/op/ctc_greedy_decoder.hpp index 2903f273bf1c0b..c41e3de2dbf47f 100644 --- a/src/core/include/openvino/op/ctc_greedy_decoder.hpp +++ b/src/core/include/openvino/op/ctc_greedy_decoder.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief CTCGreedyDecoder operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API CTCGreedyDecoder : public Op { public: OPENVINO_OP("CTCGreedyDecoder", "opset1"); diff --git a/src/core/include/openvino/op/ctc_greedy_decoder_seq_len.hpp b/src/core/include/openvino/op/ctc_greedy_decoder_seq_len.hpp index a94243c58ec467..c2ab315b4cd1e0 100644 --- a/src/core/include/openvino/op/ctc_greedy_decoder_seq_len.hpp +++ b/src/core/include/openvino/op/ctc_greedy_decoder_seq_len.hpp @@ -11,6 +11,7 @@ namespace op { namespace v6 { /// \brief Operator performing CTCGreedyDecoder /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API CTCGreedyDecoderSeqLen : public Op { public: OPENVINO_OP("CTCGreedyDecoderSeqLen", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/ctc_loss.hpp b/src/core/include/openvino/op/ctc_loss.hpp index 2a118f7f92f9d2..6f81a93e8adeee 100644 --- a/src/core/include/openvino/op/ctc_loss.hpp +++ b/src/core/include/openvino/op/ctc_loss.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v4 { +/// \brief CTCLoss operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API CTCLoss : public Op { public: OPENVINO_OP("CTCLoss", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/cum_sum.hpp b/src/core/include/openvino/op/cum_sum.hpp index d544efd6d40e3a..976294e91f9ce5 100644 --- a/src/core/include/openvino/op/cum_sum.hpp +++ b/src/core/include/openvino/op/cum_sum.hpp @@ -14,6 +14,7 @@ namespace v0 { /// /// Compute the cumulative sum of the input tensor along the axis specified. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API CumSum : public Op { public: OPENVINO_OP("CumSum", "opset3"); diff --git a/src/core/include/openvino/op/deformable_convolution.hpp b/src/core/include/openvino/op/deformable_convolution.hpp index 6e24482ac2ad85..729fcc12cad16f 100644 --- a/src/core/include/openvino/op/deformable_convolution.hpp +++ b/src/core/include/openvino/op/deformable_convolution.hpp @@ -13,6 +13,7 @@ namespace ov { namespace op { namespace v1 { /// \brief DeformableConvolution operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API DeformableConvolution : public op::util::DeformableConvolutionBase { public: OPENVINO_OP("DeformableConvolution", "opset1", op::util::DeformableConvolutionBase, 1); @@ -57,6 +58,9 @@ class OPENVINO_API DeformableConvolution : public op::util::DeformableConvolutio } // namespace v1 namespace v8 { +/// \brief DeformableConvolution operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API DeformableConvolution : public op::util::DeformableConvolutionBase { public: OPENVINO_OP("DeformableConvolution", "opset8", op::util::DeformableConvolutionBase); diff --git a/src/core/include/openvino/op/deformable_psroi_pooling.hpp b/src/core/include/openvino/op/deformable_psroi_pooling.hpp index cb456c1d50d22a..37569d3b0b6e30 100644 --- a/src/core/include/openvino/op/deformable_psroi_pooling.hpp +++ b/src/core/include/openvino/op/deformable_psroi_pooling.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief DeformablePSROIPooling operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API DeformablePSROIPooling : public Op { public: OPENVINO_OP("DeformablePSROIPooling", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/depth_to_space.hpp b/src/core/include/openvino/op/depth_to_space.hpp index f3e18f6a9a8f94..f165fbff60fa53 100644 --- a/src/core/include/openvino/op/depth_to_space.hpp +++ b/src/core/include/openvino/op/depth_to_space.hpp @@ -18,6 +18,7 @@ namespace v0 { /// /// Output node produces a tensor with shape: /// [N, C/(blocksize * blocksize), H * blocksize, W * blocksize] +/// \ingroup ov_ops_cpp_api class OPENVINO_API DepthToSpace : public Op { public: OPENVINO_OP("DepthToSpace", "opset1"); diff --git a/src/core/include/openvino/op/dft.hpp b/src/core/include/openvino/op/dft.hpp index 0a8b48af56a5c8..3c270833913bff 100644 --- a/src/core/include/openvino/op/dft.hpp +++ b/src/core/include/openvino/op/dft.hpp @@ -26,6 +26,7 @@ namespace ov { namespace op { namespace v7 { /// \brief An operation DFT that computes the discrete Fourier transformation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API DFT : public util::FFTBase { public: OPENVINO_OP("DFT", "opset7", util::FFTBase, 7); diff --git a/src/core/include/openvino/op/divide.hpp b/src/core/include/openvino/op/divide.hpp index fccc4818108f26..f524b83e799aaa 100644 --- a/src/core/include/openvino/op/divide.hpp +++ b/src/core/include/openvino/op/divide.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise division operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Divide : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Divide", "opset1", util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/einsum.hpp b/src/core/include/openvino/op/einsum.hpp index 64b66436005fd8..e028abea431df7 100644 --- a/src/core/include/openvino/op/einsum.hpp +++ b/src/core/include/openvino/op/einsum.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v7 { /// \brief Einsum operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Einsum : public Op { public: OPENVINO_OP("Einsum", "opset7", op::Op, 7); diff --git a/src/core/include/openvino/op/elu.hpp b/src/core/include/openvino/op/elu.hpp index aab5c84f311d46..6ef2dce872ba45 100644 --- a/src/core/include/openvino/op/elu.hpp +++ b/src/core/include/openvino/op/elu.hpp @@ -13,6 +13,7 @@ namespace v0 { /// x < 0 => f(x) = alpha * (exp(x) - 1.) /// x >= 0 => f(x) = x /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Elu : public Op { public: OPENVINO_OP("Elu", "opset1"); diff --git a/src/core/include/openvino/op/embedding_segments_sum.hpp b/src/core/include/openvino/op/embedding_segments_sum.hpp index 755aaf1f986ccb..d021fb9cf55985 100644 --- a/src/core/include/openvino/op/embedding_segments_sum.hpp +++ b/src/core/include/openvino/op/embedding_segments_sum.hpp @@ -11,6 +11,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Returns embeddings for given indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API EmbeddingSegmentsSum : public Op { public: OPENVINO_OP("EmbeddingSegmentsSum", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/embeddingbag_offsets_sum.hpp b/src/core/include/openvino/op/embeddingbag_offsets_sum.hpp index bf2d7824a7b1e2..6cb37b0157ae2d 100644 --- a/src/core/include/openvino/op/embeddingbag_offsets_sum.hpp +++ b/src/core/include/openvino/op/embeddingbag_offsets_sum.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Returns embeddings for given indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API EmbeddingBagOffsetsSum : public util::EmbeddingBagOffsetsBase { public: OPENVINO_OP("EmbeddingBagOffsetsSum", "opset3", util::EmbeddingBagOffsetsBase, 3); diff --git a/src/core/include/openvino/op/embeddingbag_packedsum.hpp b/src/core/include/openvino/op/embeddingbag_packedsum.hpp index bf264ef81f5319..b9f4654a15b524 100644 --- a/src/core/include/openvino/op/embeddingbag_packedsum.hpp +++ b/src/core/include/openvino/op/embeddingbag_packedsum.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Returns embeddings for given indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API EmbeddingBagPackedSum : public util::EmbeddingBagPackedBase { public: OPENVINO_OP("EmbeddingBagPackedSum", "opset3", util::EmbeddingBagPackedBase, 3); diff --git a/src/core/include/openvino/op/equal.hpp b/src/core/include/openvino/op/equal.hpp index 37535072624c82..fa001480aa526b 100644 --- a/src/core/include/openvino/op/equal.hpp +++ b/src/core/include/openvino/op/equal.hpp @@ -25,6 +25,7 @@ namespace v1 { /// | Type | Description | /// | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | /// | \f$\texttt{bool}[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = 1\text{ if }\texttt{arg0}[i_1,\dots,i_n] = \texttt{arg1}[i_1,\dots,i_n]\text{, else } 0\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Equal : public util::BinaryElementwiseComparison { public: diff --git a/src/core/include/openvino/op/erf.hpp b/src/core/include/openvino/op/erf.hpp index 218d3e9a6d8706..637566c7f8e7db 100644 --- a/src/core/include/openvino/op/erf.hpp +++ b/src/core/include/openvino/op/erf.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise erf operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Erf : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Erf", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/exp.hpp b/src/core/include/openvino/op/exp.hpp index f0cb2b806cac26..312909f12d5267 100644 --- a/src/core/include/openvino/op/exp.hpp +++ b/src/core/include/openvino/op/exp.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise natural exponential (exp) operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Exp : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Exp", "opset1", UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/experimental_detectron_detection_output.hpp b/src/core/include/openvino/op/experimental_detectron_detection_output.hpp index 710ad1633ece87..e940db9c3ba80b 100644 --- a/src/core/include/openvino/op/experimental_detectron_detection_output.hpp +++ b/src/core/include/openvino/op/experimental_detectron_detection_output.hpp @@ -17,6 +17,7 @@ namespace v6 { /// \brief An operation ExperimentalDetectronDetectionOutput performs /// non-maximum suppression to generate the detection output using /// information on location and score predictions. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExperimentalDetectronDetectionOutput : public Op { public: OPENVINO_OP("ExperimentalDetectronDetectionOutput", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/experimental_detectron_generate_proposals.hpp b/src/core/include/openvino/op/experimental_detectron_generate_proposals.hpp index e331f9ae27112c..e547d1145dfdee 100644 --- a/src/core/include/openvino/op/experimental_detectron_generate_proposals.hpp +++ b/src/core/include/openvino/op/experimental_detectron_generate_proposals.hpp @@ -16,6 +16,7 @@ namespace op { namespace v6 { /// \brief An operation ExperimentalDetectronGenerateProposalsSingleImage /// computes ROIs and their scores based on input data. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExperimentalDetectronGenerateProposalsSingleImage : public Op { public: OPENVINO_OP("ExperimentalDetectronGenerateProposalsSingleImage", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp b/src/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp index f017fc411824c8..06d5c8dd5f500d 100644 --- a/src/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp +++ b/src/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp @@ -16,6 +16,7 @@ namespace op { namespace v6 { /// \brief An operation ExperimentalDetectronPriorGridGenerator generates prior /// grids of specified sizes. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExperimentalDetectronPriorGridGenerator : public Op { public: OPENVINO_OP("ExperimentalDetectronPriorGridGenerator", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/experimental_detectron_roi_feature.hpp b/src/core/include/openvino/op/experimental_detectron_roi_feature.hpp index c73010754113cd..7c654e4d9b9965 100644 --- a/src/core/include/openvino/op/experimental_detectron_roi_feature.hpp +++ b/src/core/include/openvino/op/experimental_detectron_roi_feature.hpp @@ -17,6 +17,7 @@ namespace op { namespace v6 { /// \brief An operation ExperimentalDetectronROIFeatureExtractor /// is the ROIAlign operation applied over a feature pyramid. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExperimentalDetectronROIFeatureExtractor : public Op { public: OPENVINO_OP("ExperimentalDetectronROIFeatureExtractor", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/experimental_detectron_topkrois.hpp b/src/core/include/openvino/op/experimental_detectron_topkrois.hpp index 4c2c108525834c..741eab4ee41295 100644 --- a/src/core/include/openvino/op/experimental_detectron_topkrois.hpp +++ b/src/core/include/openvino/op/experimental_detectron_topkrois.hpp @@ -16,6 +16,7 @@ namespace op { namespace v6 { /// \brief An operation ExperimentalDetectronTopKROIs, according to the repository /// is TopK operation applied to probabilities of input ROIs. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExperimentalDetectronTopKROIs : public Op { public: OPENVINO_OP("ExperimentalDetectronTopKROIs", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/extractimagepatches.hpp b/src/core/include/openvino/op/extractimagepatches.hpp index 0afc9934927354..537c09e923e823 100644 --- a/src/core/include/openvino/op/extractimagepatches.hpp +++ b/src/core/include/openvino/op/extractimagepatches.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v3 { +/// \brief ExtractImagePatches operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ExtractImagePatches : public Op { public: OPENVINO_OP("ExtractImagePatches", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/fake_quantize.hpp b/src/core/include/openvino/op/fake_quantize.hpp index a35076c1770c1d..cfd9581898f892 100644 --- a/src/core/include/openvino/op/fake_quantize.hpp +++ b/src/core/include/openvino/op/fake_quantize.hpp @@ -23,6 +23,7 @@ namespace v0 { /// (levels-1) * (output_high - output_low) + output_low /// /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API FakeQuantize : public Op { public: OPENVINO_OP("FakeQuantize", "opset1"); diff --git a/src/core/include/openvino/op/floor.hpp b/src/core/include/openvino/op/floor.hpp index 69fad8adf655dc..3e42b9ff6b3775 100644 --- a/src/core/include/openvino/op/floor.hpp +++ b/src/core/include/openvino/op/floor.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise floor operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Floor : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Floor", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/floor_mod.hpp b/src/core/include/openvino/op/floor_mod.hpp index 745d97598f732c..443509868964a6 100644 --- a/src/core/include/openvino/op/floor_mod.hpp +++ b/src/core/include/openvino/op/floor_mod.hpp @@ -11,6 +11,7 @@ namespace op { namespace v1 { /// \brief Elementwise FloorMod operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API FloorMod : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("FloorMod", "opset1", op::util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/gather.hpp b/src/core/include/openvino/op/gather.hpp index f1a6206ed74e93..376e1112cb7f5b 100644 --- a/src/core/include/openvino/op/gather.hpp +++ b/src/core/include/openvino/op/gather.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Gather slices from axis of data according to indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API Gather : public op::util::GatherBase { public: OPENVINO_OP("Gather", "opset1", op::util::GatherBase, 1); @@ -30,6 +31,7 @@ class OPENVINO_API Gather : public op::util::GatherBase { namespace v7 { /// \brief Gather slices from axis of data according to indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API Gather : public op::util::GatherBase { public: OPENVINO_OP("Gather", "opset7", op::util::GatherBase, 7); @@ -57,6 +59,7 @@ class OPENVINO_API Gather : public op::util::GatherBase { namespace v8 { /// \brief Gather slices from axis of data according to indices. Negative indices /// are supported and indicate reverse indexing from the end +/// \ingroup ov_ops_cpp_api class OPENVINO_API Gather : public op::util::GatherBase { public: OPENVINO_OP("Gather", "opset8", op::util::GatherBase); diff --git a/src/core/include/openvino/op/gather_elements.hpp b/src/core/include/openvino/op/gather_elements.hpp index 8df970e44f509e..e3ae64b532be62 100644 --- a/src/core/include/openvino/op/gather_elements.hpp +++ b/src/core/include/openvino/op/gather_elements.hpp @@ -11,6 +11,7 @@ namespace op { namespace v6 { /// \brief GatherElements operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API GatherElements : public Op { public: OPENVINO_OP("GatherElements", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/gather_nd.hpp b/src/core/include/openvino/op/gather_nd.hpp index f370bd8e36299c..451ae2306991d6 100644 --- a/src/core/include/openvino/op/gather_nd.hpp +++ b/src/core/include/openvino/op/gather_nd.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v5 { /// \brief GatherND operation +/// \ingroup ov_ops_cpp_api class OPENVINO_API GatherND : public op::util::GatherNDBase { public: OPENVINO_OP("GatherND", "opset5", op::util::GatherNDBase, 5); @@ -32,6 +33,7 @@ class OPENVINO_API GatherND : public op::util::GatherNDBase { namespace v8 { /// \brief GatherND operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API GatherND : public op::util::GatherNDBase { public: OPENVINO_OP("GatherND", "opset8", op::util::GatherNDBase); diff --git a/src/core/include/openvino/op/gather_tree.hpp b/src/core/include/openvino/op/gather_tree.hpp index cc655600058f6c..39719673bb80c3 100644 --- a/src/core/include/openvino/op/gather_tree.hpp +++ b/src/core/include/openvino/op/gather_tree.hpp @@ -11,6 +11,7 @@ namespace op { namespace v1 { /// \brief Generates the complete beams from the ids per each step and the parent beam /// ids. +/// \ingroup ov_ops_cpp_api class OPENVINO_API GatherTree : public Op { public: OPENVINO_OP("GatherTree", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/gelu.hpp b/src/core/include/openvino/op/gelu.hpp index bea45c264bdd90..ada2be3fadc7bd 100644 --- a/src/core/include/openvino/op/gelu.hpp +++ b/src/core/include/openvino/op/gelu.hpp @@ -12,6 +12,7 @@ namespace op { namespace v0 { /// \brief Gaussian Error Linear Unit /// f(x) = 0.5 * x * (1 + erf( x / sqrt(2) ) +/// \ingroup ov_ops_cpp_api class OPENVINO_API Gelu : public Op { public: OPENVINO_OP("Gelu", "opset2", op::Op, 0); @@ -40,6 +41,7 @@ namespace v7 { /// f(x) = 0.5 * x * (1 + erf( x / sqrt(2) ) for "approximation" = "erf" /// f(x) = 0.5 * x * (1 + tanh([sqrt(2 / pi)] * [x + 0.044715^3]) for "approximation" = /// "tanh" +/// \ingroup ov_ops_cpp_api class OPENVINO_API Gelu : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Gelu", "opset7", op::Op, 7); diff --git a/src/core/include/openvino/op/greater.hpp b/src/core/include/openvino/op/greater.hpp index 9e02ff4cfded56..f524d4d20b3d55 100644 --- a/src/core/include/openvino/op/greater.hpp +++ b/src/core/include/openvino/op/greater.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise greater-than operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Greater : public util::BinaryElementwiseComparison { public: OPENVINO_OP("Greater", "opset1", op::util::BinaryElementwiseComparison, 1); diff --git a/src/core/include/openvino/op/greater_eq.hpp b/src/core/include/openvino/op/greater_eq.hpp index abb845415bb1a5..67cb7ab0989548 100644 --- a/src/core/include/openvino/op/greater_eq.hpp +++ b/src/core/include/openvino/op/greater_eq.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise greater-than-or-equal operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API GreaterEqual : public util::BinaryElementwiseComparison { public: OPENVINO_OP("GreaterEqual", "opset1", op::util::BinaryElementwiseComparison, 1); diff --git a/src/core/include/openvino/op/gru_cell.hpp b/src/core/include/openvino/op/gru_cell.hpp index d838cb18d47103..1e71e04600632c 100644 --- a/src/core/include/openvino/op/gru_cell.hpp +++ b/src/core/include/openvino/op/gru_cell.hpp @@ -21,6 +21,7 @@ namespace v3 { /// /// \note Note this class represents only single *cell* and not whole GRU *layer*. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API GRUCell : public util::RNNCellBase { public: OPENVINO_OP("GRUCell", "opset3", op::util::RNNCellBase, 3); diff --git a/src/core/include/openvino/op/gru_sequence.hpp b/src/core/include/openvino/op/gru_sequence.hpp index b80fbd1c32b6d6..5211ff46cee072 100644 --- a/src/core/include/openvino/op/gru_sequence.hpp +++ b/src/core/include/openvino/op/gru_sequence.hpp @@ -14,6 +14,9 @@ namespace ov { namespace op { namespace v5 { +/// \brief GRUSequence operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API GRUSequence : public util::RNNCellBase { public: OPENVINO_OP("GRUSequence", "opset5", op::Op, 5); diff --git a/src/core/include/openvino/op/hard_sigmoid.hpp b/src/core/include/openvino/op/hard_sigmoid.hpp index 5fb9e5d360d60a..5608c2773b0e9d 100644 --- a/src/core/include/openvino/op/hard_sigmoid.hpp +++ b/src/core/include/openvino/op/hard_sigmoid.hpp @@ -12,6 +12,7 @@ namespace v0 { /// \brief Parameterized, bounded sigmoid-like, piecewise linear /// function. min(max(alpha*x + beta, 0), 1) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API HardSigmoid : public Op { public: OPENVINO_OP("HardSigmoid", "opset1"); diff --git a/src/core/include/openvino/op/hsigmoid.hpp b/src/core/include/openvino/op/hsigmoid.hpp index e67cb19f31a930..ee977433835b84 100644 --- a/src/core/include/openvino/op/hsigmoid.hpp +++ b/src/core/include/openvino/op/hsigmoid.hpp @@ -14,6 +14,7 @@ namespace v5 { /// f(x) = min(max(x + 3, 0), 6) / 6 or /// f(x) = min(ReLU(x + 3), 6) / 6 /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API HSigmoid : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("HSigmoid", "opset5", op::util::UnaryElementwiseArithmetic, 5); diff --git a/src/core/include/openvino/op/hswish.hpp b/src/core/include/openvino/op/hswish.hpp index fbf1967f4b1750..a77e3d136d78a4 100644 --- a/src/core/include/openvino/op/hswish.hpp +++ b/src/core/include/openvino/op/hswish.hpp @@ -14,6 +14,7 @@ namespace v4 { /// f(x) = x * min(max(x + 3, 0), 6) / 6 or /// f(x) = x * min(ReLU(x + 3), 6) / 6 /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API HSwish : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("HSwish", "opset4", op::util::UnaryElementwiseArithmetic, 4); diff --git a/src/core/include/openvino/op/i420_to_bgr.hpp b/src/core/include/openvino/op/i420_to_bgr.hpp index 874fb994bd2f3b..fc8e1efaad271a 100644 --- a/src/core/include/openvino/op/i420_to_bgr.hpp +++ b/src/core/include/openvino/op/i420_to_bgr.hpp @@ -30,6 +30,7 @@ namespace v8 { /// B = 1.164 * (Y - 16) + 2.018 * (U - 128) /// Then R, G, B values are clipped to range (0, 255) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API I420toBGR : public util::ConvertColorI420Base { public: OPENVINO_OP("I420toBGR", "opset8", util::ConvertColorI420Base); diff --git a/src/core/include/openvino/op/i420_to_rgb.hpp b/src/core/include/openvino/op/i420_to_rgb.hpp index d7a5aaa7cb8e68..32dbc9b00c0274 100644 --- a/src/core/include/openvino/op/i420_to_rgb.hpp +++ b/src/core/include/openvino/op/i420_to_rgb.hpp @@ -30,6 +30,7 @@ namespace v8 { /// B = 1.164 * (Y - 16) + 2.018 * (U - 128) /// Then R, G, B values are clipped to range (0, 255) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API I420toRGB : public util::ConvertColorI420Base { public: OPENVINO_OP("I420toRGB", "opset8", util::ConvertColorI420Base); diff --git a/src/core/include/openvino/op/idft.hpp b/src/core/include/openvino/op/idft.hpp index 796c036c0288d1..4d1a04c5155c99 100644 --- a/src/core/include/openvino/op/idft.hpp +++ b/src/core/include/openvino/op/idft.hpp @@ -14,6 +14,7 @@ namespace ov { namespace op { namespace v7 { /// \brief An operation IDFT that computes the inverse discrete Fourier transformation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API IDFT : public util::FFTBase { public: OPENVINO_OP("IDFT", "opset7", util::FFTBase, 7); diff --git a/src/core/include/openvino/op/if.hpp b/src/core/include/openvino/op/if.hpp index 5384c670920f72..d39b2095df5aaf 100644 --- a/src/core/include/openvino/op/if.hpp +++ b/src/core/include/openvino/op/if.hpp @@ -14,6 +14,7 @@ namespace ov { namespace op { namespace v8 { /// \brief If operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API If : public util::MultiSubGraphOp { public: OPENVINO_OP("If", "opset8", MultiSubGraphOp); diff --git a/src/core/include/openvino/op/interpolate.hpp b/src/core/include/openvino/op/interpolate.hpp index ef8c0ffce35ad0..6bd2b9cbb6a359 100644 --- a/src/core/include/openvino/op/interpolate.hpp +++ b/src/core/include/openvino/op/interpolate.hpp @@ -17,6 +17,7 @@ namespace op { namespace v0 { /// \brief Layer which performs bilinear interpolation +/// \ingroup ov_ops_cpp_api class OPENVINO_API Interpolate : public Op { public: OPENVINO_OP("Interpolate", "opset1"); @@ -77,6 +78,9 @@ class OPENVINO_API Interpolate : public Op { } // namespace v0 namespace v4 { +/// \brief Interpolate operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Interpolate : public Op { public: OPENVINO_OP("Interpolate", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/less.hpp b/src/core/include/openvino/op/less.hpp index a800a5f1494a74..6e3f48b23cf75c 100644 --- a/src/core/include/openvino/op/less.hpp +++ b/src/core/include/openvino/op/less.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise less-than operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Less : public util::BinaryElementwiseComparison { public: OPENVINO_OP("Less", "opset1", op::util::BinaryElementwiseComparison, 1); diff --git a/src/core/include/openvino/op/less_eq.hpp b/src/core/include/openvino/op/less_eq.hpp index 445ccdc6dbf077..043dba98e71e71 100644 --- a/src/core/include/openvino/op/less_eq.hpp +++ b/src/core/include/openvino/op/less_eq.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise less-than-or-equal operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API LessEqual : public util::BinaryElementwiseComparison { public: OPENVINO_OP("LessEqual", "opset1", op::util::BinaryElementwiseComparison, 1); diff --git a/src/core/include/openvino/op/log.hpp b/src/core/include/openvino/op/log.hpp index de0a8441ad59b4..680b480da72013 100644 --- a/src/core/include/openvino/op/log.hpp +++ b/src/core/include/openvino/op/log.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise natural log operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Log : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Log", "opset1", op::util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/log_softmax.hpp b/src/core/include/openvino/op/log_softmax.hpp index 30ca400e88f322..a8ca66da78f61a 100644 --- a/src/core/include/openvino/op/log_softmax.hpp +++ b/src/core/include/openvino/op/log_softmax.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v5 { +/// \brief LogSoftmax operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LogSoftmax : public Op { public: OPENVINO_OP("LogSoftmax", "opset5", op::Op, 5); diff --git a/src/core/include/openvino/op/logical_and.hpp b/src/core/include/openvino/op/logical_and.hpp index fb998d74a40ef1..0d20f2f9b0fbf8 100644 --- a/src/core/include/openvino/op/logical_and.hpp +++ b/src/core/include/openvino/op/logical_and.hpp @@ -13,6 +13,7 @@ namespace op { namespace v1 { /// \brief Elementwise logical-and operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LogicalAnd : public util::BinaryElementwiseLogical { public: OPENVINO_OP("LogicalAnd", "opset1", util::BinaryElementwiseLogical, 1); diff --git a/src/core/include/openvino/op/logical_not.hpp b/src/core/include/openvino/op/logical_not.hpp index c81cc7a5162d93..533cc7fc9210f4 100644 --- a/src/core/include/openvino/op/logical_not.hpp +++ b/src/core/include/openvino/op/logical_not.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise logical negation operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API LogicalNot : public Op { public: OPENVINO_OP("LogicalNot", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/logical_or.hpp b/src/core/include/openvino/op/logical_or.hpp index f9ec6e0e11b0bd..7dd7994543362e 100644 --- a/src/core/include/openvino/op/logical_or.hpp +++ b/src/core/include/openvino/op/logical_or.hpp @@ -13,6 +13,7 @@ namespace op { namespace v1 { /// \brief Elementwise logical-or operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LogicalOr : public util::BinaryElementwiseLogical { public: OPENVINO_OP("LogicalOr", "opset1", util::BinaryElementwiseLogical, 1); diff --git a/src/core/include/openvino/op/logical_xor.hpp b/src/core/include/openvino/op/logical_xor.hpp index b37cb6515db5ba..1b35dc0c24c9a5 100644 --- a/src/core/include/openvino/op/logical_xor.hpp +++ b/src/core/include/openvino/op/logical_xor.hpp @@ -13,6 +13,7 @@ namespace op { namespace v1 { /// \brief Elementwise logical-xor operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LogicalXor : public util::BinaryElementwiseLogical { public: OPENVINO_OP("LogicalXor", "opset2", util::BinaryElementwiseLogical, 1); diff --git a/src/core/include/openvino/op/loop.hpp b/src/core/include/openvino/op/loop.hpp index e0e9c1c24bc76d..e5674531b1e6f3 100644 --- a/src/core/include/openvino/op/loop.hpp +++ b/src/core/include/openvino/op/loop.hpp @@ -15,6 +15,7 @@ namespace ov { namespace op { namespace v5 { /// \brief Iterate a body over tensors, accumulating into tensors. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Loop : public op::util::SubGraphOp { public: /// \brief Allows to define the purpose of inputs/outputs in the body diff --git a/src/core/include/openvino/op/lrn.hpp b/src/core/include/openvino/op/lrn.hpp index f6d2f61abd09f0..a74e864b3e0a32 100644 --- a/src/core/include/openvino/op/lrn.hpp +++ b/src/core/include/openvino/op/lrn.hpp @@ -23,6 +23,7 @@ namespace v0 { /// | Type | Description | /// | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | /// | \f$N[n, c, d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[n, c, d_1,\dots,d_n] = \frac{N[n,i,d_1,\dots,d_n]}{ (bias + alpha * (\sum_{i=max(0,(nsize-1)/2)}^{min(C, (nsize-1)/2)+1} N[n,i,d_1,\dots,d_n]^{2}) ^ {2})}\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API LRN : public Op { public: diff --git a/src/core/include/openvino/op/lstm_cell.hpp b/src/core/include/openvino/op/lstm_cell.hpp index 6d5ee0db8f2afe..5ea57492a51708 100644 --- a/src/core/include/openvino/op/lstm_cell.hpp +++ b/src/core/include/openvino/op/lstm_cell.hpp @@ -50,6 +50,7 @@ namespace v0 { /// /// \sa LSTMSequence, RNNCell, GRUCell /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LSTMCell : public util::RNNCellBase { public: OPENVINO_OP("LSTMCell", "opset1", op::util::RNNCellBase); @@ -273,6 +274,7 @@ namespace v4 { /// /// \sa LSTMSequence, RNNCell, GRUCell /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LSTMCell : public util::RNNCellBase { public: OPENVINO_OP("LSTMCell", "opset4", op::util::RNNCellBase, 4); diff --git a/src/core/include/openvino/op/lstm_sequence.hpp b/src/core/include/openvino/op/lstm_sequence.hpp index 8c834a57bbd66e..194a26f49b1367 100644 --- a/src/core/include/openvino/op/lstm_sequence.hpp +++ b/src/core/include/openvino/op/lstm_sequence.hpp @@ -28,6 +28,7 @@ namespace v0 { /// \sa LSTMCell, RNNCell, GRUCell /// /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LSTMSequence : public Op { public: OPENVINO_OP("LSTMSequence", "opset1"); @@ -147,6 +148,7 @@ namespace v5 { /// \sa LSTMCell, RNNCell, GRUCell /// /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API LSTMSequence : public util::RNNCellBase { public: OPENVINO_OP("LSTMSequence", "opset5", util::RNNCellBase, 5); diff --git a/src/core/include/openvino/op/matmul.hpp b/src/core/include/openvino/op/matmul.hpp index 37cdae89ee3d62..abbba946d41b30 100644 --- a/src/core/include/openvino/op/matmul.hpp +++ b/src/core/include/openvino/op/matmul.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Operator performing Matrix Multiplication. +/// \ingroup ov_ops_cpp_api class OPENVINO_API MatMul : public Op { public: OPENVINO_OP("MatMul", "opset1"); diff --git a/src/core/include/openvino/op/matrix_nms.hpp b/src/core/include/openvino/op/matrix_nms.hpp index c7cc3412cd448c..3ac390a282f400 100644 --- a/src/core/include/openvino/op/matrix_nms.hpp +++ b/src/core/include/openvino/op/matrix_nms.hpp @@ -11,6 +11,7 @@ namespace op { namespace v8 { /// \brief MatrixNms operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API MatrixNms : public util::NmsBase { public: OPENVINO_OP("MatrixNms", "opset8", op::util::NmsBase); diff --git a/src/core/include/openvino/op/max_pool.hpp b/src/core/include/openvino/op/max_pool.hpp index 135eadc7505ab5..5591a8f68eb1a1 100644 --- a/src/core/include/openvino/op/max_pool.hpp +++ b/src/core/include/openvino/op/max_pool.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Batched max pooling operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API MaxPool : public op::util::MaxPoolBase { public: OPENVINO_OP("MaxPool", "opset1", op::util::MaxPoolBase, 1); @@ -60,6 +61,7 @@ class OPENVINO_API MaxPool : public op::util::MaxPoolBase { namespace v8 { /// \brief MaxPooling operation with values and indices calculated as individual outputs +/// \ingroup ov_ops_cpp_api class OPENVINO_API MaxPool : public op::util::MaxPoolBase { public: OPENVINO_OP("MaxPool", "opset8", op::util::MaxPoolBase); diff --git a/src/core/include/openvino/op/maximum.hpp b/src/core/include/openvino/op/maximum.hpp index d91d47dcb0bca1..9bdcbe4fa5c59b 100644 --- a/src/core/include/openvino/op/maximum.hpp +++ b/src/core/include/openvino/op/maximum.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise maximum operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Maximum : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Maximum", "opset1", op::util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/minimum.hpp b/src/core/include/openvino/op/minimum.hpp index 1a5e4d6aa1725b..65536194eaf87d 100644 --- a/src/core/include/openvino/op/minimum.hpp +++ b/src/core/include/openvino/op/minimum.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise minimum operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Minimum : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Minimum", "opset1", op::util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/mish.hpp b/src/core/include/openvino/op/mish.hpp index d9833684302d7b..164af705456ebc 100644 --- a/src/core/include/openvino/op/mish.hpp +++ b/src/core/include/openvino/op/mish.hpp @@ -12,6 +12,7 @@ namespace v4 { /// \brief A Self Regularized Non-Monotonic Neural Activation Function /// f(x) = x * tanh(log(exp(x) + 1.)) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Mish : public Op { public: OPENVINO_OP("Mish", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/mod.hpp b/src/core/include/openvino/op/mod.hpp index fca0cc14411620..9f8c8748fa2417 100644 --- a/src/core/include/openvino/op/mod.hpp +++ b/src/core/include/openvino/op/mod.hpp @@ -11,6 +11,7 @@ namespace op { namespace v1 { /// \brief Mod returns an element-wise division reminder with two given tensors applying /// multi-directional broadcast rules. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Mod : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Mod", "opset1", op::util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/multiclass_nms.hpp b/src/core/include/openvino/op/multiclass_nms.hpp index 6cfaaf73a55a52..4c0c4128a29f6f 100644 --- a/src/core/include/openvino/op/multiclass_nms.hpp +++ b/src/core/include/openvino/op/multiclass_nms.hpp @@ -11,6 +11,7 @@ namespace op { namespace v8 { /// \brief MulticlassNms operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API MulticlassNms : public util::NmsBase { public: OPENVINO_OP("MulticlassNms", "opset8", op::util::NmsBase); diff --git a/src/core/include/openvino/op/multiply.hpp b/src/core/include/openvino/op/multiply.hpp index bb6386d9c2c8ae..592661cfe38fe1 100644 --- a/src/core/include/openvino/op/multiply.hpp +++ b/src/core/include/openvino/op/multiply.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise multiplication operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Multiply : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Multiply", "opset1", util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/mvn.hpp b/src/core/include/openvino/op/mvn.hpp index 00d4f571e8bdd0..df87896f986958 100644 --- a/src/core/include/openvino/op/mvn.hpp +++ b/src/core/include/openvino/op/mvn.hpp @@ -14,6 +14,7 @@ namespace op { namespace v0 { /// \brief Operator performing Mean Variance Normalization /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API MVN : public Op { public: OPENVINO_OP("MVN", "opset2"); @@ -87,6 +88,7 @@ std::ostream& operator<<(std::ostream& s, const MVNEpsMode& type); namespace v6 { /// \brief Operator performing Mean Variance Normalization /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API MVN : public Op { public: OPENVINO_OP("MVN", "opset6", op::Op, 6); diff --git a/src/core/include/openvino/op/negative.hpp b/src/core/include/openvino/op/negative.hpp index 5e220eedad9dcb..d083cf1ffe0bd1 100644 --- a/src/core/include/openvino/op/negative.hpp +++ b/src/core/include/openvino/op/negative.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise negative operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Negative : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Negative", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/non_max_suppression.hpp b/src/core/include/openvino/op/non_max_suppression.hpp index fd159307c3da9e..c83e00acc7cad4 100644 --- a/src/core/include/openvino/op/non_max_suppression.hpp +++ b/src/core/include/openvino/op/non_max_suppression.hpp @@ -11,6 +11,7 @@ namespace op { namespace v1 { /// \brief Elementwise addition operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NonMaxSuppression : public Op { public: enum class BoxEncodingType { CORNER, CENTER }; @@ -81,6 +82,7 @@ class OPENVINO_API NonMaxSuppression : public Op { namespace v3 { /// \brief NonMaxSuppression operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NonMaxSuppression : public Op { public: enum class BoxEncodingType { CORNER, CENTER }; @@ -163,6 +165,7 @@ class OPENVINO_API NonMaxSuppression : public Op { namespace v4 { /// \brief NonMaxSuppression operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NonMaxSuppression : public op::v3::NonMaxSuppression { public: OPENVINO_OP("NonMaxSuppression", "opset4", op::v3::NonMaxSuppression, 4); @@ -214,6 +217,7 @@ class OPENVINO_API NonMaxSuppression : public op::v3::NonMaxSuppression { namespace v5 { /// \brief NonMaxSuppression operation /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NonMaxSuppression : public Op { public: OPENVINO_OP("NonMaxSuppression", "opset5", op::Op, 5); diff --git a/src/core/include/openvino/op/non_zero.hpp b/src/core/include/openvino/op/non_zero.hpp index 955ee547a294aa..a7850a129ab5c5 100644 --- a/src/core/include/openvino/op/non_zero.hpp +++ b/src/core/include/openvino/op/non_zero.hpp @@ -17,6 +17,7 @@ namespace v3 { /// [0, 1, 1], /// [0, 1, 2]] /// The values point to input elements at [0,0,0], [0,1,1] and [2,1,2] +/// \ingroup ov_ops_cpp_api class OPENVINO_API NonZero : public Op { public: OPENVINO_OP("NonZero", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/normalize_l2.hpp b/src/core/include/openvino/op/normalize_l2.hpp index 03d663abd60707..9623a3dfdab4f5 100644 --- a/src/core/include/openvino/op/normalize_l2.hpp +++ b/src/core/include/openvino/op/normalize_l2.hpp @@ -14,6 +14,7 @@ namespace op { namespace v0 { /// \brief Normalization with L2 norm. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NormalizeL2 : public Op { public: OPENVINO_OP("NormalizeL2", "opset1"); diff --git a/src/core/include/openvino/op/not_equal.hpp b/src/core/include/openvino/op/not_equal.hpp index b8c5a23ee0a197..859f604e5c1344 100644 --- a/src/core/include/openvino/op/not_equal.hpp +++ b/src/core/include/openvino/op/not_equal.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise not-equal operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API NotEqual : public util::BinaryElementwiseComparison { public: OPENVINO_OP("NotEqual", "opset1", op::util::BinaryElementwiseComparison, 1); diff --git a/src/core/include/openvino/op/nv12_to_bgr.hpp b/src/core/include/openvino/op/nv12_to_bgr.hpp index 632963cfac7005..536c18693540e0 100644 --- a/src/core/include/openvino/op/nv12_to_bgr.hpp +++ b/src/core/include/openvino/op/nv12_to_bgr.hpp @@ -29,6 +29,7 @@ namespace v8 { /// B = 1.164 * (Y - 16) + 2.018 * (U - 128) /// Then R, G, B values are clipped to range (0, 255) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NV12toBGR : public util::ConvertColorNV12Base { public: OPENVINO_OP("NV12toBGR", "opset8", util::ConvertColorNV12Base); diff --git a/src/core/include/openvino/op/nv12_to_rgb.hpp b/src/core/include/openvino/op/nv12_to_rgb.hpp index d28b3739c11945..c52892d3e2009a 100644 --- a/src/core/include/openvino/op/nv12_to_rgb.hpp +++ b/src/core/include/openvino/op/nv12_to_rgb.hpp @@ -29,6 +29,7 @@ namespace v8 { /// B = 1.164 * (Y - 16) + 2.018 * (U - 128) /// Then R, G, B values are clipped to range (0, 255) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API NV12toRGB : public util::ConvertColorNV12Base { public: OPENVINO_OP("NV12toRGB", "opset8", util::ConvertColorNV12Base); diff --git a/src/core/include/openvino/op/one_hot.hpp b/src/core/include/openvino/op/one_hot.hpp index cc666483ff8bf1..5acf4864abb2eb 100644 --- a/src/core/include/openvino/op/one_hot.hpp +++ b/src/core/include/openvino/op/one_hot.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief OneHot operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API OneHot : public Op { public: OPENVINO_OP("OneHot", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/op.hpp b/src/core/include/openvino/op/op.hpp index e6474946b315ac..4987d37e5582a0 100644 --- a/src/core/include/openvino/op/op.hpp +++ b/src/core/include/openvino/op/op.hpp @@ -23,7 +23,8 @@ namespace ov { namespace op { -/// Root of all actual ops +/// \brief Root of all actual ops +/// \ingroup ov_ops_cpp_api class OPENVINO_API Op : public Node { protected: Op() : Node() {} diff --git a/src/core/include/openvino/op/pad.hpp b/src/core/include/openvino/op/pad.hpp index 07d87989eea868..a66835c431750a 100644 --- a/src/core/include/openvino/op/pad.hpp +++ b/src/core/include/openvino/op/pad.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Generic padding operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Pad : public Op { public: OPENVINO_OP("Pad", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/parameter.hpp b/src/core/include/openvino/op/parameter.hpp index b6ede9bcd8df63..63207276b8dbc2 100644 --- a/src/core/include/openvino/op/parameter.hpp +++ b/src/core/include/openvino/op/parameter.hpp @@ -15,6 +15,7 @@ namespace v0 { /// Parameters are nodes that represent the arguments that will be passed to /// user-defined models. Model creation requires a sequence of parameters. /// Basic graph operations do not need parameters attached to a model. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Parameter : public op::Op { public: OPENVINO_OP("Parameter", "opset1"); diff --git a/src/core/include/openvino/op/power.hpp b/src/core/include/openvino/op/power.hpp index 624850d54f0f71..8bdac461a2c152 100644 --- a/src/core/include/openvino/op/power.hpp +++ b/src/core/include/openvino/op/power.hpp @@ -24,6 +24,7 @@ namespace v1 { /// | Type | Description | /// | ---------------------- | -------------------------------------------------------------------------------------------------------------- | /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \texttt{arg0}[i_1,\dots,i_n]^{\texttt{arg1}[i_1,\dots,i_n]}\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Power : public util::BinaryElementwiseArithmetic { public: diff --git a/src/core/include/openvino/op/prelu.hpp b/src/core/include/openvino/op/prelu.hpp index 43b1f8b5593d9b..10c5118a067895 100644 --- a/src/core/include/openvino/op/prelu.hpp +++ b/src/core/include/openvino/op/prelu.hpp @@ -13,6 +13,7 @@ namespace v0 { /// x < 0 => f(x) = x * slope /// x >= 0 => f(x) = x /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API PRelu : public Op { public: OPENVINO_OP("PRelu", "opset1"); diff --git a/src/core/include/openvino/op/prior_box.hpp b/src/core/include/openvino/op/prior_box.hpp index 382959203d7f61..fa897678c068f4 100644 --- a/src/core/include/openvino/op/prior_box.hpp +++ b/src/core/include/openvino/op/prior_box.hpp @@ -11,6 +11,7 @@ namespace op { namespace v0 { /// \brief Layer which generates prior boxes of specified sizes /// normalized to input image size +/// \ingroup ov_ops_cpp_api class OPENVINO_API PriorBox : public Op { public: OPENVINO_OP("PriorBox", "opset1"); @@ -70,6 +71,7 @@ class OPENVINO_API PriorBox : public Op { namespace v8 { /// \brief Layer which generates prior boxes of specified sizes /// normalized to input image size +/// \ingroup ov_ops_cpp_api class OPENVINO_API PriorBox : public Op { public: OPENVINO_OP("PriorBox", "opset8"); diff --git a/src/core/include/openvino/op/prior_box_clustered.hpp b/src/core/include/openvino/op/prior_box_clustered.hpp index 471d2b6c733bdd..725a8ec6e4c078 100644 --- a/src/core/include/openvino/op/prior_box_clustered.hpp +++ b/src/core/include/openvino/op/prior_box_clustered.hpp @@ -12,6 +12,7 @@ namespace op { namespace v0 { /// \brief Layer which generates prior boxes of specified sizes /// normalized to input image size +/// \ingroup ov_ops_cpp_api class OPENVINO_API PriorBoxClustered : public Op { public: OPENVINO_OP("PriorBoxClustered", "opset1"); diff --git a/src/core/include/openvino/op/proposal.hpp b/src/core/include/openvino/op/proposal.hpp index 3e47df38376076..a3a8326d7032b9 100644 --- a/src/core/include/openvino/op/proposal.hpp +++ b/src/core/include/openvino/op/proposal.hpp @@ -10,6 +10,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief Proposal operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Proposal : public Op { public: OPENVINO_OP("Proposal", "opset1"); @@ -71,6 +74,9 @@ class OPENVINO_API Proposal : public Op { } // namespace v0 namespace v4 { +/// \brief Proposal operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Proposal : public op::v0::Proposal { public: OPENVINO_OP("Proposal", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/psroi_pooling.hpp b/src/core/include/openvino/op/psroi_pooling.hpp index e8caf5f68274ee..1ea8ca1826332d 100644 --- a/src/core/include/openvino/op/psroi_pooling.hpp +++ b/src/core/include/openvino/op/psroi_pooling.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief PSROIPooling operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API PSROIPooling : public Op { public: OPENVINO_OP("PSROIPooling", "opset1"); diff --git a/src/core/include/openvino/op/random_uniform.hpp b/src/core/include/openvino/op/random_uniform.hpp index 533bb230ce2693..4cbdea2d3120b9 100644 --- a/src/core/include/openvino/op/random_uniform.hpp +++ b/src/core/include/openvino/op/random_uniform.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v8 { /// \brief Tensor RandomUniform operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API RandomUniform : public Op { public: OPENVINO_OP("RandomUniform", "opset8"); diff --git a/src/core/include/openvino/op/range.hpp b/src/core/include/openvino/op/range.hpp index f5e264500c5ce3..c61d398d07edba 100644 --- a/src/core/include/openvino/op/range.hpp +++ b/src/core/include/openvino/op/range.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v4 { /// \brief Range operation, analogous to `arange()` in Numpy. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Range : public Op { public: OPENVINO_OP("Range", "opset4", op::Op, 4); @@ -53,6 +54,7 @@ class OPENVINO_API Range : public Op { } // namespace v4 namespace v0 { /// \brief Range operation, analogous to `range()` in Python. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Range : public Op { public: OPENVINO_OP("Range", "opset1"); diff --git a/src/core/include/openvino/op/read_value.hpp b/src/core/include/openvino/op/read_value.hpp index 87f2ec56557fdf..8b2734402c031f 100644 --- a/src/core/include/openvino/op/read_value.hpp +++ b/src/core/include/openvino/op/read_value.hpp @@ -12,6 +12,7 @@ namespace op { namespace v3 { /// \brief ReadValue operation creates the variable with `variable_id` and returns value /// of this variable. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReadValue : public util::ReadValueBase { public: OPENVINO_OP("ReadValue", "opset3", util::ReadValueBase, 3); @@ -42,6 +43,7 @@ class OPENVINO_API ReadValue : public util::ReadValueBase { namespace v6 { /// \brief ReadValue operation gets an input value from the variable with `variable_id` /// and returns it as an output. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReadValue : public util::ReadValueBase { public: OPENVINO_OP("ReadValue", "opset6", util::ReadValueBase, 6); diff --git a/src/core/include/openvino/op/reduce_l1.hpp b/src/core/include/openvino/op/reduce_l1.hpp index cbed140111fd5c..75fd5a42e7326c 100644 --- a/src/core/include/openvino/op/reduce_l1.hpp +++ b/src/core/include/openvino/op/reduce_l1.hpp @@ -13,6 +13,7 @@ namespace v4 { /// specified for the normalisation. /// /// Reduces the tensor, eliminating the specified reduction axes by taking the L1-norm. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceL1 : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceL1", "opset4", util::ArithmeticReductionKeepDims, 4); diff --git a/src/core/include/openvino/op/reduce_l2.hpp b/src/core/include/openvino/op/reduce_l2.hpp index 8150c6777eac63..fca0978730c90a 100644 --- a/src/core/include/openvino/op/reduce_l2.hpp +++ b/src/core/include/openvino/op/reduce_l2.hpp @@ -12,6 +12,7 @@ namespace v4 { /// \brief Reduction operation using L2 norm: /// /// Reduces the tensor, eliminating the specified reduction axes by taking the L2-norm. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceL2 : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceL2", "opset4", util::ArithmeticReductionKeepDims, 4); diff --git a/src/core/include/openvino/op/reduce_logical_and.hpp b/src/core/include/openvino/op/reduce_logical_and.hpp index 6522f91a8b9383..c8e43109091e03 100644 --- a/src/core/include/openvino/op/reduce_logical_and.hpp +++ b/src/core/include/openvino/op/reduce_logical_and.hpp @@ -13,6 +13,7 @@ namespace v1 { /// /// The reduction is performed over slices of the first input. The slices shape depends /// on the values passed to the second input - the axes. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceLogicalAnd : public util::LogicalReductionKeepDims { public: OPENVINO_OP("ReduceLogicalAnd", "opset1", util::LogicalReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_logical_or.hpp b/src/core/include/openvino/op/reduce_logical_or.hpp index 13d773a6cfb0be..d3eaac340fbfd5 100644 --- a/src/core/include/openvino/op/reduce_logical_or.hpp +++ b/src/core/include/openvino/op/reduce_logical_or.hpp @@ -13,6 +13,7 @@ namespace v1 { /// /// The reduction is performed over slices of the first input. The slices shape depends /// on the values passed to the second input - the axes. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceLogicalOr : public util::LogicalReductionKeepDims { public: OPENVINO_OP("ReduceLogicalOr", "opset1", util::LogicalReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_max.hpp b/src/core/include/openvino/op/reduce_max.hpp index 197e87abda05ec..433e11920770b6 100644 --- a/src/core/include/openvino/op/reduce_max.hpp +++ b/src/core/include/openvino/op/reduce_max.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief ReduceMax operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceMax : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceMax", "opset1", util::ArithmeticReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_mean.hpp b/src/core/include/openvino/op/reduce_mean.hpp index c05d58393b56b5..b0e3ad9bff7fcc 100644 --- a/src/core/include/openvino/op/reduce_mean.hpp +++ b/src/core/include/openvino/op/reduce_mean.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief ReduceMean operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceMean : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceMean", "opset1", util::ArithmeticReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_min.hpp b/src/core/include/openvino/op/reduce_min.hpp index c29ecc0e4bc369..0eb83503932b41 100644 --- a/src/core/include/openvino/op/reduce_min.hpp +++ b/src/core/include/openvino/op/reduce_min.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief ReduceMin operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceMin : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceMin", "opset1", util::ArithmeticReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_prod.hpp b/src/core/include/openvino/op/reduce_prod.hpp index ec85a0318c20a0..cae770880eeff6 100644 --- a/src/core/include/openvino/op/reduce_prod.hpp +++ b/src/core/include/openvino/op/reduce_prod.hpp @@ -12,6 +12,7 @@ namespace v1 { /// \brief Product reduction operation. /// /// Reduces the tensor, eliminating the specified reduction axes by taking the product. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReduceProd : public util::ArithmeticReductionKeepDims { public: OPENVINO_OP("ReduceProd", "opset1", util::ArithmeticReductionKeepDims, 1); diff --git a/src/core/include/openvino/op/reduce_sum.hpp b/src/core/include/openvino/op/reduce_sum.hpp index 738aba78cae446..d1753a20a6bd44 100644 --- a/src/core/include/openvino/op/reduce_sum.hpp +++ b/src/core/include/openvino/op/reduce_sum.hpp @@ -57,6 +57,7 @@ namespace v1 { /// | Type | Description | /// | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | /// | \f$N[\textit{delete}(A,d_1,\dots,d_n)]\f$ | The tensor \f$T\f$, where \f$T\f$ is the input tensor with the `reduction_axes` \f$A\f$ eliminated by summation. | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API ReduceSum : public util::ArithmeticReductionKeepDims { public: diff --git a/src/core/include/openvino/op/region_yolo.hpp b/src/core/include/openvino/op/region_yolo.hpp index 13aa070828fe2b..043637cffeb48a 100644 --- a/src/core/include/openvino/op/region_yolo.hpp +++ b/src/core/include/openvino/op/region_yolo.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief RegionYolo operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API RegionYolo : public Op { public: OPENVINO_OP("RegionYolo", "opset1"); diff --git a/src/core/include/openvino/op/relu.hpp b/src/core/include/openvino/op/relu.hpp index 268218285e1c14..0243a65f191d5f 100644 --- a/src/core/include/openvino/op/relu.hpp +++ b/src/core/include/openvino/op/relu.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise Relu operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Relu : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Relu", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/reorg_yolo.hpp b/src/core/include/openvino/op/reorg_yolo.hpp index 7772194ed9251c..46c43a323d339f 100644 --- a/src/core/include/openvino/op/reorg_yolo.hpp +++ b/src/core/include/openvino/op/reorg_yolo.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief ReorgYolo operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReorgYolo : public Op { public: OPENVINO_OP("ReorgYolo", "opset2"); diff --git a/src/core/include/openvino/op/reshape.hpp b/src/core/include/openvino/op/reshape.hpp index cb50ff67e4adf0..838e91b1079bbd 100644 --- a/src/core/include/openvino/op/reshape.hpp +++ b/src/core/include/openvino/op/reshape.hpp @@ -14,6 +14,7 @@ namespace v1 { /// "Converts" an input tensor into a new shape with the same number of elements. /// This op does not touch the actual data. If needed, use Transpose for that purpose. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Reshape : public Op { public: OPENVINO_OP("Reshape", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/result.hpp b/src/core/include/openvino/op/result.hpp index da0afc30d1a1c6..0693429d683074 100644 --- a/src/core/include/openvino/op/result.hpp +++ b/src/core/include/openvino/op/result.hpp @@ -10,6 +10,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief Result operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Result : public Op { public: OPENVINO_OP("Result", "opset1"); diff --git a/src/core/include/openvino/op/reverse.hpp b/src/core/include/openvino/op/reverse.hpp index 295f3dad55e73f..d3b8e137371b4c 100644 --- a/src/core/include/openvino/op/reverse.hpp +++ b/src/core/include/openvino/op/reverse.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief Reverse operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Reverse : public Op { public: OPENVINO_OP("Reverse", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/reverse_sequence.hpp b/src/core/include/openvino/op/reverse_sequence.hpp index 089c851b82aef0..5e2683f67fec30 100644 --- a/src/core/include/openvino/op/reverse_sequence.hpp +++ b/src/core/include/openvino/op/reverse_sequence.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief ReverseSequence operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ReverseSequence : public Op { public: OPENVINO_OP("ReverseSequence", "opset1"); diff --git a/src/core/include/openvino/op/rnn_cell.hpp b/src/core/include/openvino/op/rnn_cell.hpp index 27a1bd321b1bc5..0e607630f74819 100644 --- a/src/core/include/openvino/op/rnn_cell.hpp +++ b/src/core/include/openvino/op/rnn_cell.hpp @@ -34,6 +34,7 @@ namespace v0 { /// /// \sa LSTMSequence, LSTMCell, GRUCell /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API RNNCell : public util::RNNCellBase { public: OPENVINO_OP("RNNCell", "opset1", util::RNNCellBase); diff --git a/src/core/include/openvino/op/rnn_sequence.hpp b/src/core/include/openvino/op/rnn_sequence.hpp index 72c3573f1f1c2e..7efb217b247f52 100644 --- a/src/core/include/openvino/op/rnn_sequence.hpp +++ b/src/core/include/openvino/op/rnn_sequence.hpp @@ -13,6 +13,9 @@ namespace ov { namespace op { namespace v5 { +/// \brief RNNSequence operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API RNNSequence : public util::RNNCellBase { public: OPENVINO_OP("RNNSequence", "opset5", util::RNNCellBase, 4); diff --git a/src/core/include/openvino/op/roi_align.hpp b/src/core/include/openvino/op/roi_align.hpp index fbe7666fccf17b..bf8842892fcc9d 100644 --- a/src/core/include/openvino/op/roi_align.hpp +++ b/src/core/include/openvino/op/roi_align.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v3 { +/// \brief ROIAlign operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ROIAlign : public Op { public: OPENVINO_OP("ROIAlign", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/roi_pooling.hpp b/src/core/include/openvino/op/roi_pooling.hpp index 8b66f63c59d4bb..f90cda5a52477b 100644 --- a/src/core/include/openvino/op/roi_pooling.hpp +++ b/src/core/include/openvino/op/roi_pooling.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief ROIPooling operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ROIPooling : public Op { public: OPENVINO_OP("ROIPooling", "opset2"); diff --git a/src/core/include/openvino/op/roll.hpp b/src/core/include/openvino/op/roll.hpp index c8e018348d9bd9..99586a0c405ae5 100644 --- a/src/core/include/openvino/op/roll.hpp +++ b/src/core/include/openvino/op/roll.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v7 { /// \brief Tensor roll operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Roll : public Op { public: OPENVINO_OP("Roll", "opset7", op::Op, 7); diff --git a/src/core/include/openvino/op/round.hpp b/src/core/include/openvino/op/round.hpp index 154c7c5038b1fc..a8307145e80c8f 100644 --- a/src/core/include/openvino/op/round.hpp +++ b/src/core/include/openvino/op/round.hpp @@ -14,6 +14,7 @@ namespace v5 { /// 'HALF_TO_EVEN' - round halfs to the nearest even integer. /// 'HALF_AWAY_FROM_ZERO': - round in such a way that the result heads away from /// zero. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Round : public Op { public: enum class RoundMode { HALF_TO_EVEN, HALF_AWAY_FROM_ZERO }; diff --git a/src/core/include/openvino/op/scatter_elements_update.hpp b/src/core/include/openvino/op/scatter_elements_update.hpp index fd9f97adb3835f..e8c0e1f216b141 100644 --- a/src/core/include/openvino/op/scatter_elements_update.hpp +++ b/src/core/include/openvino/op/scatter_elements_update.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v3 { +/// \brief ScatterElementsUpdate operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ScatterElementsUpdate : public Op { public: OPENVINO_OP("ScatterElementsUpdate", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/scatter_nd_update.hpp b/src/core/include/openvino/op/scatter_nd_update.hpp index 19d4b0c5466eb6..f8b0ed49e50807 100644 --- a/src/core/include/openvino/op/scatter_nd_update.hpp +++ b/src/core/include/openvino/op/scatter_nd_update.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Add updates to slices from inputs addressed by indices +/// \ingroup ov_ops_cpp_api class OPENVINO_API ScatterNDUpdate : public util::ScatterNDBase { public: OPENVINO_OP("ScatterNDUpdate", "opset4", util::ScatterNDBase, 3); diff --git a/src/core/include/openvino/op/scatter_update.hpp b/src/core/include/openvino/op/scatter_update.hpp index 42f928eb52c583..1c0116bb83ca45 100644 --- a/src/core/include/openvino/op/scatter_update.hpp +++ b/src/core/include/openvino/op/scatter_update.hpp @@ -12,6 +12,7 @@ namespace v3 { /// /// \brief Set new values to slices from data addressed by indices /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API ScatterUpdate : public util::ScatterBase { public: OPENVINO_OP("ScatterUpdate", "opset3", util::ScatterBase, 3); diff --git a/src/core/include/openvino/op/select.hpp b/src/core/include/openvino/op/select.hpp index 5b92a9c25c8084..5406ea3bac61e6 100644 --- a/src/core/include/openvino/op/select.hpp +++ b/src/core/include/openvino/op/select.hpp @@ -26,6 +26,7 @@ namespace v1 { /// | Type | Description | /// | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | /// | \f$E[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \texttt{arg1}[i_1,\dots,i_n]\text{ if }\texttt{arg0}[i_1,\dots,i_n] \neq 0\text{, else }\texttt{arg2}[i_1,\dots,i_n]\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Select : public Op { public: diff --git a/src/core/include/openvino/op/selu.hpp b/src/core/include/openvino/op/selu.hpp index af6e61e97ca390..3a42987c4ce36f 100644 --- a/src/core/include/openvino/op/selu.hpp +++ b/src/core/include/openvino/op/selu.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Performs a SELU activation function on all elements of the input node +/// \ingroup ov_ops_cpp_api class OPENVINO_API Selu : public Op { public: OPENVINO_OP("Selu", "opset1"); diff --git a/src/core/include/openvino/op/shape_of.hpp b/src/core/include/openvino/op/shape_of.hpp index d12e6ebe50eada..6201411c9a0bee 100644 --- a/src/core/include/openvino/op/shape_of.hpp +++ b/src/core/include/openvino/op/shape_of.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v3 { /// \brief Operation that returns the shape of its input argument as a tensor. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ShapeOf : public Op { public: OPENVINO_OP("ShapeOf", "opset3", op::Op, 3); @@ -50,6 +51,7 @@ class OPENVINO_API ShapeOf : public Op { namespace v0 { /// \brief Operation that returns the shape of its input argument as a tensor. +/// \ingroup ov_ops_cpp_api class OPENVINO_API ShapeOf : public Op { public: OPENVINO_OP("ShapeOf", "opset1"); diff --git a/src/core/include/openvino/op/shuffle_channels.hpp b/src/core/include/openvino/op/shuffle_channels.hpp index af0b208942eab7..75173c1270bdc3 100644 --- a/src/core/include/openvino/op/shuffle_channels.hpp +++ b/src/core/include/openvino/op/shuffle_channels.hpp @@ -12,6 +12,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Permutes data in the channel dimension of the input +/// \ingroup ov_ops_cpp_api class OPENVINO_API ShuffleChannels : public Op { public: OPENVINO_OP("ShuffleChannels", "opset1"); diff --git a/src/core/include/openvino/op/sigmoid.hpp b/src/core/include/openvino/op/sigmoid.hpp index 1e7bbfb7376c25..428f256b0d6d69 100644 --- a/src/core/include/openvino/op/sigmoid.hpp +++ b/src/core/include/openvino/op/sigmoid.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief Sigmoid operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Sigmoid : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Sigmoid", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/sign.hpp b/src/core/include/openvino/op/sign.hpp index da4bbe4500fa89..abb8701635f63e 100644 --- a/src/core/include/openvino/op/sign.hpp +++ b/src/core/include/openvino/op/sign.hpp @@ -11,6 +11,7 @@ namespace op { namespace v0 { /// \brief Elementwise sign operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Sign : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Sign", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/sin.hpp b/src/core/include/openvino/op/sin.hpp index a1f39489519770..53a5372596679f 100644 --- a/src/core/include/openvino/op/sin.hpp +++ b/src/core/include/openvino/op/sin.hpp @@ -23,6 +23,7 @@ namespace v0 { /// | Type | Description | /// | ---------------------- | ------------------------------------------------------------------------------------ | /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \sin(\texttt{arg}[i_1,\dots,i_n])\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Sin : public util::UnaryElementwiseArithmetic { public: diff --git a/src/core/include/openvino/op/sinh.hpp b/src/core/include/openvino/op/sinh.hpp index 6d8571498f2593..f904c60bf9ec26 100644 --- a/src/core/include/openvino/op/sinh.hpp +++ b/src/core/include/openvino/op/sinh.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise hyperbolic sine (sinh) operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Sinh : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Sinh", "opset1", util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/sink.hpp b/src/core/include/openvino/op/sink.hpp index 948b1106a3a427..c467df62828f00 100644 --- a/src/core/include/openvino/op/sink.hpp +++ b/src/core/include/openvino/op/sink.hpp @@ -10,7 +10,8 @@ namespace ov { namespace op { -/// Root of nodes that can be sink nodes +/// \brief Root of nodes that can be sink nodes +/// \ingroup ov_ops_cpp_api class OPENVINO_API Sink : public Op { public: ~Sink() override = 0; diff --git a/src/core/include/openvino/op/slice.hpp b/src/core/include/openvino/op/slice.hpp index 2bcbec3f486707..c71cea1d36cbb0 100644 --- a/src/core/include/openvino/op/slice.hpp +++ b/src/core/include/openvino/op/slice.hpp @@ -11,6 +11,7 @@ namespace op { namespace v8 { /// \brief Slice operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Slice : public Op { public: OPENVINO_OP("Slice", "opset8"); diff --git a/src/core/include/openvino/op/softmax.hpp b/src/core/include/openvino/op/softmax.hpp index e8e617c361f791..f0f012bffff527 100644 --- a/src/core/include/openvino/op/softmax.hpp +++ b/src/core/include/openvino/op/softmax.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v1 { +/// \brief Softmax operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Softmax : public Op { public: OPENVINO_OP("Softmax", "opset1", op::Op, 1); @@ -48,6 +51,7 @@ class OPENVINO_API Softmax : public Op { namespace v8 { /// \brief Softmax operation with negative axis values +/// \ingroup ov_ops_cpp_api class OPENVINO_API Softmax : public Op { public: OPENVINO_OP("Softmax", "opset8"); diff --git a/src/core/include/openvino/op/softplus.hpp b/src/core/include/openvino/op/softplus.hpp index e76f6746b72ba5..aac74396debee9 100644 --- a/src/core/include/openvino/op/softplus.hpp +++ b/src/core/include/openvino/op/softplus.hpp @@ -12,6 +12,7 @@ namespace v4 { /// \brief A Self Regularized Non-Monotonic Neural Activation Function /// f(x) = ln(exp(x) + 1.) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API SoftPlus : public Op { public: OPENVINO_OP("SoftPlus", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/space_to_batch.hpp b/src/core/include/openvino/op/space_to_batch.hpp index da6ca9e83f14e5..715944b628107b 100644 --- a/src/core/include/openvino/op/space_to_batch.hpp +++ b/src/core/include/openvino/op/space_to_batch.hpp @@ -20,6 +20,7 @@ namespace v1 { /// (pads_begin[2] + D_2 + pads_end[2]) / block_shape[2], ..., /// (pads_begin[N - 1] + D_{N - 1} + pads_end[N - 1]) / block_shape[N - 1]` /// of the same type as `data` input. +/// \ingroup ov_ops_cpp_api class OPENVINO_API SpaceToBatch : public Op { public: OPENVINO_OP("SpaceToBatch", "opset2", op::Op, 1); diff --git a/src/core/include/openvino/op/space_to_depth.hpp b/src/core/include/openvino/op/space_to_depth.hpp index 01fb023e246ffb..ec57577f436e5f 100644 --- a/src/core/include/openvino/op/space_to_depth.hpp +++ b/src/core/include/openvino/op/space_to_depth.hpp @@ -16,6 +16,7 @@ namespace v0 { /// /// Output node produces a tensor with shape: /// [N, C * blocksize * blocksize, H / blocksize, W / blocksize] +/// \ingroup ov_ops_cpp_api class OPENVINO_API SpaceToDepth : public Op { public: OPENVINO_OP("SpaceToDepth", "opset1"); diff --git a/src/core/include/openvino/op/split.hpp b/src/core/include/openvino/op/split.hpp index 6f1ea2ce08bbac..ae376e66600069 100644 --- a/src/core/include/openvino/op/split.hpp +++ b/src/core/include/openvino/op/split.hpp @@ -14,6 +14,7 @@ namespace op { namespace v1 { /// \brief Splits the input tensor into a list of equal sized tensors +/// \ingroup ov_ops_cpp_api class OPENVINO_API Split : public Op { public: OPENVINO_OP("Split", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/sqrt.hpp b/src/core/include/openvino/op/sqrt.hpp index 30a0c319f4f093..c1433a3df1e68c 100644 --- a/src/core/include/openvino/op/sqrt.hpp +++ b/src/core/include/openvino/op/sqrt.hpp @@ -23,6 +23,7 @@ namespace v0 { /// | Type | Description | /// | ---------------------- | ------------------------------------------------------------------------------------- | /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \sqrt{\texttt{arg}[i_1,\dots,i_n]}\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Sqrt : public util::UnaryElementwiseArithmetic { public: diff --git a/src/core/include/openvino/op/squared_difference.hpp b/src/core/include/openvino/op/squared_difference.hpp index 2d61e30d8aa181..061aabb63e1671 100644 --- a/src/core/include/openvino/op/squared_difference.hpp +++ b/src/core/include/openvino/op/squared_difference.hpp @@ -12,6 +12,7 @@ namespace v0 { /// \brief Calculates an element-wise squared difference between two tensors /// /// y[i] = (x1[i] - x2[i])^2 +/// \ingroup ov_ops_cpp_api class OPENVINO_API SquaredDifference : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("SquaredDifference", "opset1", util::BinaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/squeeze.hpp b/src/core/include/openvino/op/squeeze.hpp index 5a51d18a278a5a..5445b6924136b8 100644 --- a/src/core/include/openvino/op/squeeze.hpp +++ b/src/core/include/openvino/op/squeeze.hpp @@ -9,6 +9,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief Squeeze operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Squeeze : public Op { public: OPENVINO_OP("Squeeze", "opset1"); diff --git a/src/core/include/openvino/op/strided_slice.hpp b/src/core/include/openvino/op/strided_slice.hpp index cb5b19cde088e6..daa69ce64ad38f 100644 --- a/src/core/include/openvino/op/strided_slice.hpp +++ b/src/core/include/openvino/op/strided_slice.hpp @@ -15,6 +15,7 @@ namespace op { namespace v1 { /// \brief Takes a slice of an input tensor, i.e., the sub-tensor that resides within a /// bounding box, optionally with stride. +/// \ingroup ov_ops_cpp_api class OPENVINO_API StridedSlice : public Op { public: OPENVINO_OP("StridedSlice", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/subtract.hpp b/src/core/include/openvino/op/subtract.hpp index 584cbcdcb035ac..ce48b9cd2093e7 100644 --- a/src/core/include/openvino/op/subtract.hpp +++ b/src/core/include/openvino/op/subtract.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Elementwise subtraction operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Subtract : public util::BinaryElementwiseArithmetic { public: OPENVINO_OP("Subtract", "opset1", util::BinaryElementwiseArithmetic, 1); diff --git a/src/core/include/openvino/op/swish.hpp b/src/core/include/openvino/op/swish.hpp index 92c3a97444467f..4d33513f548075 100644 --- a/src/core/include/openvino/op/swish.hpp +++ b/src/core/include/openvino/op/swish.hpp @@ -13,6 +13,7 @@ namespace v4 { /// f(x) = x / (1.0 + exp(-beta * x)) or /// f(x) = x * sigmoid(beta * x) /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Swish : public Op { public: OPENVINO_OP("Swish", "opset4", op::Op, 4); diff --git a/src/core/include/openvino/op/tan.hpp b/src/core/include/openvino/op/tan.hpp index 3e7457f52ad756..87240a2c4f77b0 100644 --- a/src/core/include/openvino/op/tan.hpp +++ b/src/core/include/openvino/op/tan.hpp @@ -23,6 +23,7 @@ namespace v0 { /// | Type | Description | /// | ---------------------- | ------------------------------------------------------------------------------------ | /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \tan(\texttt{arg}[i_1,\dots,i_n])\f$ | +/// \ingroup ov_ops_cpp_api // clang-format on class OPENVINO_API Tan : public util::UnaryElementwiseArithmetic { public: diff --git a/src/core/include/openvino/op/tanh.hpp b/src/core/include/openvino/op/tanh.hpp index c4606f631f3107..98564bd6b33e58 100644 --- a/src/core/include/openvino/op/tanh.hpp +++ b/src/core/include/openvino/op/tanh.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Elementwise hyperbolic tangent operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Tanh : public util::UnaryElementwiseArithmetic { public: OPENVINO_OP("Tanh", "opset1", op::util::UnaryElementwiseArithmetic); diff --git a/src/core/include/openvino/op/tensor_iterator.hpp b/src/core/include/openvino/op/tensor_iterator.hpp index a87f8712c97ca1..6fd7b25f7927bb 100644 --- a/src/core/include/openvino/op/tensor_iterator.hpp +++ b/src/core/include/openvino/op/tensor_iterator.hpp @@ -14,6 +14,7 @@ namespace ov { namespace op { namespace v0 { /// \brief Iterate a body over tensors, accumulating into tensors. +/// \ingroup ov_ops_cpp_api class OPENVINO_API TensorIterator : public op::util::SubGraphOp { public: OPENVINO_OP("TensorIterator", "opset1", op::util::SubGraphOp); diff --git a/src/core/include/openvino/op/tile.hpp b/src/core/include/openvino/op/tile.hpp index 48d30c9724ab8f..dcf31f9d1daf05 100644 --- a/src/core/include/openvino/op/tile.hpp +++ b/src/core/include/openvino/op/tile.hpp @@ -11,6 +11,7 @@ namespace op { namespace v0 { /// \brief Dynamic Tiling operation which repeats a tensor multiple times /// along each dimension +/// \ingroup ov_ops_cpp_api class OPENVINO_API Tile : public Op { public: OPENVINO_OP("Tile", "opset1"); diff --git a/src/core/include/openvino/op/topk.hpp b/src/core/include/openvino/op/topk.hpp index d815c1c915750b..90aee800224cd9 100644 --- a/src/core/include/openvino/op/topk.hpp +++ b/src/core/include/openvino/op/topk.hpp @@ -14,6 +14,7 @@ namespace op { namespace v1 { /// \brief Computes indices and values of the k maximum/minimum values /// for each slice along specified axis. +/// \ingroup ov_ops_cpp_api class OPENVINO_API TopK : public Op { public: OPENVINO_OP("TopK", "opset1", op::Op, 1); @@ -118,6 +119,7 @@ class OPENVINO_API TopK : public Op { namespace v3 { /// \brief Computes indices and values of the k maximum/minimum values /// for each slice along specified axis. +/// \ingroup ov_ops_cpp_api class OPENVINO_API TopK : public v1::TopK { public: OPENVINO_OP("TopK", "opset3", op::Op, 3); diff --git a/src/core/include/openvino/op/transpose.hpp b/src/core/include/openvino/op/transpose.hpp index e704828100251d..6ecf5cc986e539 100644 --- a/src/core/include/openvino/op/transpose.hpp +++ b/src/core/include/openvino/op/transpose.hpp @@ -10,6 +10,7 @@ namespace ov { namespace op { namespace v1 { /// \brief Tensor transpose operation. +/// \ingroup ov_ops_cpp_api class OPENVINO_API Transpose : public Op { public: OPENVINO_OP("Transpose", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/unsqueeze.hpp b/src/core/include/openvino/op/unsqueeze.hpp index b8f90521128aa3..6cc279b329c46c 100644 --- a/src/core/include/openvino/op/unsqueeze.hpp +++ b/src/core/include/openvino/op/unsqueeze.hpp @@ -11,6 +11,9 @@ namespace ov { namespace op { namespace v0 { +/// \brief Unsqueeze operation. +/// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Unsqueeze : public Op { public: OPENVINO_OP("Unsqueeze", "opset1"); diff --git a/src/core/include/openvino/op/variadic_split.hpp b/src/core/include/openvino/op/variadic_split.hpp index b8f38f2d6faca8..f17e81d7cdfe03 100644 --- a/src/core/include/openvino/op/variadic_split.hpp +++ b/src/core/include/openvino/op/variadic_split.hpp @@ -11,6 +11,7 @@ namespace op { namespace v1 { /// \brief VariadicSplit operation splits an input tensor into pieces along some axis. /// The pieces may have variadic lengths depending on "split_lengths" attribute. +/// \ingroup ov_ops_cpp_api class OPENVINO_API VariadicSplit : public Op { public: OPENVINO_OP("VariadicSplit", "opset1", op::Op, 1); diff --git a/src/core/include/openvino/op/xor.hpp b/src/core/include/openvino/op/xor.hpp index 095d2a7e44bd08..e248e76b74eaae 100644 --- a/src/core/include/openvino/op/xor.hpp +++ b/src/core/include/openvino/op/xor.hpp @@ -13,6 +13,7 @@ namespace op { namespace v0 { /// \brief Elementwise logical-xor operation. /// +/// \ingroup ov_ops_cpp_api class OPENVINO_API Xor : public util::BinaryElementwiseLogical { public: OPENVINO_OP("Xor", "opset1", util::BinaryElementwiseLogical); diff --git a/src/core/include/openvino/opsets/opset.hpp b/src/core/include/openvino/opsets/opset.hpp index a45b406ea71974..de2bc654ea7a90 100644 --- a/src/core/include/openvino/opsets/opset.hpp +++ b/src/core/include/openvino/opsets/opset.hpp @@ -16,7 +16,10 @@ #include "openvino/core/node.hpp" namespace ov { -/// \brief Run-time opset information +/** + * @brief Run-time opset information + * @ingroup ov_opset_cpp_api + */ class OPENVINO_API OpSet { static std::mutex& get_mutex(); @@ -128,12 +131,44 @@ class OPENVINO_API OpSet { } }; +/** + * @brief Returns opset1 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset1(); +/** + * @brief Returns opset2 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset2(); +/** + * @brief Returns opset3 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset3(); +/** + * @brief Returns opset4 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset4(); +/** + * @brief Returns opset5 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset5(); +/** + * @brief Returns opset6 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset6(); +/** + * @brief Returns opset7 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset7(); +/** + * @brief Returns opset8 + * @ingroup ov_opset_cpp_api + */ const OPENVINO_API OpSet& get_opset8(); } // namespace ov From 16237cc731d351280db88fbc23e8ecd6c52907cd Mon Sep 17 00:00:00 2001 From: Nikolay Tyukaev Date: Mon, 21 Mar 2022 18:39:47 +0300 Subject: [PATCH 9/9] DOCS: transition banner (#10973) * transition banner * minor fix * update transition banner * updates * update custom.js * updates * updates --- docs/_static/css/custom.css | 32 ++++++++++++++++++++++++++++++++ docs/_templates/layout.html | 10 ++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css index 763b9f7505b140..fd48b99c149b26 100644 --- a/docs/_static/css/custom.css +++ b/docs/_static/css/custom.css @@ -78,6 +78,38 @@ div.highlight { color: #fff; } +/* Transition banner */ +.transition-banner { + top: 60px; + background: #76CEFF; + position: fixed; + text-align: center; + color: white; + z-index: 1001; + display: block; + padding:0 2rem; + font-size: var(--pst-sidebar-font-size); + border: none; + border-radius: 0; + font-weight: bold; +} + +.transition-banner > p { + margin-bottom: 0; +} + +.transition-banner .close { + padding: 0 1.25rem; + color: #000; +} + + +@media (max-width: 720px) { + .transition-banner { + margin-top: 2rem; + } +} + @media (min-width: 1200px) { .container, .container-lg, .container-md, .container-sm, .container-xl { max-width: 1800px; diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index de7a83e8c19380..7ec0e82fc47663 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -14,3 +14,13 @@ {% endblock %} + +{% block docs_navbar %} +{{ super() }} + +{% endblock %}