Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class BatchedTensorsRunTests : public ov::test::behavior::OVPluginTestBase,
std::shared_ptr<ov::Core> core = utils::PluginCache::get().core();
ov::AnyMap configuration;
std::shared_ptr<ov::Model> ov_model;
ov::CompiledModel compiled_model;
ov::Output<const ov::Node> input;
ov::Output<const ov::Node> output;
std::string m_cache_dir;
Expand Down Expand Up @@ -85,7 +84,7 @@ class BatchedTensorsRunTests : public ov::test::behavior::OVPluginTestBase,
core->set_property({ov::cache_dir()});
core.reset();
ov::test::utils::PluginCache::get().reset();
ov::test::utils::removeFilesWithExt(m_cache_dir, "blob");
ov::test::utils::removeFilesWithExt<opt::FORCE>(m_cache_dir, "blob");
ov::test::utils::removeDir(m_cache_dir);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class InferRequestRunTests : public ov::test::behavior::OVPluginTestBase,
std::shared_ptr<ov::Core> core = utils::PluginCache::get().core();
ov::AnyMap configuration;
std::shared_ptr<ov::Model> ov_model;
ov::CompiledModel compiled_model;
ov::Output<const ov::Node> input;
ov::Output<const ov::Node> output;
std::string m_cache_dir;
Expand Down Expand Up @@ -92,8 +91,8 @@ class InferRequestRunTests : public ov::test::behavior::OVPluginTestBase,
core->set_property({ov::cache_dir()});
core.reset();
ov::test::utils::PluginCache::get().reset();
ov::test::utils::removeFilesWithExt(m_cache_dir, "blob");
ov::test::utils::removeDir(m_cache_dir);
auto test = ov::test::utils::removeFilesWithExt<opt::FORCE>(m_cache_dir, "blob");
auto test1 = ov::test::utils::removeDir(m_cache_dir);
}

if (!configuration.empty()) {
Expand Down Expand Up @@ -137,7 +136,8 @@ TEST_P(InferRequestRunTests, AllocatorCanDisposeBlobWhenOnlyInferRequestIsInScop

TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsSyncInfers) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();
// Load CNNNetwork to target plugins
ov::CompiledModel compiled_model;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
OV_ASSERT_NO_THROW(input = compiled_model.input());
OV_ASSERT_NO_THROW(output = compiled_model.output());
Expand Down Expand Up @@ -165,7 +165,8 @@ TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsSyncInfers) {

TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsAsyncInfers) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();
// Load CNNNetwork to target plugins
ov::CompiledModel compiled_model;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
OV_ASSERT_NO_THROW(input = compiled_model.input());
OV_ASSERT_NO_THROW(output = compiled_model.output());
Expand All @@ -189,7 +190,8 @@ TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsAsyncInfers) {

TEST_P(InferRequestRunTests, MultipleExecutorTestsSyncInfers) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();
// Load CNNNetwork to target plugins
ov::CompiledModel compiled_model;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
OV_ASSERT_NO_THROW(input = compiled_model.input());
OV_ASSERT_NO_THROW(output = compiled_model.output());
Expand All @@ -209,6 +211,7 @@ TEST_P(InferRequestRunTests, MultipleExecutorTestsSyncInfers) {
TEST_P(InferRequestRunTests, CheckOutputDataFromTwoRuns) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;
ov::InferRequest inference_request;
ov::Tensor first_output;
ov::Tensor second_output;
Expand Down Expand Up @@ -253,6 +256,7 @@ TEST_P(InferRequestRunTests, CheckOutputDataFromTwoRuns) {
TEST_P(InferRequestRunTests, CheckOutputDataFromMultipleRunsUsingSameL0Tensor) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;
ov::InferRequest inference_request;
ov::Tensor first_output;
ov::Tensor second_output;
Expand Down Expand Up @@ -288,6 +292,7 @@ TEST_P(InferRequestRunTests, CheckOutputDataFromMultipleRunsUsingSameL0Tensor) {
TEST_P(InferRequestRunTests, RecreateL0TensorIfNeeded) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;
ov::InferRequest inference_request;
ov::Tensor first_output;
ov::Tensor second_output;
Expand Down Expand Up @@ -336,6 +341,8 @@ using RandomTensorOverZeroTensorRunTests = InferRequestRunTests;
TEST_P(RandomTensorOverZeroTensorRunTests, SetRandomTensorOverZeroTensor0) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;

auto shape = Shape{1, 2, 2, 2};
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");
Expand Down Expand Up @@ -381,6 +388,8 @@ TEST_P(RandomTensorOverZeroTensorRunTests, SetRandomTensorOverZeroTensor0) {
TEST_P(RandomTensorOverZeroTensorRunTests, SetRandomTensorOverZeroTensor1) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;

auto shape = Shape{1, 2, 2, 2};
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");
Expand Down Expand Up @@ -443,6 +452,8 @@ using BatchingRunTests = InferRequestRunTests;
TEST_P(BatchingRunTests, CheckBatchingSupportInfer) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;

ov::InferRequest inference_request;
auto batch_shape = Shape{4, 2, 32, 32};
std::shared_ptr<ov::Model> ov_model_batch = createModel(element::f32, batch_shape, "N...");
Expand All @@ -455,6 +466,7 @@ TEST_P(BatchingRunTests, CheckBatchingSupportInfer) {
TEST_P(BatchingRunTests, CheckBatchingSupportAsync) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;
ov::InferRequest inference_request;
auto batch_shape = Shape{4, 2, 32, 32};
std::shared_ptr<ov::Model> ov_model_batch = createModel(element::f32, batch_shape, "N...");
Expand All @@ -468,6 +480,8 @@ TEST_P(BatchingRunTests, CheckBatchingSupportAsync) {
TEST_P(BatchingRunTests, UseCompilerBatchingErrorPluginBatching) {
SKIP_IF_CURRENT_TEST_IS_DISABLED();

ov::CompiledModel compiled_model;

ov::InferRequest inference_request;
std::shared_ptr<ov::Model> ov_model_batch = getDefaultNGraphFunctionForTheDeviceNPU({4, 2, 32, 32});

Expand All @@ -490,6 +504,8 @@ TEST_P(BatchingRunTests, SetInputTensorInfer) {
auto model = createModel(element::f32, batch_shape, "N...");
float* buffer = new float[shape_size];

ov::CompiledModel compiled_model;

compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();
Expand All @@ -516,6 +532,8 @@ TEST_P(BatchingRunTests, SetInputTensorAsync) {
auto model = createModel(element::f32, batch_shape, "N...");
float* buffer = new float[shape_size];

ov::CompiledModel compiled_model;

compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();
Expand Down Expand Up @@ -543,6 +561,8 @@ TEST_P(BatchingRunTests, SetInputTensorInfer_Caching) {
auto model = createModel(element::f32, batch_shape, "N...");
float* buffer = new float[shape_size];

ov::CompiledModel compiled_model;

m_cache_dir = generateCacheDirName(GetTestName());
core->set_property({ov::cache_dir(m_cache_dir)});
auto compiled_model_no_cache = core->compile_model(model, target_device, configuration);
Expand Down Expand Up @@ -574,6 +594,8 @@ TEST_P(BatchingRunTests, CheckTwoRunsInfer) {
auto model = createModel(element::f32, batch_shape, "N...");
float* buffer = new float[shape_size];

ov::CompiledModel compiled_model;

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
Expand Down Expand Up @@ -622,6 +644,8 @@ TEST_P(RunSeqTests, CheckMultipleRunsSeq0) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

ov::CompiledModel compiled_model;

auto context = core->get_default_context(target_device);

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
Expand Down Expand Up @@ -679,6 +703,8 @@ TEST_P(RunSeqTests, CheckMultipleRunsSeq1) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

ov::CompiledModel compiled_model;

auto context = core->get_default_context(target_device);

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
Expand Down Expand Up @@ -737,6 +763,8 @@ TEST_P(RunSeqTests, CheckMultipleRunsSeq2) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

ov::CompiledModel compiled_model;

auto context = core->get_default_context(target_device);

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
Expand Down Expand Up @@ -805,6 +833,8 @@ TEST_P(RunSeqTests, CheckMultipleRunsSeq3) {
auto shape = Shape{1, 64, 64, 256};
auto model = createModel(element::f32, shape, "N...");

ov::CompiledModel compiled_model;

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
configuration[ov::intel_npu::tiles.name()] = 2;
compiled_model = core->compile_model(model, target_device, configuration);
Expand All @@ -819,6 +849,8 @@ TEST_P(RunSeqTests, CheckMultipleRunsSeq3) {
TEST_P(RunSeqTests, CheckMultipleRunsSeq4) {
auto supportedProperties = core->get_property("NPU", supported_properties.name()).as<std::vector<PropertyName>>();

ov::CompiledModel compiled_model;

bool isRunInferencesSequentially =
std::any_of(supportedProperties.begin(), supportedProperties.end(), [](const PropertyName& property) {
return property == intel_npu::run_inferences_sequentially.name();
Expand Down Expand Up @@ -920,6 +952,8 @@ TEST_P(RunSeqTests, CheckTurboWithMultipleRunsSeq) {

auto context = core->get_default_context(target_device);

ov::CompiledModel compiled_model;

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
configuration[intel_npu::turbo.name()] = true;
configuration[ov::intel_npu::tiles.name()] = 2;
Expand Down Expand Up @@ -981,6 +1015,8 @@ TEST_P(BatchingRunSeqTests, CheckMultipleBatchingRunsSeq) {

auto context = core->get_default_context(target_device);

ov::CompiledModel compiled_model;

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
configuration[ov::intel_npu::tiles.name()] = 2;
compiled_model = core->compile_model(model, target_device, configuration);
Expand Down Expand Up @@ -1042,7 +1078,7 @@ TEST_P(DynamicBatchingTests, DynamicCheckMultipleBatchingRun0) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

ov::InferRequest inference_request;
ov::Tensor input_tensor;
Expand Down Expand Up @@ -1107,7 +1143,7 @@ TEST_P(DynamicBatchingTests, DynamicCheckMultipleBatchingRun1) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

ov::InferRequest inference_request;
ov::Tensor input_tensor;
Expand Down Expand Up @@ -1170,7 +1206,7 @@ TEST_P(DynamicBatchingTests, DynamicCheckMultipleBatchingRun2) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, modelShape, "N...");

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

ov::InferRequest inference_request;
ov::Tensor input_tensor;
Expand Down Expand Up @@ -1209,7 +1245,7 @@ TEST_P(DynamicBatchingTests, DynamicCheckMultipleBatchingRunsSeq) {

configuration[ov::intel_npu::run_inferences_sequentially.name()] = true;
configuration[ov::intel_npu::tiles.name()] = 2;
compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

const uint32_t inferences = 32;
std::array<ov::InferRequest, inferences> inference_request;
Expand Down Expand Up @@ -1284,7 +1320,7 @@ TEST_P(SetShapeInferRunTests, checkResultsAfterIOBlobReallocation) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();

Expand Down Expand Up @@ -1354,7 +1390,7 @@ TEST_P(SetShapeInferRunTests, checkResultsAfterStateTensorsReallocation) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();

Expand Down Expand Up @@ -1448,6 +1484,7 @@ TEST_P(CpuVaTensorsTests, DontDestroyImportedMemory) {
ov::Tensor second_output;
ov::Tensor global_input;
float* data;
ov::CompiledModel compiled_model;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
OV_ASSERT_NO_THROW(inference_request = compiled_model.create_infer_request());
Expand Down Expand Up @@ -1494,7 +1531,7 @@ TEST_P(CpuVaTensorsTests, SetMultiplePageAllignedTensors) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

const int inferences = 32;
ov::InferRequest inference_request;
Expand Down Expand Up @@ -1559,7 +1596,7 @@ TEST_P(CpuVaTensorsTests, SetMultipleAllignedAndNotAllignedTensors) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

const int inferences = 32;
ov::InferRequest inference_request;
Expand Down Expand Up @@ -1632,7 +1669,7 @@ TEST_P(CpuVaTensorsTests, SetMultipleRemoteAllignedAndNotAllignedTensors) {
auto model = createModel(element::f32, shape, "N...");

auto context = core->get_default_context(target_device);
compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);

const int inferences = 32;
ov::InferRequest inference_request;
Expand Down Expand Up @@ -1712,7 +1749,7 @@ TEST_P(CpuVaTensorsTests, SetAndDestroyDifferentAlignedTensors) {
auto shape_size = ov::shape_size(shape);
auto model = createModel(element::f32, shape, "N...");

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request0, inference_request1;

const auto input_byte_size = shape_size * sizeof(float);
Expand Down Expand Up @@ -1773,7 +1810,7 @@ TEST_P(CpuVaTensorsTests, checkResultsAfterStateTensorsUseImportCpuVa0) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();

Expand Down Expand Up @@ -1864,7 +1901,7 @@ TEST_P(CpuVaTensorsTests, checkResultsAfterStateTensorsUseImportCpuVa1) {

auto context = core->get_default_context(target_device);

compiled_model = core->compile_model(model, target_device, configuration);
ov::CompiledModel compiled_model = core->compile_model(model, target_device, configuration);
ov::InferRequest inference_request;
inference_request = compiled_model.create_infer_request();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TEST_P(OVCompileModelLoadFromFileTestBaseNPU, BlobWithOVHeaderAligmentCanBeImpor
if (i != 0) {
configuration.emplace(ov::log::level(ov::log::Level::DEBUG));
}
core->compile_model(m_modelName, targetDevice, configuration);
std::ignore = core->compile_model(m_modelName, targetDevice, configuration);
configuration.erase(ov::log::level.name());
}
ov::util::reset_log_callback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class DmaBufRemoteRunTests : public ov::test::behavior::OVPluginTestBase,
std::shared_ptr<ov::Core> core = utils::PluginCache::get().core();
ov::AnyMap configuration;
std::shared_ptr<ov::Model> ov_model;
ov::CompiledModel compiled_model;
int _fd_dma_heap = -1;

public:
Expand Down Expand Up @@ -115,6 +114,7 @@ class DmaBufRemoteRunTests : public ov::test::behavior::OVPluginTestBase,
TEST_P(DmaBufRemoteRunTests, CheckRemoteTensorSharedBuf) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::CompiledModel compiled_model;
ov::InferRequest inference_request;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
Expand Down Expand Up @@ -147,6 +147,7 @@ TEST_P(DmaBufRemoteRunTests, CheckRemoteTensorSharedBuf) {
TEST_P(DmaBufRemoteRunTests, CheckRemoteTensorSharedBuChangingTensors) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::CompiledModel compiled_model;
ov::InferRequest inference_request;

OV_ASSERT_NO_THROW(compiled_model = core->compile_model(ov_model, target_device, configuration));
Expand Down Expand Up @@ -201,6 +202,7 @@ TEST_P(DmaBufRemoteRunTests, CheckOutputDataFromMultipleRuns) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()

ov::CompiledModel compiled_model;
ov::InferRequest inference_request;
float* data;

Expand Down
Loading
Loading