Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 037f9f2

Browse files
committedFeb 12, 2025
Merge branch 'releases/2023/3' of https://github.com/openvinotoolkit/openvino into releases/2023/3
Signed-off-by: Alina Kladieva <alina.kladieva@intel.com>
2 parents e5f19de + e417f6d commit 037f9f2

File tree

30 files changed

+196
-69
lines changed

30 files changed

+196
-69
lines changed
 

‎.github/workflows/code_snippets.yml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
packages: ocl-icd-opencl-dev opencl-headers
3737
version: 3.0
3838

39+
- name: Install scons
40+
if: runner.os == 'macOS'
41+
run: brew install scons
42+
3943
- name: CMake configure
4044
run: cmake -DCMAKE_BUILD_TYPE=Release -DTHREADING=SEQ -B build
4145

‎.github/workflows/fedora.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
shell: bash
4545
runs-on: aks-linux-16-cores-32gb
4646
container:
47-
image: fedora:33
47+
image: openvinogithubactions.azurecr.io/dockerio/library/fedora:33
4848
volumes:
4949
- /mount:/mount
5050
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
@@ -196,9 +196,9 @@ jobs:
196196
defaults:
197197
run:
198198
shell: bash
199-
runs-on: ubuntu-20.04
199+
runs-on: aks-linux-2-cores-8gb
200200
container:
201-
image: fedora:33
201+
image: openvinogithubactions.azurecr.io/dockerio/library/fedora:33
202202
env:
203203
RPM_PACKAGES_DIR: /__w/openvino/packages/
204204

‎.github/workflows/job_python_unit_tests.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ jobs:
306306
path: ${{ env.OPENVINO_REPO }}
307307
submodules: 'false'
308308

309-
- name: Docs Python snippets
310-
if: runner.os != 'macOS'
311-
run: |
312-
# to find 'snippets' module in docs
313-
export PYTHONPATH=${OPENVINO_REPO}/docs
314-
# for 'template' extension
315-
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH
316-
python3 ${OPENVINO_REPO}/docs/snippets/main.py
309+
# - name: Docs Python snippets
310+
# if: runner.os != 'macOS'
311+
# run: |
312+
# # to find 'snippets' module in docs
313+
# export PYTHONPATH=${OPENVINO_REPO}/docs
314+
# # for 'template' extension
315+
# export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH
316+
# python3 ${OPENVINO_REPO}/docs/snippets/main.py
317317

318318
- name: Upload Test Results
319319
uses: actions/upload-artifact@v3

‎.github/workflows/webassembly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
shell: bash
4444
runs-on: aks-linux-16-cores-32gb
4545
container:
46-
image: emscripten/emsdk
46+
image: openvinogithubactions.azurecr.io/dockerio/emscripten/emsdk:3.1.61
4747
volumes:
4848
- /mount:/mount
4949
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING

‎cmake/developer_package/api_validator/api_validator.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
#
44

55
if(WIN32)
6+
# CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION is only set when
7+
# Visual Studio generators are used, but we need it
8+
# when we use Ninja as well
9+
if(NOT DEFINED CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
10+
if(DEFINED ENV{WindowsSDKVersion})
11+
string(REPLACE "\\" "" WINDOWS_SDK_VERSION $ENV{WindowsSDKVersion})
12+
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VERSION})
13+
message(STATUS "Use ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} Windows SDK version")
14+
else()
15+
message(FATAL_ERROR "WindowsSDKVersion environment variable is not set,\
16+
can't find Windows SDK version. Try to use vcvarsall.bat script")
17+
endif()
18+
endif()
19+
620
set(PROGRAMFILES_ENV "ProgramFiles\(X86\)")
721

822
# check that PROGRAMFILES_ENV is defined, because in case of cross-compilation for Windows

‎cmake/developer_package/compile_flags/sdl.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR
4848
endif()
4949
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
5050
set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} /sdl /guard:cf")
51+
set(OV_LINKER_FLAGS "${OV_LINKER_FLAGS} /guard:cf")
5152
endif()
5253

5354
if(ENABLE_QSPECTRE)

‎docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ def create_sitemap(app, exception):
7575
namespace, values = entry
7676
namespace_element = ET.SubElement(url, namespace)
7777
for tag_name, tag_value in values.items():
78-
ET.SubElement(namespace_element, tag_name).text = tag_value
78+
if tag_name == 'ovcategory':
79+
ET.SubElement(namespace_element, tag_name).text = 'No category'
80+
elif tag_name == 'ovversion':
81+
ET.SubElement(namespace_element, tag_name).text = tag_value
7982

8083
if len(app.locales) > 0:
8184
for lang in app.locales:

‎docs/sphinx_setup/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
'.md': 'markdown',
5757
}
5858

59-
html_baseurl = ''
59+
# html_baseurl = 'https://docs.openvino.ai/'
6060

6161
# -- Sitemap configuration ---------------------------
6262

@@ -73,6 +73,7 @@
7373
ov_sitemap_meta = [
7474
('coveo:metadata', {
7575
'ovversion': version_name,
76+
'ovcategory': 'null'
7677
})
7778
]
7879

‎src/bindings/python/constraints.txt

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pytest-html==4.1.1
88
pytest-timeout==2.2.0
99

1010
# Python bindings
11-
py>=1.9.0
1211
pygments>=2.8.1
1312
setuptools>=65.6.1
1413
sympy>=1.10

‎src/bindings/python/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
numpy>=1.16.6
1+
numpy>=1.16.6,<2.0.0
22
singledispatchmethod; python_version<'3.8'
33
openvino-telemetry>=2023.2.1

‎src/bindings/python/requirements_test.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ pytest-forked; sys_platform != 'win32'
3232
pytest-xdist
3333
pytest-html
3434
pytest
35-
py
3635
radon
3736
retrying
3837
tox
39-
types-pkg_resources
38+
types-setuptools
4039
wheel
4140
singledispatchmethod
4241
torch

‎src/bindings/python/wheel/CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@
88

99
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import wheel.vendored.packaging.tags as tags ; print(f'{tags.interpreter_name()}{tags.interpreter_version()}')"
1010
OUTPUT_VARIABLE PYTHON_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
11-
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import wheel.bdist_wheel ; print(f'{wheel.bdist_wheel.get_abi_tag()}')"
11+
if(NOT PYTHON_TAG)
12+
message(FATAL_ERROR "Failed to detect Python Tag via wheel.vendored.packaging.tags. Please, check 'wheel' dependency version update")
13+
endif()
14+
15+
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from setuptools.command.bdist_wheel import get_abi_tag; print(f'{get_abi_tag()}')"
1216
OUTPUT_VARIABLE ABI_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
17+
if(NOT ABI_TAG)
18+
message(FATAL_ERROR "Failed to detect ABI Tag via setuptools.command.bdist_wheel. Please, check 'setuptools' dependency version update")
19+
endif()
20+
1321
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import wheel.vendored.packaging.tags as tags ; print(f'{next(tags.platform_tags())}')"
1422
OUTPUT_VARIABLE PLATFORM_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
23+
if(NOT PLATFORM_TAG)
24+
message(FATAL_ERROR "Failed to detect Platform Tag via wheel.vendored.packaging.tags. Please, check 'wheel' dependency version update")
25+
endif()
1526

1627
# defines wheel architecture part of `PLATFORM_TAG`
1728
macro(_ov_platform_arch)
@@ -24,7 +35,7 @@ macro(_ov_platform_arch)
2435
elseif(UNIVERSAL2)
2536
set(_arch "universal2")
2637
elseif(ARM)
27-
set(_arch "armvl7")
38+
set(_arch "armv7l")
2839
elseif(X86_64)
2940
set(_arch "x86_64")
3041
elseif(X86)

‎src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp

+26-25
Original file line numberDiff line numberDiff line change
@@ -177,35 +177,36 @@ bool Transformations::fuse_type_to_convert(const std::shared_ptr<ov::Node>& node
177177
return false;
178178
const auto& to = it->second;
179179

180-
// For Convert node, converting precision from floating point to boolean will lead to mathematical
181-
// error, because here the output precision boolean is replaced by u8. E.g. floating point value 0.01
182-
// is converted to be 1 for boolean, but 0 for u8. Thus an Abs and Ceil node should be added before the
183-
// Convert node for this scenario.
184-
if (convert->input(0).get_element_type().is_real() &&
185-
convert->get_convert_element_type() == ov::element::boolean && to.is_integral_number()) {
186-
const auto& in_prec = node->get_input_element_type(0);
180+
if (convert->get_convert_element_type() == ov::element::boolean && to.is_integral_number()) {
181+
// For Convert node, converting precision from numerical data types to boolean will lead to mathematical
182+
// error, because here the output precision boolean is replaced by u8:
183+
// - floating point value 0.01 is converted to be 1 for boolean, but 0 for u8 - need to insert Ceil.
184+
// - either float or int values should be clipped with the interval [0; 1] to mimic bool cast behavior, i.e.
185+
// 0 - is false, 1 - is true
186+
// - to perform clamping correctly an Abs op should be inserted before Clamp
187+
// Thus an Abs, Ceil and Clamp nodes should be added before the Convert node for this scenario.
188+
ov::pass::NodeRegistry reg;
189+
const auto& in_prec = convert->get_input_element_type(0);
190+
auto parent_node = convert->input_value(0).get_node_shared_ptr();
187191
auto item = precisions.find(in_prec);
188192
if (item != precisions.end()) {
189-
// Add convert node for unsupported precision, such as FP64
190-
auto pre_convert =
191-
std::make_shared<ov::opset10::Convert>(convert->input_value(0).get_node_shared_ptr(), item->second);
192-
auto abs = std::make_shared<ov::opset10::Abs>(pre_convert);
193-
auto ceil = std::make_shared<ov::opset10::Ceiling>(abs);
194-
auto new_convert = std::make_shared<ov::opset10::Convert>(ceil, to);
195-
new_convert->set_friendly_name(convert->get_friendly_name());
196-
ov::copy_runtime_info(convert, {pre_convert, abs, ceil, new_convert});
197-
ov::replace_node(convert, new_convert);
198-
} else {
199-
auto abs = std::make_shared<ov::opset10::Abs>(convert->input_value(0).get_node_shared_ptr());
200-
auto ceil = std::make_shared<ov::opset10::Ceiling>(abs);
201-
auto new_convert = std::make_shared<ov::opset10::Convert>(ceil, to);
202-
new_convert->set_friendly_name(convert->get_friendly_name());
203-
ov::copy_runtime_info(convert, {abs, ceil, new_convert});
204-
ov::replace_node(convert, new_convert);
193+
// Add convert node for unsupported precision, such as FP64 or INT64
194+
parent_node = reg.make<ov::opset10::Convert>(parent_node, item->second);
205195
}
206-
} else {
207-
convert->set_convert_element_type(to);
196+
if (in_prec.is_signed()) {
197+
parent_node = reg.make<ov::opset10::Abs>(parent_node);
198+
}
199+
if (in_prec.is_real()) {
200+
parent_node = reg.make<ov::opset10::Ceiling>(parent_node);
201+
}
202+
parent_node = reg.make<ov::opset10::Clamp>(parent_node, 0, 1);
203+
const auto new_convert = reg.make<ov::opset10::Convert>(parent_node, to);
204+
new_convert->set_friendly_name(convert->get_friendly_name());
205+
ov::copy_runtime_info(convert, reg.get());
206+
ov::replace_node(convert, new_convert);
207+
return true;
208208
}
209+
convert->set_convert_element_type(to);
209210
return true;
210211
}
211212

‎src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp

+89
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,99 @@ void LayerTestsCommon::Compare(const std::vector<std::pair<ngraph::element::Type
172172
}
173173
}
174174

175+
inline void callCompareBool(const std::pair<ngraph::element::Type, std::vector<std::uint8_t>> &expected,
176+
const uint8_t* actualBuffer, size_t size, float threshold, float abs_threshold) {
177+
auto expectedBuffer = expected.second.data();
178+
#define CASE(X) \
179+
case X: { \
180+
auto typedExpectedBuffer = reinterpret_cast<const ov::element_type_traits<X>::value_type*>(expectedBuffer); \
181+
for (size_t i = 0; i < size; ++i) { \
182+
ASSERT_EQ(static_cast<bool>(actualBuffer[i]), static_cast<bool>(typedExpectedBuffer[i])) << \
183+
"Comparison of bool values failed at index: " << i << " expected value: " << \
184+
(static_cast<bool>(expectedBuffer[i]) ? "True" : "False") << \
185+
" and actual value: " << \
186+
(static_cast<bool>(actualBuffer[i]) ? "True" : "False"); \
187+
} \
188+
break; \
189+
}
190+
191+
switch (expected.first) {
192+
CASE(ngraph::element::Type_t::boolean)
193+
CASE(ngraph::element::Type_t::u8)
194+
CASE(ngraph::element::Type_t::i8)
195+
CASE(ngraph::element::Type_t::u16)
196+
CASE(ngraph::element::Type_t::i16)
197+
CASE(ngraph::element::Type_t::u32)
198+
CASE(ngraph::element::Type_t::i32)
199+
CASE(ngraph::element::Type_t::u64)
200+
CASE(ngraph::element::Type_t::i64)
201+
CASE(ngraph::element::Type_t::bf16)
202+
CASE(ngraph::element::Type_t::f16)
203+
CASE(ngraph::element::Type_t::f32)
204+
CASE(ngraph::element::Type_t::f64)
205+
case ngraph::element::Type_t::i4: {
206+
auto expectedOut = ngraph::helpers::convertOutputPrecision(
207+
expected.second,
208+
expected.first,
209+
ngraph::element::Type_t::i8,
210+
size);
211+
for (size_t i = 0; i < size; ++i) {
212+
ASSERT_EQ(static_cast<bool>(actualBuffer[i]), static_cast<bool>(expectedOut[i])) <<
213+
"Comparison of bool values failed at index: " << i << " expected value: " <<
214+
(static_cast<bool>(expectedOut[i]) ? "True" : "False") <<
215+
" and actual value: " <<
216+
(static_cast<bool>(actualBuffer[i]) ? "True" : "False");
217+
}
218+
break;
219+
}
220+
case ngraph::element::Type_t::u4: {
221+
auto expectedOut = ngraph::helpers::convertOutputPrecision(
222+
expected.second,
223+
expected.first,
224+
ngraph::element::Type_t::u8,
225+
size);
226+
for (size_t i = 0; i < size; ++i) {
227+
ASSERT_EQ(static_cast<bool>(actualBuffer[i]), static_cast<bool>(expectedOut[i])) <<
228+
"Comparison of bool values failed at index: " << i << " expected value: " <<
229+
(static_cast<bool>(expectedOut[i]) ? "True" : "False") <<
230+
" and actual value: " <<
231+
(static_cast<bool>(actualBuffer[i]) ? "True" : "False");
232+
}
233+
break;
234+
}
235+
case ngraph::element::Type_t::dynamic:
236+
case ngraph::element::Type_t::undefined: {
237+
auto typedExpectedBuffer = reinterpret_cast<const uint8_t*>(expectedBuffer);
238+
for (size_t i = 0; i < size; ++i) {
239+
ASSERT_EQ(static_cast<bool>(actualBuffer[i]), static_cast<bool>(typedExpectedBuffer[i])) <<
240+
"Comparison of bool values failed at index: " << i << " expected value: " <<
241+
(static_cast<bool>(typedExpectedBuffer[i]) ? "True" : "False") <<
242+
" and actual value: " <<
243+
(static_cast<bool>(actualBuffer[i]) ? "True" : "False");
244+
}
245+
break;
246+
}
247+
default:
248+
FAIL() << "Comparator for " << expected.first << " precision isn't supported";
249+
}
250+
#undef CASE
251+
return;
252+
}
253+
175254
template <typename T_IE>
176255
inline void callCompare(const std::pair<ngraph::element::Type, std::vector<std::uint8_t>> &expected,
177256
const T_IE* actualBuffer, size_t size, float threshold, float abs_threshold) {
178257
auto expectedBuffer = expected.second.data();
179258
switch (expected.first) {
180259
case ngraph::element::Type_t::boolean:
260+
for (size_t i = 0; i < size; ++i) {
261+
ASSERT_EQ(static_cast<bool>(actualBuffer[i]), static_cast<bool>(expectedBuffer[i])) <<
262+
"Comparison of bool values failed at index: " << i << " expected value: " <<
263+
(static_cast<bool>(expectedBuffer[i]) ? "True" : "False") <<
264+
" and actual value: " <<
265+
(static_cast<bool>(actualBuffer[i]) ? "True" : "False");
266+
}
267+
break;
181268
case ngraph::element::Type_t::u8:
182269
LayerTestsCommon::Compare<T_IE, uint8_t>(reinterpret_cast<const uint8_t *>(expectedBuffer),
183270
actualBuffer, size, threshold, abs_threshold);
@@ -277,6 +364,8 @@ void LayerTestsCommon::Compare(const std::pair<ngraph::element::Type, std::vecto
277364
const auto &size = actual->size();
278365
switch (precision) {
279366
case InferenceEngine::Precision::BOOL:
367+
callCompareBool(expected, reinterpret_cast<const uint8_t *>(actualBuffer), size, threshold, abs_threshold);
368+
break;
280369
case InferenceEngine::Precision::U8:
281370
callCompare<uint8_t>(expected, reinterpret_cast<const uint8_t *>(actualBuffer), size, threshold, abs_threshold);
282371
break;

‎src/tests/ov_helpers/ov_models/src/utils/ov_helpers.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ LowPrecistionRange<4, int8_t> cast_to(uint8_t* data) {
395395
template <element::Type_t FromType, element::Type_t ToType>
396396
std::vector<std::uint8_t> convertPrecision(const std::vector<std::uint8_t>& buffer, const size_t elementsCount) {
397397
using fromPrec = fundamental_type_for<FromType>;
398-
using toPrec = fundamental_type_for<ToType>;
398+
using dstType = fundamental_type_for<ToType>;
399+
using toPrec = typename std::conditional<element::boolean == ToType, bool, dstType>::type;
399400

400401
const size_t min_buffer_size = [&] {
401402
element::Type from_type(FromType);
@@ -407,7 +408,7 @@ std::vector<std::uint8_t> convertPrecision(const std::vector<std::uint8_t>& buff
407408

408409
OPENVINO_ASSERT(buffer.size() >= min_buffer_size, "avoid buffer overflow");
409410

410-
constexpr auto elementSize = sizeof(toPrec);
411+
constexpr auto elementSize = sizeof(dstType);
411412
std::vector<std::uint8_t> convertedData(elementsCount * elementSize);
412413

413414
auto src = cast_to<FromType>(buffer.data());

‎tests/constraints.txt

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ pytest-timeout==2.1.0
2525
jax<=0.4.14
2626
jaxlib<=0.4.14
2727
torch>=1.13,<2.2
28+
super-image==0.1.7
29+
# huggingface-hub required for super-image
30+
huggingface-hub==0.25.2

‎tests/model_hub_tests/torch_tests/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ torchaudio
2222
torchvision
2323
transformers
2424
wheel
25+
# huggingface-hub required for super-image
26+
huggingface-hub

‎tools/benchmark_tool/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-c ../constraints.txt
2-
numpy>=1.16.6
2+
numpy>=1.16.6,<2.0.0

‎tools/constraints.txt

-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ astroid>=2.9.0
1616
pylint>=2.7.0
1717
pyenchant>=3.0.0
1818
test-generator==0.1.1
19-
py>=1.9.0
2019
urllib3>=1.26.4
2120
openvino-telemetry>=2023.2.1

0 commit comments

Comments
 (0)
Please sign in to comment.