Skip to content

Commit

Permalink
Run test only on newer drivers
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Pereanu <[email protected]>
  • Loading branch information
pereanub committed Jan 29, 2025
1 parent 7b48343 commit b4a4c54
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest,
::testing::ValuesIn(configsInferRequestRunTests)),
InferRequestRunTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest,
InferRunTestsOnNewerDrivers,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(configsInferRequestRunTests)),
InferRequestRunTests::getTestCaseName);

const std::vector<ov::AnyMap> batchingConfigs = {
{ov::log::level(ov::log::Level::WARNING), ov::intel_npu::batch_mode(ov::intel_npu::BatchMode::PLUGIN)},
{ov::log::level(ov::log::Level::WARNING), ov::intel_npu::batch_mode(ov::intel_npu::BatchMode::COMPILER)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,36 +170,6 @@ TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsSyncInfers) {
}
}

TEST_P(InferRequestRunTests, MultipleCompiledModelsTestsSyncInfers) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Load CNNNetwork to target plugins
const int no_of_iterations = 256;
std::array<ov::CompiledModel, no_of_iterations> compiled_models;

for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(compiled_models[i] = core->compile_model(ov_model, target_device, configuration));
}

// Create InferRequests
std::array<ov::InferRequest, no_of_iterations> infer_reqs;
std::array<std::thread, no_of_iterations> infer_reqs_threads;
for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(infer_reqs[i] = compiled_models[i].create_infer_request());
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i] = std::thread([&infer_reqs, i]() -> void {
OV_ASSERT_NO_THROW(infer_reqs[i].infer());
infer_reqs[i] = {};
});
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i].join();
}
}

TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsAsyncInfers) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
Expand Down Expand Up @@ -1091,6 +1061,38 @@ TEST_P(SetShapeInferRunTests, checkResultsAfterStateTensorsReallocation) {
}
}

using InferRunTestsOnNewerDrivers = InferRequestRunTests;

TEST_P(InferRunTestsOnNewerDrivers, MultipleCompiledModelsTestsSyncInfers) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Load CNNNetwork to target plugins
const int no_of_iterations = 256;
std::array<ov::CompiledModel, no_of_iterations> compiled_models;

for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(compiled_models[i] = core->compile_model(ov_model, target_device, configuration));
}

// Create InferRequests
std::array<ov::InferRequest, no_of_iterations> infer_reqs;
std::array<std::thread, no_of_iterations> infer_reqs_threads;
for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(infer_reqs[i] = compiled_models[i].create_infer_request());
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i] = std::thread([&infer_reqs, i]() -> void {
OV_ASSERT_NO_THROW(infer_reqs[i].infer());
infer_reqs[i] = {};
});
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i].join();
}
}

} // namespace behavior
} // namespace test
} // namespace ov

0 comments on commit b4a4c54

Please sign in to comment.