forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework auto test cases (openvinotoolkit#19862)
* initial commit Signed-off-by: fishbell <[email protected]> * clean up Signed-off-by: fishbell <[email protected]> * fix windows build failure Signed-off-by: fishbell <[email protected]> * enable auto func tests Signed-off-by: fishbell <[email protected]> * enable auto_func_test to ci Signed-off-by: fishbell <[email protected]> * some clean up in gpu case Signed-off-by: fishbell <[email protected]> * clang Signed-off-by: fishbell <[email protected]> * fix build warning Signed-off-by: fishbell <[email protected]> * enable new tests Signed-off-by: fishbell <[email protected]> * fix build warning Signed-off-by: fishbell <[email protected]> * enable consistency test Signed-off-by: fishbell <[email protected]> * try fix build error on manylinux Signed-off-by: fishbell <[email protected]> * enable cpplint Signed-off-by: fishbell <[email protected]> * enable clang-format Signed-off-by: fishbell <[email protected]> enable some tests Signed-off-by: fishbell <[email protected]> * fix typo Signed-off-by: fishbell <[email protected]> * clang for unit tests Signed-off-by: fishbell <[email protected]> * fix merge conflict Signed-off-by: fishbell <[email protected]> --------- Signed-off-by: fishbell <[email protected]>
- Loading branch information
Showing
143 changed files
with
5,065 additions
and
3,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (C) 2018-2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set(TARGET_NAME ov_auto_func_tests) | ||
|
||
if(ENABLE_AUTO_BATCH) | ||
list(APPEND DEPENDENCIES openvino_auto_batch_plugin) | ||
list(APPEND COMPILE_DEFINITIONS ENABLE_AUTO_BATCH) | ||
endif() | ||
|
||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
ie_add_compiler_flags(/wd4305) | ||
endif() | ||
|
||
ov_add_test_target( | ||
NAME ${TARGET_NAME} | ||
ROOT ${CMAKE_CURRENT_SOURCE_DIR} | ||
LINK_LIBRARIES | ||
openvino::runtime::dev | ||
gtest | ||
gtest_main | ||
openvino::funcSharedTests | ||
INCLUDES | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${TEST_COMMON_INCLUDE_DIR} | ||
ADD_CLANG_FORMAT | ||
LABELS | ||
Multi | ||
Auto | ||
) | ||
|
||
target_compile_definitions(${TARGET_NAME} PRIVATE ${COMPILE_DEFINITIONS}) | ||
set_ie_threading_interface_for(${TARGET_NAME}) |
97 changes: 97 additions & 0 deletions
97
src/plugins/auto/tests/functional/behavior/async_compiled_for_multiple_device_test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "auto_func_test.hpp" | ||
#ifdef __GLIBC__ | ||
# include <gnu/libc-version.h> | ||
# if __GLIBC_MINOR__ >= 34 | ||
# define ENABLETESTTHREADING | ||
# endif | ||
#endif | ||
|
||
using namespace ov::auto_plugin::tests; | ||
|
||
#ifdef ENABLETESTTHREADING | ||
TEST_F(AutoFuncTests, can_compile_with_multiple_devices) { | ||
ov::CompiledModel compiled_model; | ||
ASSERT_NO_THROW(compiled_model = | ||
core.compile_model(model_can_batch, "AUTO", {ov::device::priorities("MOCK_GPU", "MOCK_CPU")})); | ||
compiled_model = core.compile_model(model_can_batch, | ||
"AUTO", | ||
{ov::device::priorities("MOCK_GPU", "MOCK_CPU"), | ||
ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}); | ||
} | ||
|
||
TEST_F(AutoFuncTests, threading_test) { | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, "AUTO", {ov::device::priorities("MOCK_GPU", "MOCK_CPU")}); | ||
}, | ||
10, | ||
10); | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, | ||
"AUTO", | ||
{ov::device::priorities("MOCK_GPU", "MOCK_CPU"), | ||
ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}); | ||
}, | ||
10, | ||
10); | ||
} | ||
|
||
TEST_F(AutoFuncTests, threading_test_cache_enabled) { | ||
core.set_property(ov::cache_dir(cache_path)); | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, | ||
"AUTO", | ||
{ov::device::priorities("MOCK_GPU", "MOCK_CPU"), | ||
ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT)}); | ||
}, | ||
10, | ||
10); | ||
core.set_property(ov::cache_dir("")); | ||
} | ||
|
||
TEST_F(AutoFuncTests, threading_test_get_version) { | ||
ThreadingTest::runParallel([&]() { | ||
auto versions = core.get_versions("AUTO"); | ||
ASSERT_LE(1u, versions.size()); | ||
}); | ||
} | ||
|
||
TEST_F(AutoFuncTests, theading_compiled_with_cpu_help) { | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, "AUTO", {ov::device::priorities("MOCK_GPU", "MOCK_CPU")}); | ||
}, | ||
10, | ||
10); | ||
} | ||
|
||
TEST_F(AutoFuncTests, threading_test_hardware_slower) { | ||
core.compile_model(model_cannot_batch, "MOCK_CPU"); | ||
core.compile_model(model_cannot_batch, "MOCK_GPU"); // need to initialize the order of plugins in mock_engine | ||
register_plugin_mock_gpu_compile_slower(core, "MOCK_GPU_SLOWER", {}); | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, "AUTO", {ov::device::priorities("MOCK_GPU_SLOWER", "MOCK_CPU")}); | ||
}, | ||
10, | ||
10); | ||
} | ||
|
||
TEST_F(AutoFuncTests, threading_test_cpu_help_slower) { | ||
core.compile_model(model_cannot_batch, "MOCK_CPU"); | ||
core.compile_model(model_cannot_batch, "MOCK_GPU"); // need to initialize the order of plugins in mock_engine | ||
register_plugin_mock_cpu_compile_slower(core, "MOCK_CPU_SLOWER", {}); | ||
ThreadingTest::runParallel( | ||
[&]() { | ||
(void)core.compile_model(model_can_batch, "AUTO", {ov::device::priorities("MOCK_GPU", "MOCK_CPU_SLOWER")}); | ||
}, | ||
10, | ||
10); | ||
} | ||
#endif |
Oops, something went wrong.