Skip to content

Commit

Permalink
Merge branch 'master' into DOCS-adjustments-preparing-2025.0-pass-2
Browse files Browse the repository at this point in the history
  • Loading branch information
kblaszczak-intel authored Jan 17, 2025
2 parents b1050ab + 7a157e9 commit 5db8bf1
Show file tree
Hide file tree
Showing 628 changed files with 7,643 additions and 4,469 deletions.
2 changes: 1 addition & 1 deletion .github/dockerfiles/docker_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pr-28380
pr-28040
10 changes: 7 additions & 3 deletions .github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ RUN apt-get update && \
# For Java API
default-jdk \
# Compiler \
clang \
clang-15 \
# Static analyzer
clang-tidy-15 \
# clang-tidy uses clang-format as a dependency
clang-format-15 \
&& \
rm -rf /var/lib/apt/lists/*

Expand All @@ -47,8 +51,8 @@ RUN chmod +x /install_build_dependencies.sh && \
rm -rf /var/lib/apt/lists/*

# Set clang as a default compiler
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 100 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 100

# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
lfs: 'true'

- name: Install apt-get dependencies
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # v1.4.3
with:
packages: graphviz texlive liblua5.2-0 libclang1-9 libclang-cpp9
version: 3.0
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,17 @@ jobs:
# Build
#

- name: CMake configure - CC COLLECT
- name: CMake configure - CC COLLECT with clang-tidy
# clang-tidy static analysis check is enabled as part of collection
# to avoid an additional separate build execution
run: |
cmake \
-G "${{ env.CMAKE_GENERATOR }}" \
-DCMAKE_CXX_STANDARD=20 \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_TESTS=ON \
-DENABLE_CPPLINT=OFF \
-DENABLE_CLANG_TIDY=ON \
-DENABLE_NCC_STYLE=OFF \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DENABLE_PROFILING_ITT=ON \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ include(python_requirements)

include(cpplint/cpplint)
include(clang_format/clang_format)
include(clang_tidy/clang_tidy)
include(ncc_naming_style/ncc_naming_style)

# Restore state
Expand Down
25 changes: 25 additions & 0 deletions cmake/developer_package/clang_tidy/clang_tidy.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

if(ENABLE_CLANG_TIDY)
set(CLANG_TIDY_REQUIRED_VERSION 15 CACHE STRING "clang-tidy version to use")
set(CLANG_TIDY_FILENAME clang-tidy-${CLANG_TIDY_REQUIRED_VERSION} clang-tidy)
find_host_program(CLANG_TIDY NAMES ${CLANG_TIDY_FILENAME} PATHS ENV PATH)
if(CLANG_TIDY)
execute_process(COMMAND ${CLANG_TIDY} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
if(NOT CLANG_VERSION)
message(WARNING "Supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}!")
set(ENABLE_CLANG_TIDY OFF)
else()
string(REGEX REPLACE "[^0-9]+([0-9]+)\\..*" "\\1" CLANG_TIDY_MAJOR_VERSION ${CLANG_VERSION})
if(NOT CLANG_TIDY_MAJOR_VERSION EQUAL CLANG_TIDY_REQUIRED_VERSION)
message(WARNING "Supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}! Provided version ${CLANG_TIDY_MAJOR_VERSION}")
set(ENABLE_CLANG_TIDY OFF)
endif()
endif()
else()
message(WARNING "Supported clang-tidy-${CLANG_TIDY_REQUIRED_VERSION} is not found!")
set(ENABLE_CLANG_TIDY OFF)
endif()
endif()
2 changes: 2 additions & 0 deletions cmake/developer_package/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ ov_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of fail

ov_option (ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ${STYLE_CHECKS_DEFAULT})

ov_option (ENABLE_CLANG_TIDY "Enable clang-tidy checks during the build" ${STYLE_CHECKS_DEFAULT})

ov_option (ENABLE_NCC_STYLE "Enable ncc style check" ${STYLE_CHECKS_DEFAULT})

ov_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF)
Expand Down
9 changes: 8 additions & 1 deletion cmake/developer_package/plugins/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ endif()
# [SKIP_INSTALL]
# [SKIP_REGISTRATION] Skip creation of <device>.xml
# [ADD_CLANG_FORMAT]
# [ADD_CLANG_TIDY]
# )
#
function(ov_add_plugin)
set(options SKIP_INSTALL PSEUDO_DEVICE ADD_CLANG_FORMAT AS_EXTENSION SKIP_REGISTRATION)
set(options SKIP_INSTALL PSEUDO_DEVICE ADD_CLANG_FORMAT ADD_CLANG_TIDY AS_EXTENSION SKIP_REGISTRATION)
set(oneValueArgs NAME DEVICE_NAME VERSION_DEFINES_FOR PSEUDO_PLUGIN_FOR)
set(multiValueArgs DEFAULT_CONFIG SOURCES OBJECT_LIBRARIES CPPLINT_FILTERS)
cmake_parse_arguments(OV_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -105,6 +106,12 @@ function(ov_add_plugin)
string(CONCAT custom_filter "${custom_filter}" "," "${filter}")
endforeach()

if (OV_PLUGIN_ADD_CLANG_TIDY)
if (ENABLE_CLANG_TIDY)
set_target_properties(${OV_PLUGIN_NAME} PROPERTIES CXX_CLANG_TIDY clang-tidy-${CLANG_TIDY_REQUIRED_VERSION})
endif()
endif()

if (OV_PLUGIN_ADD_CLANG_FORMAT)
ov_add_clang_format_target(${OV_PLUGIN_NAME}_clang FOR_SOURCES ${OV_PLUGIN_SOURCES})
else()
Expand Down
1 change: 1 addition & 0 deletions cmake/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ macro(ov_cpack_settings)
2024.4.0
2024.5.0
2024.6.0
2025.0.0
)

ov_check_conflicts_versions(conflicting_versions)
Expand Down
1 change: 1 addition & 0 deletions cmake/packaging/rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ macro(ov_cpack_settings)
2024.4.0
2024.5.0
2024.6.0
2025.0.0
)

ov_check_conflicts_versions(conflicting_versions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ All parameters must be set before calling ``ov::Core::compile_model()`` in order
- ``ov::hint::num_request``
- ``ov::hint::scheduling_core_type``
- ``ov::hint::enable_hyper_threading``
- ``ov::hint::enable_cpu_reservation``
- ``ov::hint::enable_cpu_pinning``
- ``ov::num_streams``
- ``ov::inference_num_threads``
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pytest-timeout==2.3.1
# Python bindings
build<1.3
pygments>=2.8.1
setuptools>=70.1,<75.8
setuptools>=70.1,<75.9
sympy>=1.10
wheel>=0.38.1
patchelf<=0.17.2.1
Expand Down
56 changes: 28 additions & 28 deletions src/bindings/python/src/openvino/_ov_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def clone(self) -> "Model":
return Model(self.__model.clone())

def __copy__(self) -> "Model":
raise TypeError("Cannot copy 'openvino.runtime.Model'. Please, use deepcopy instead.")
raise TypeError("Cannot copy 'openvino.Model'. Please, use deepcopy instead.")

def __deepcopy__(self, memo: Dict) -> "Model":
"""Returns a deepcopy of Model.
:return: A copy of Model.
:rtype: openvino.runtime.Model
:rtype: openvino.Model
"""
return Model(self.__model.clone())

Expand Down Expand Up @@ -108,14 +108,14 @@ def infer(
(1) `int`
(2) `str`
(3) `openvino.runtime.ConstOutput`
(3) `openvino.ConstOutput`
The allowed types of values in the `inputs` are:
(1) `numpy.ndarray` and all the types that are castable to it, e.g. `torch.Tensor`
(2) `openvino.runtime.Tensor`
(2) `openvino.Tensor`
Can be called with only one `openvino.runtime.Tensor` or `numpy.ndarray`,
Can be called with only one `openvino.Tensor` or `numpy.ndarray`,
it will work only with one-input models. When model has more inputs,
function throws error.
Expand Down Expand Up @@ -190,14 +190,14 @@ def start_async(
(1) `int`
(2) `str`
(3) `openvino.runtime.ConstOutput`
(3) `openvino.ConstOutput`
The allowed types of values in the `inputs` are:
(1) `numpy.ndarray` and all the types that are castable to it, e.g. `torch.Tensor`
(2) `openvino.runtime.Tensor`
(2) `openvino.Tensor`
Can be called with only one `openvino.runtime.Tensor` or `numpy.ndarray`,
Can be called with only one `openvino.Tensor` or `numpy.ndarray`,
it will work only with one-input models. When model has more inputs,
function throws error.
Expand Down Expand Up @@ -241,7 +241,7 @@ def get_compiled_model(self) -> "CompiledModel":
"""Gets the compiled model this InferRequest is using.
:return: a CompiledModel object
:rtype: openvino.runtime.ie_api.CompiledModel
:rtype: openvino.CompiledModel
"""
return CompiledModel(super().get_compiled_model())

Expand All @@ -250,7 +250,7 @@ def results(self) -> OVDict:
"""Gets all outputs tensors of this InferRequest.
:return: Dictionary of results from output tensors with ports as keys.
:rtype: Dict[openvino.runtime.ConstOutput, numpy.array]
:rtype: Dict[openvino.ConstOutput, numpy.array]
"""
return OVDict(super().results)

Expand All @@ -277,15 +277,15 @@ def create_infer_request(self) -> InferRequest:
The created request has allocated input and output tensors.
:return: New InferRequest object.
:rtype: openvino.runtime.InferRequest
:rtype: openvino.InferRequest
"""
return InferRequest(super().create_infer_request())

def query_state(self) -> None:
"""Gets state control interface for the underlaying infer request.
:return: List of VariableState objects.
:rtype: List[openvino.runtime.VariableState]
:rtype: List[openvino.VariableState]
"""
if self._infer_request is None:
self._infer_request = self.create_infer_request()
Expand Down Expand Up @@ -316,14 +316,14 @@ def infer_new_request(self, inputs: Any = None) -> OVDict:
(1) `int`
(2) `str`
(3) `openvino.runtime.ConstOutput`
(3) `openvino.ConstOutput`
The allowed types of values in the `inputs` are:
(1) `numpy.ndarray` and all the types that are castable to it, e.g. `torch.Tensor`
(2) `openvino.runtime.Tensor`
(2) `openvino.Tensor`
Can be called with only one `openvino.runtime.Tensor` or `numpy.ndarray`,
Can be called with only one `openvino.Tensor` or `numpy.ndarray`,
it will work only with one-input models. When model has more inputs,
function throws error.
Expand Down Expand Up @@ -361,14 +361,14 @@ def __call__(
(1) `int`
(2) `str`
(3) `openvino.runtime.ConstOutput`
(3) `openvino.ConstOutput`
The allowed types of values in the `inputs` are:
(1) `numpy.ndarray` and all the types that are castable to it, e.g. `torch.Tensor`
(2) `openvino.runtime.Tensor`
(2) `openvino.Tensor`
Can be called with only one `openvino.runtime.Tensor` or `numpy.ndarray`,
Can be called with only one `openvino.Tensor` or `numpy.ndarray`,
it will work only with one-input models. When model has more inputs,
function throws error.
Expand Down Expand Up @@ -448,7 +448,7 @@ def __iter__(self) -> Iterable[InferRequest]:
will put the parent AsyncInferQueue object in an invalid state.
:return: a generator that yields InferRequests.
:rtype: Iterable[openvino.runtime.InferRequest]
:rtype: Iterable[openvino.InferRequest]
"""
return (InferRequest(x) for x in super().__iter__())

Expand All @@ -462,7 +462,7 @@ def __getitem__(self, i: int) -> InferRequest:
:param i: InferRequest id.
:type i: int
:return: InferRequests from the pool with given id.
:rtype: openvino.runtime.InferRequest
:rtype: openvino.InferRequest
"""
return InferRequest(super().__getitem__(i))

Expand All @@ -478,14 +478,14 @@ def start_async(
(1) `int`
(2) `str`
(3) `openvino.runtime.ConstOutput`
(3) `openvino.ConstOutput`
The allowed types of values in the `inputs` are:
(1) `numpy.ndarray` and all the types that are castable to it, e.g. `torch.Tensor`
(2) `openvino.runtime.Tensor`
(2) `openvino.Tensor`
Can be called with only one `openvino.runtime.Tensor` or `numpy.ndarray`,
Can be called with only one `openvino.Tensor` or `numpy.ndarray`,
it will work only with one-input models. When model has more inputs,
function throws error.
Expand Down Expand Up @@ -574,7 +574,7 @@ def compile_model(
:param model: Model acquired from read_model function or a path to a model in IR / ONNX / PDPD /
TF and TFLite format.
:type model: Union[openvino.runtime.Model, str, pathlib.Path]
:type model: Union[openvino.Model, str, pathlib.Path]
:param device_name: Optional. Name of the device to load the model to. If not specified,
the default OpenVINO device will be selected by AUTO plugin.
:type device_name: str
Expand All @@ -584,7 +584,7 @@ def compile_model(
:param weights: Optional. Weights of model in memory to be loaded to the model.
:type weights: bytes, optional, keyword-only
:return: A compiled model.
:rtype: openvino.runtime.CompiledModel
:rtype: openvino.CompiledModel
"""
if isinstance(model, Model):
model = model._Model__model
Expand Down Expand Up @@ -635,7 +635,7 @@ def import_model(
(property name, property value) relevant only for this load operation.
:type config: dict, optional
:return: A compiled model.
:rtype: openvino.runtime.CompiledModel
:rtype: openvino.CompiledModel
:Example:
Expand Down Expand Up @@ -680,15 +680,15 @@ def compile_model(
:param model: Model acquired from read_model function or a path to a model in IR / ONNX / PDPD /
TF and TFLite format.
:type model: Union[openvino.runtime.Model, str, pathlib.Path]
:type model: Union[openvino.Model, str, pathlib.Path]
:param device_name: Optional. Name of the device to load the model to. If not specified,
the default OpenVINO device will be selected by AUTO plugin.
:type device_name: str
:param config: Optional dict of pairs:
(property name, property value) relevant only for this load operation.
:type config: dict, optional
:return: A compiled model.
:rtype: openvino.runtime.CompiledModel
:rtype: openvino.CompiledModel
"""
core = Core()
Expand Down
6 changes: 3 additions & 3 deletions src/bindings/python/src/openvino/helpers/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def pack_data(array: np.ndarray, type: Type) -> np.ndarray:
:param array: numpy array with values to pack.
:type array: numpy array
:param type: Type to interpret the array values. Type must be u1, u4, i4, nf4 or f4e2m1.
:type type: openvino.runtime.Type
:type type: openvino.Type
"""
assert type in [Type.u1, Type.u4, Type.i4, Type.nf4, Type.f4e2m1], "Packing algorithm for the" "data types stored in 1, 2 or 4 bits"

Expand Down Expand Up @@ -58,9 +58,9 @@ def unpack_data(array: np.ndarray, type: Type, shape: Union[list, Shape]) -> np.
:param array: numpy array to unpack.
:type array: numpy array
:param type: Type to extract from array values. Type must be u1, u4, i4, nf4 or f4e2m1.
:type type: openvino.runtime.Type
:type type: openvino.Type
:param shape: the new shape for the unpacked array.
:type shape: Union[list, openvino.runtime.Shape]
:type shape: Union[list, openvino.Shape]
"""
assert type in [Type.u1, Type.u4, Type.i4, Type.nf4, Type.f4e2m1], "Unpacking algorithm for the" "data types stored in 1, 2 or 4 bits"
unpacked = np.unpackbits(array.view(np.uint8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OVDict(Mapping):
This class is a dict-like object. It provides possibility to
address data tensors with three key types:
* `openvino.runtime.ConstOutput` - port of the output
* `openvino.ConstOutput` - port of the output
* `int` - index of the output
* `str` - names of the output
Expand Down
Loading

0 comments on commit 5db8bf1

Please sign in to comment.