Skip to content

Commit

Permalink
Merge branch 'master' into remove-legacy-infer-auto-pad
Browse files Browse the repository at this point in the history
  • Loading branch information
praasz authored Jan 12, 2024
2 parents 15b33a1 + b042992 commit 21b7faa
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 92 deletions.
7 changes: 6 additions & 1 deletion .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
# For opencv-python: python3-setuptools and pip upgrade
python3 -m pip install --upgrade pip
python3 -m pip install -r $(OPENVINO_REPO_DIR)/src/bindings/python/wheel/requirements-dev.txt
python3 -m pip install -r $(OPENVINO_REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
# Speed up build
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
unzip ninja-linux.zip
Expand Down Expand Up @@ -166,6 +165,7 @@ jobs:
displayName: 'Java tests'
- script: |
set -e
python3 -m pip install --user virtualenv
python3 -m virtualenv -p /usr/bin/python3.8 .env3
source .env3/bin/activate && source $(SETUPVARS)
Expand All @@ -176,6 +176,7 @@ jobs:
displayName: 'Create virtual env'
- script: |
set -e
source $(WORK_DIR)/.env3/bin/activate
# need to enable sparse_conv tests with new Open3D release
python -m pytest -k "not sparse_conv" tests/run_tests.py
Expand All @@ -185,6 +186,7 @@ jobs:
displayName: 'Custom user operation tests'
- script: |
set -e
source $(WORK_DIR)/.env3/bin/activate && source $(SETUPVARS)
python -m pip install build
python -m build --wheel --outdir $(BUILD_WHEEL_DIR) $(REPO_DIR)/modules/custom_operations
Expand All @@ -198,6 +200,7 @@ jobs:
artifact: Wheels

- script: |
set -e
source $(WORK_DIR)/.env3/bin/activate
# Find and install wheel
pushd $(BUILD_WHEEL_DIR)
Expand All @@ -208,12 +211,14 @@ jobs:
displayName: 'Install tokenizers wheel'
- script: |
set -e
source $(WORK_DIR)/.env3/bin/activate
bandit -c pyproject.toml -r user_ie_extensions/tokenizer/python/
workingDirectory: $(REPO_DIR)/modules/custom_operations
displayName: 'Tokenizers Bandit Check'
- script: |
set -e
source $(WORK_DIR)/.env3/bin/activate
python -m pytest tokenizers_test.py
continueOnError: true
Expand Down
1 change: 1 addition & 0 deletions .ci/azure/linux_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
displayName: 'Install dependencies'
- script: >
set -e
sudo docker pull openvino.azurecr.io/openvino_ci/cuda-ubuntu2004:2022.1 &&
sudo docker run --volume $(REPO_DIR)/../:/root/repos --volume $(WORK_DIR):/root/w
openvino.azurecr.io/openvino_ci/cuda-ubuntu2004:2022.1
Expand Down
9 changes: 8 additions & 1 deletion .ci/azure/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
displayName: 'System info'
- script: |
set -e
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
displayName: 'Make dir'
Expand All @@ -107,6 +108,7 @@ jobs:
path: testdata

- script: |
set -e
brew install cython
brew install automake
# for ARM compute
Expand All @@ -116,11 +118,11 @@ jobs:
# install python wheel dependencies
python3.10 -m pip install --upgrade pip
python3.10 -m pip install -r $(OPENVINO_REPO_DIR)/src/bindings/python/wheel/requirements-dev.txt
python3.10 -m pip install -r $(OPENVINO_REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
workingDirectory: $(WORK_DIR)
displayName: 'Install dependencies'
- script: |
set -e
export PATH="/usr/local/opt/cython/bin:$PATH"
cmake -GNinja \
-DVERBOSE_BUILD=ON \
Expand Down Expand Up @@ -154,6 +156,7 @@ jobs:
displayName: 'List install files'

- script: |
set -e
. $(SETUPVARS) gradle clean build --info
for d in CPU HETERO:CPU; do
gradle test -Prun_tests -DMODELS_PATH=$(MODELS_PATH) -Ddevice=$d --info;
Expand All @@ -163,6 +166,7 @@ jobs:
condition: eq(variables['CMAKE_OSX_ARCHITECTURES'], 'x86_64')
- script: |
set -e
python3 -m venv venv
source venv/bin/activate && source $(SETUPVARS)
python -m pip install --upgrade pip
Expand All @@ -176,6 +180,7 @@ jobs:
displayName: 'Create virtual env'
- script: |
set -e
source $(WORK_DIR)/venv/bin/activate && source $(SETUPVARS)
python -m pip install build
python -m build --wheel --outdir $(BUILD_WHEEL_DIR) $(REPO_DIR)/modules/custom_operations
Expand All @@ -186,6 +191,7 @@ jobs:
artifact: Wheels

- script: |
set -e
source $(WORK_DIR)/venv/bin/activate
# Find and install wheel
pushd $(BUILD_WHEEL_DIR)
Expand All @@ -196,6 +202,7 @@ jobs:
displayName: 'Install tokenizers wheel'
- script: |
set -e
source $(WORK_DIR)/venv/bin/activate
python -m pytest tokenizers_test.py
continueOnError: true
Expand Down
1 change: 0 additions & 1 deletion .ci/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ jobs:
powershell -command "Expand-Archive -Force gradle-$(GRADLE_VER)-bin.zip"
call $(SETUPVARS) -pyver 3.8
$(PYTHON_EXE) -m pip install --upgrade pip
$(PYTHON_EXE) -m pip install -r $(OPENVINO_REPO_DIR)\src\bindings\python\src\compatibility\openvino\requirements-dev.txt
$(PYTHON_EXE) -m pip install -r $(OPENVINO_REPO_DIR)\src\bindings\python\wheel\requirements-dev.txt
powershell -command "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
choco install opencv -y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "complex_mul.hpp"
#include <openvino/core/parallel.hpp>
#include <ie_common.h>

using namespace TemplateExtension;

Expand Down
6 changes: 2 additions & 4 deletions modules/custom_operations/user_ie_extensions/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

#include "fft.hpp"

#include <ie_common.h>
#include <openvino/core/parallel.hpp>
#include <details/ie_so_loader.h>
#include <opencv2/core/core_c.h>

using namespace TemplateExtension;
Expand Down Expand Up @@ -132,7 +130,7 @@ bool FFT::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) co
float* inpData = reinterpret_cast<float*>(inputs[0].data());

if (inputs[1].get_element_type() != ov::element::i32)
IE_THROW() << "Unexpected dims type: " << inputs[1].get_element_type();
OPENVINO_THROW("Unexpected dims type: " + inputs[1].get_element_type().to_string());

int32_t* signalDimsData = reinterpret_cast<int32_t*>(inputs[1].data());
float* outData = reinterpret_cast<float*>(outputs[0].data());
Expand All @@ -147,7 +145,7 @@ bool FFT::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) co
std::ostringstream ss;
for (size_t i = 0; i < numSignalDims; ++i)
ss << signalDimsData[i] << " ";
IE_THROW() << "Unsupported configuration: Input dims " << dims.size() << " and signal dims " << ss.str();
OPENVINO_THROW("Unsupported configuration: Input dims " + std::to_string(dims.size()) + " and signal dims " + ss.str());
}

const int batch = dims[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ else()
URL_HASH SHA256=1ae8ccfdb1066a731bba6ee0881baad5efd2cd661acd9569b689f2586e1a50e9
)
FetchContent_MakeAvailable(re2)
set_property(DIRECTORY ${re2_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
elseif(LINUX AND X86_64)
FetchContent_Declare(
fast_tokenizer
Expand Down Expand Up @@ -172,7 +173,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_OPTIONS "${extra_flags}"
#

set_property(DIRECTORY ${sentencepiece_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
set_property(DIRECTORY ${re2_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)

if(BUILD_FAST_TOKENIZERS)
install(TARGETS core_tokenizers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void SentencepieceTokenizer::validate_and_infer_types() {
FRONT_END_GENERAL_CHECK(get_input_element_type(0) == element::u8, "SentencepieceTokenizer accepts sp model as the first input and it should be of type u8 tensor");

FRONT_END_GENERAL_CHECK(
get_input_element_type(1) == element::string || get_input_element_type(1) == element::u8,
// WA: sometimes f32 appeared as a placeholder for unknown type
get_input_element_type(1) == element::u8 || get_input_element_type(1) == element::string || get_input_element_type(1) == element::f32,
"SentencepieceTokenizer accepts sentences as the second input and it should be of type string tensor");

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void StringTensorUnpack::validate_and_infer_types() {
if (m_mode == "begins_ends") {
set_string_output(this, 0, output_shape);
} else {
OPENVINO_THROW(m_mode == "begins_ends", "StringTensorUnpack supporst only 'begins_ends' mode, but get " + m_mode);
OPENVINO_ASSERT(m_mode == "begins_ends", "StringTensorUnpack supporst only 'begins_ends' mode, but get " + m_mode);
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/nvidia_plugin/src/ops/mvn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

#include "mvn.hpp"

#include "openvino/core/shape_util.hpp"
#include "openvino/core/type.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/mvn.hpp"
#include "ngraph/shape_util.hpp"

#include <cuda/descriptor_utils.hpp>
#include <cuda_operation_registry.hpp>
Expand Down Expand Up @@ -224,7 +224,7 @@ ov::Shape MvnOp::makeReducedShape(const ov::Node& node) {
}
axes.emplace(static_cast<size_t>((v + size) % size));
}
reducedShape = ngraph::reduce(reducedShape, axes, true);
reducedShape = ov::util::reduce_keep_dims(reducedShape, axes);
if (reducedShape == node.get_input_shape(0)) return {};
return reducedShape;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <common_test_utils/test_constants.hpp>
#include <cuda_test_constants.hpp>

#include "behavior/ov_executable_network/exec_graph_info.hpp"
#include "behavior/compiled_model/import_export.hpp"

using namespace ov::test::behavior;
namespace {
Expand All @@ -20,24 +20,24 @@ const std::vector<ov::AnyMap> multiConfigs = {{ov::device::priorities(ov::test::
const std::vector<ov::AnyMap> heteroConfigs = {{ov::device::priorities(ov::test::utils::DEVICE_NVIDIA)}};

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVExecGraphImportExportTest,
OVCompiledGraphImportExportTest,
::testing::Combine(::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::utils::DEVICE_NVIDIA),
::testing::ValuesIn(configs)),
OVExecGraphImportExportTest::getTestCaseName);
OVCompiledGraphImportExportTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests,
OVExecGraphImportExportTest,
OVCompiledGraphImportExportTest,
::testing::Combine(::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::utils::DEVICE_AUTO),
::testing::ValuesIn(multiConfigs)),
OVExecGraphImportExportTest::getTestCaseName);
OVCompiledGraphImportExportTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVExecGraphImportExportTest,
OVCompiledGraphImportExportTest,
::testing::Combine(::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::utils::DEVICE_HETERO),
::testing::ValuesIn(heteroConfigs)),
OVExecGraphImportExportTest::getTestCaseName);
OVCompiledGraphImportExportTest::getTestCaseName);

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "behavior/ov_executable_network/properties.hpp"
#include "behavior/compiled_model/properties.hpp"

#include <cuda_test_constants.hpp>

Expand Down Expand Up @@ -36,34 +36,34 @@ const std::vector<ov::AnyMap> auto_batch_inproperties = {
};

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVCompiledModelPropertiesIncorrectTests,
OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NVIDIA),
::testing::ValuesIn(inproperties)),
OVCompiledModelPropertiesIncorrectTests::getTestCaseName);
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVCompiledModelPropertiesIncorrectTests,
OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_HETERO),
::testing::ValuesIn(hetero_inproperties)),
OVCompiledModelPropertiesIncorrectTests::getTestCaseName);
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests,
OVCompiledModelPropertiesIncorrectTests,
OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI),
::testing::ValuesIn(multi_inproperties)),
OVCompiledModelPropertiesIncorrectTests::getTestCaseName);
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests,
OVCompiledModelPropertiesIncorrectTests,
OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO),
::testing::ValuesIn(auto_inproperties)),
OVCompiledModelPropertiesIncorrectTests::getTestCaseName);
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_AutoBatch_BehaviorTests,
OVCompiledModelPropertiesIncorrectTests,
OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_BATCH),
::testing::ValuesIn(auto_batch_inproperties)),
OVCompiledModelPropertiesIncorrectTests::getTestCaseName);
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

const std::vector<ov::AnyMap> default_properties = {{ov::num_streams(1)},
{ov::hint::num_requests(0)},
Expand All @@ -75,10 +75,15 @@ const std::vector<ov::AnyMap> default_properties = {{ov::num_streams(1)},
{ov::nvidia_gpu::use_cuda_graph(true)}};

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVCompiledModelPropertiesDefaultTests,
OVCompiledModelPropertiesDefaultSupportedTests,
::testing::Values(ov::test::utils::DEVICE_NVIDIA),
OVCompiledModelPropertiesDefaultSupportedTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVClassCompiledModelPropertiesDefaultTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NVIDIA),
::testing::ValuesIn(default_properties)),
OVCompiledModelPropertiesDefaultTests::getTestCaseName);
OVClassCompiledModelPropertiesDefaultTests::getTestCaseName);

const std::vector<ov::AnyMap> properties = {
{ov::num_streams(8)},
Expand Down Expand Up @@ -114,26 +119,26 @@ const std::vector<ov::AnyMap> auto_batch_properties = {
};

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVCompiledModelPropertiesTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NVIDIA),
::testing::ValuesIn(properties)),
OVCompiledModelPropertiesTests::getTestCaseName);
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVCompiledModelPropertiesTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_HETERO),
::testing::ValuesIn(hetero_properties)),
OVCompiledModelPropertiesTests::getTestCaseName);
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests,
OVCompiledModelPropertiesTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI),
::testing::ValuesIn(multi_properties)),
OVCompiledModelPropertiesTests::getTestCaseName);
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_AutoBatch_BehaviorTests,
OVCompiledModelPropertiesTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_BATCH),
::testing::ValuesIn(auto_batch_properties)),
OVCompiledModelPropertiesTests::getTestCaseName);
OVClassCompiledModelPropertiesTests::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
::testing::ValuesIn(HeteroConfigs)),
OVInferenceChaining::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVInferenceChainingStatic,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NVIDIA),
::testing::ValuesIn(configs)),
OVInferenceChainingStatic::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVInferenceChainingStatic,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_HETERO),
::testing::ValuesIn(HeteroConfigs)),
OVInferenceChainingStatic::getTestCaseName);

} // namespace
Loading

0 comments on commit 21b7faa

Please sign in to comment.