Skip to content

Commit b7d390e

Browse files
committed
[TEST] SubgraphBaseTest execution time optimizations
1 parent d8431e5 commit b7d390e

File tree

41 files changed

+826
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+826
-810
lines changed

src/common/transformations/tests/skip_tests_config.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
#include <string>
88
#include <vector>
99

10-
std::vector<std::string> disabledTestPatterns() {
11-
return {
10+
const std::vector<std::regex>& disabled_test_patterns() {
11+
const static std::vector<std::regex> patterns = {
1212
// TODO: task 32568, enable after supporting constants outputs in plugins
13-
".*TransformationTests\\.ConstFoldingPriorBox.*",
13+
std::regex(".*TransformationTests\\.ConstFoldingPriorBox.*"),
1414
};
15+
16+
return patterns;
1517
}

src/core/src/preprocess/pre_post_process.cpp

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,39 +91,49 @@ void transformation_pipeline(std::shared_ptr<ov::Model>& model) {
9191
RTInfoCache rt_info_cache;
9292
rt_info_cache.store(model);
9393

94-
Manager manager("pre_post_processing");
95-
manager.set_per_pass_validation(false);
96-
97-
// prerequisite: the model structure optimization before applying of the markup
98-
REGISTER_PASS(manager, SharedOpOptimization)
99-
100-
// 1. Set "disable_const_folding" attribute
101-
// we have to add a call into the PrePostProcessing, it runs before compile_model call
102-
REGISTER_PASS(manager, MarkGatherSubgraph, element::TypeVector{element::f8e4m3}, element::TypeVector{element::u4});
103-
REGISTER_PASS(manager,
104-
MarkDequantization,
105-
TypeVector{i32, u32, i16, u16, i8, u8, u6, i4, u4, u3, u2, u1, nf4, f4e2m1, f8e4m3, f8e5m2, f8e8m0});
106-
REGISTER_PASS(manager, DisableShapeOfConstantFolding, false);
107-
REGISTER_PASS(manager, DisableRandomUniformConstantFolding)
108-
// Mark quantized and f16/bf16 compressed constants to prevent CF for them,
109-
// so that not extra memory is used for intermediate decompressed constants.
110-
REGISTER_PASS(manager, MarkCompressedFloatConstants);
111-
REGISTER_PASS(manager, DisableDecompressionConvertConstantFolding);
112-
113-
// 2. Fusion transformations:
114-
REGISTER_PASS(manager, ConvertDivideWithConstant)
115-
auto fusions = manager.register_pass<GraphRewrite>();
116-
// Gelu fusion have to be executed before MulConv fusion because Mul(X, 0.5) might be fused to Conv weights
117-
ADD_MATCHER(fusions, GeluFusion)
118-
ADD_MATCHER(fusions, MultiplyConvolutionFusion)
119-
ADD_MATCHER(fusions, MultiplyGroupConvolutionFusion)
120-
ADD_MATCHER(fusions, MultiplyConvolutionBackpropDataFusion)
121-
ADD_MATCHER(fusions, MultiplyGroupConvolutionBackpropDataFusion)
122-
fusions->set_name("ov::pass::MultiplyFusions");
123-
REGISTER_PASS(manager, ReverseInputChannelsFusion)
124-
125-
// 3. CF call due to detected perf degradations
126-
REGISTER_PASS(manager, ConstantFolding)
94+
auto get_manager = []() {
95+
Manager manager("pre_post_processing");
96+
manager.set_per_pass_validation(false);
97+
98+
// prerequisite: the model structure optimization before applying of the markup
99+
REGISTER_PASS(manager, SharedOpOptimization)
100+
101+
// 1. Set "disable_const_folding" attribute
102+
// we have to add a call into the PrePostProcessing, it runs before compile_model call
103+
REGISTER_PASS(manager,
104+
MarkGatherSubgraph,
105+
element::TypeVector{element::f8e4m3},
106+
element::TypeVector{element::u4});
107+
REGISTER_PASS(
108+
manager,
109+
MarkDequantization,
110+
TypeVector{i32, u32, i16, u16, i8, u8, u6, i4, u4, u3, u2, u1, nf4, f4e2m1, f8e4m3, f8e5m2, f8e8m0});
111+
REGISTER_PASS(manager, DisableShapeOfConstantFolding, false);
112+
REGISTER_PASS(manager, DisableRandomUniformConstantFolding)
113+
// Mark quantized and f16/bf16 compressed constants to prevent CF for them,
114+
// so that not extra memory is used for intermediate decompressed constants.
115+
REGISTER_PASS(manager, MarkCompressedFloatConstants);
116+
REGISTER_PASS(manager, DisableDecompressionConvertConstantFolding);
117+
118+
// 2. Fusion transformations:
119+
REGISTER_PASS(manager, ConvertDivideWithConstant)
120+
auto fusions = manager.register_pass<GraphRewrite>();
121+
// Gelu fusion have to be executed before MulConv fusion because Mul(X, 0.5) might be fused to Conv weights
122+
ADD_MATCHER(fusions, GeluFusion)
123+
ADD_MATCHER(fusions, MultiplyConvolutionFusion)
124+
ADD_MATCHER(fusions, MultiplyGroupConvolutionFusion)
125+
ADD_MATCHER(fusions, MultiplyConvolutionBackpropDataFusion)
126+
ADD_MATCHER(fusions, MultiplyGroupConvolutionBackpropDataFusion)
127+
fusions->set_name("ov::pass::MultiplyFusions");
128+
REGISTER_PASS(manager, ReverseInputChannelsFusion)
129+
130+
// 3. CF call due to detected perf degradations
131+
REGISTER_PASS(manager, ConstantFolding)
132+
133+
return manager;
134+
};
135+
static Manager manager = get_manager();
136+
127137
manager.run_passes(model);
128138

129139
// 4. Restore old RT info to not affect plugin compilation

src/frontends/onnx/tests/skip_tests_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <string>
88
#include <vector>
99

10-
std::vector<std::string> disabledTestPatterns() {
10+
const std::vector<std::regex>& disabled_test_patterns() {
1111
return {
1212
#ifdef OPENVINO_STATIC_LIBRARY
1313
// Disable tests for static libraries

src/frontends/paddle/tests/skip_tests_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <string>
88
#include <vector>
99

10-
std::vector<std::string> disabledTestPatterns() {
10+
const std::vector<std::regex>& disabled_test_patterns() {
1111
return {
1212
#ifdef OPENVINO_STATIC_LIBRARY
1313
// Disable tests for static libraries

src/inference/tests/functional/skip_tests_config.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <string>
88
#include <vector>
99

10-
std::vector<std::string> disabledTestPatterns() {
11-
return {};
10+
const std::vector<std::regex>& disabled_test_patterns() {
11+
const static std::vector<std::regex> patterns = {};
12+
13+
return patterns;
1214
}

src/plugins/auto/tests/functional/shared_tests_instances/skip_tests_config.cpp

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,42 @@
99

1010
#include "openvino/core/visibility.hpp"
1111

12-
std::vector<std::string> disabledTestPatterns() {
13-
std::vector<std::string> retVector{
12+
const std::vector<std::regex>& disabled_test_patterns() {
13+
const static std::vector<std::regex> patterns = {
1414
// Not implemented yet:
15-
R"(.*Behavior.*OVCompiledModelBaseTest.*canSetConfigToCompiledModel.*)",
16-
R"(.*Behavior.*OVCompiledModelBaseTest.*canExportModel.*)",
17-
R"(.*Behavior.*OVCompiledModelBaseTest.*canSetConfigToCompiledModelWithIncorrectConfig.*)",
15+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*canSetConfigToCompiledModel.*)"),
16+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*canExportModel.*)"),
17+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*canSetConfigToCompiledModelWithIncorrectConfig.*)"),
1818
// requires export_model be implemented
19-
R"(.*Behavior.*OVCompiledModelBaseTest.*import_from_weightless_blob.*targetDevice=(MULTI|AUTO).*)",
20-
R"(.*Behavior.*OVCompiledModelBaseTest.*compile_from.*_blob.*targetDevice=(MULTI|AUTO).*)",
21-
R"(.*Behavior.*OVCompiledModelBaseTest.*use_blob_hint.*targetDevice=(MULTI|AUTO).*)",
19+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*import_from_weightless_blob.*targetDevice=(MULTI|AUTO).*)"),
20+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*compile_from.*_blob.*targetDevice=(MULTI|AUTO).*)"),
21+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*use_blob_hint.*targetDevice=(MULTI|AUTO).*)"),
2222

2323
// unsupported metrics
24-
R"(.*smoke_AutoOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)",
24+
std::regex(
25+
R"(.*smoke_AutoOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)"),
2526

2627
// Issue:
2728
// New API tensor tests
28-
R"(.*OVInferRequestCheckTensorPrecision.*type=i4.*)",
29-
R"(.*OVInferRequestCheckTensorPrecision.*type=u1.*)",
30-
R"(.*OVInferRequestCheckTensorPrecision.*type=u4.*)",
29+
std::regex(R"(.*OVInferRequestCheckTensorPrecision.*type=i4.*)"),
30+
std::regex(R"(.*OVInferRequestCheckTensorPrecision.*type=u1.*)"),
31+
std::regex(R"(.*OVInferRequestCheckTensorPrecision.*type=u4.*)"),
3132

3233
// AUTO does not support import / export
33-
R"(.*smoke_Auto_BehaviorTests/OVCompiledGraphImportExportTest.*(mportExport|readFromV10IR).*/targetDevice=(AUTO).*)",
34-
R"(.*Behavior.*OVInferRequestIOTensorTest.*canInferAfterIOBlobReallocation.*)",
35-
R"(.*Behavior.*OVInferRequestDynamicTests.*InferUpperBoundNetworkAfterIOTensorsReshaping.*)",
34+
std::regex(
35+
R"(.*smoke_Auto_BehaviorTests/OVCompiledGraphImportExportTest.*(mportExport|readFromV10IR).*/targetDevice=(AUTO).*)"),
36+
std::regex(R"(.*Behavior.*OVInferRequestIOTensorTest.*canInferAfterIOBlobReallocation.*)"),
37+
std::regex(R"(.*Behavior.*OVInferRequestDynamicTests.*InferUpperBoundNetworkAfterIOTensorsReshaping.*)"),
3638
// template plugin doesn't support this case
37-
R"(.*OVInferRequestPerfCountersTest.*CheckOperationInProfilingInfo.*)",
39+
std::regex(R"(.*OVInferRequestPerfCountersTest.*CheckOperationInProfilingInfo.*)"),
3840
// model import is not supported
39-
R"(.*OVCompiledModelBaseTest.import_from_.*)"};
41+
std::regex(R"(.*OVCompiledModelBaseTest.import_from_.*)"),
4042

4143
#if !defined(OPENVINO_ARCH_X86_64)
42-
// very time-consuming test
43-
retVector.emplace_back(R"(.*OVInferConsistencyTest.*)");
44+
// very time-consuming test
45+
std::regex(R"(.*OVInferConsistencyTest.*)"),
4446
#endif
45-
return retVector;
47+
};
48+
49+
return patterns;
4650
}

src/plugins/auto_batch/tests/functional/skip_tests_config.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@
77
#include <string>
88
#include <vector>
99

10-
std::vector<std::string> disabledTestPatterns() {
11-
std::vector<std::string> disabled_items = {
10+
const std::vector<std::regex>& disabled_test_patterns() {
11+
const static std::vector<std::regex> patterns = {
1212
// TODO: for CVS-68949
1313
// Not implemented yet:
14-
R"(.*Behavior.*ExecutableNetworkBaseTest.*canSetConfigToExecNet.*)",
15-
R"(.*Behavior.*ExecutableNetworkBaseTest.*canExport.*)",
16-
R"(.*OVExecutableNetworkBaseTest.*CanSetConfigToExecNet.*)",
17-
R"(.*OVExecutableNetworkBaseTest.*CanSetConfigToExecNetAndCheckConfigAndCheck.*)",
14+
std::regex(R"(.*Behavior.*ExecutableNetworkBaseTest.*canSetConfigToExecNet.*)"),
15+
std::regex(R"(.*Behavior.*ExecutableNetworkBaseTest.*canExport.*)"),
16+
std::regex(R"(.*OVExecutableNetworkBaseTest.*CanSetConfigToExecNet.*)"),
17+
std::regex(R"(.*OVExecutableNetworkBaseTest.*CanSetConfigToExecNetAndCheckConfigAndCheck.*)"),
1818
// Not supported by TEMPLATE plugin
19-
R"(.*OVExecutableNetworkBaseTest.*CheckExecGraphInfo.*)",
19+
std::regex(R"(.*OVExecutableNetworkBaseTest.*CheckExecGraphInfo.*)"),
2020
// Issue: 90539
21-
R"(.*OVInferRequestIOTensorTest.InferStaticNetworkSetChangedInputTensorThrow.*)",
22-
R"(.*OVInferRequestIOTensorTest.canInferAfterIOBlobReallocation.*)",
23-
R"(.*VirtualPlugin.*BehaviorTests.*OVHoldersTest.*)",
21+
std::regex(R"(.*OVInferRequestIOTensorTest.InferStaticNetworkSetChangedInputTensorThrow.*)"),
22+
std::regex(R"(.*OVInferRequestIOTensorTest.canInferAfterIOBlobReallocation.*)"),
23+
std::regex(R"(.*VirtualPlugin.*BehaviorTests.*OVHoldersTest.*)"),
2424
// BATCH plugin doesn't support this case
25-
R"(.*LoadNetworkCreateDefaultExecGraphResult.*)",
25+
std::regex(R"(.*LoadNetworkCreateDefaultExecGraphResult.*)"),
2626
// BATCH/TEMPLATE plugin doesn't support this case
27-
R"(.*OVInferRequestPerfCountersTest.*CheckOperationInProfilingInfo.*)",
27+
std::regex(R"(.*OVInferRequestPerfCountersTest.*CheckOperationInProfilingInfo.*)"),
2828
// requires export_model be implemented
29-
R"(.*Behavior.*OVCompiledModelBaseTest.*import_from_weightless_blob.*targetDevice=(BATCH).*)",
30-
R"(.*Behavior.*OVCompiledModelBaseTest.*compile_from.*_blob.*targetDevice=(BATCH).*)",
31-
R"(.*Behavior.*OVCompiledModelBaseTest.*use_blob_hint.*targetDevice=(BATCH).*)",
29+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*import_from_weightless_blob.*targetDevice=(BATCH).*)"),
30+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*compile_from.*_blob.*targetDevice=(BATCH).*)"),
31+
std::regex(R"(.*Behavior.*OVCompiledModelBaseTest.*use_blob_hint.*targetDevice=(BATCH).*)"),
3232
// model import is not supported
33-
R"(.*OVCompiledModelBaseTest.import_from_.*)"
33+
std::regex(R"(.*OVCompiledModelBaseTest.import_from_.*)")
3434
};
3535

36-
return disabled_items;
36+
return patterns;
3737
}

src/plugins/hetero/tests/functional/skip_tests_config.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@
99

1010
#include "openvino/core/core_visibility.hpp"
1111

12-
std::vector<std::string> disabledTestPatterns() {
13-
std::vector<std::string> retVector{
14-
R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*SetCorrectProperties.*)",
15-
R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*canSetPropertyAndCheckGetProperty.*)",
16-
R"(.*OVInferRequestCheckTensorPrecision.*get(Input|Output|Inputs|Outputs)From.*FunctionWith(Single|Several).*type=(u4|u1|i4|boolean).*)",
17-
R"(.*OVGetMetricPropsTest.*OVGetMetricPropsTest.*GetMetricAndPrintNoThrow_AVAILABLE_DEVICES.*)",
12+
const std::vector<std::regex>& disabled_test_patterns() {
13+
const static std::vector<std::regex> patterns = {
14+
std::regex(R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*SetCorrectProperties.*)"),
15+
std::regex(
16+
R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*canSetPropertyAndCheckGetProperty.*)"),
17+
std::regex(
18+
R"(.*OVInferRequestCheckTensorPrecision.*get(Input|Output|Inputs|Outputs)From.*FunctionWith(Single|Several).*type=(u4|u1|i4|boolean).*)"),
19+
std::regex(R"(.*OVGetMetricPropsTest.*OVGetMetricPropsTest.*GetMetricAndPrintNoThrow_AVAILABLE_DEVICES.*)"),
1820
// CACHE_MODE property is not supported on NPU
19-
R"(.*OVCompiledModelBaseTest.*import_from_.*_blob.*targetDevice=(HETERO.NPU).*)",
20-
R"(.*OVCompiledModelBaseTest.*compile_from_.*_blob.*targetDevice=(HETERO.NPU).*)",
21-
R"(.*OVCompiledModelBaseTest.*compile_from_cached_weightless_blob.*targetDevice=(HETERO.NPU).*)",
22-
R"(.*OVCompiledModelBaseTest.*use_blob_hint_.*targetDevice=CPU.*)",
21+
std::regex(R"(.*OVCompiledModelBaseTest.*import_from_.*_blob.*targetDevice=(HETERO.NPU).*)"),
22+
std::regex(R"(.*OVCompiledModelBaseTest.*compile_from_.*_blob.*targetDevice=(HETERO.NPU).*)"),
23+
std::regex(R"(.*OVCompiledModelBaseTest.*compile_from_cached_weightless_blob.*targetDevice=(HETERO.NPU).*)"),
24+
std::regex(R"(.*OVCompiledModelBaseTest.*use_blob_hint_.*targetDevice=CPU.*)"),
2325
// model import is not supported
24-
R"(.*OVCompiledModelBaseTest.import_from_.*)"};
25-
return retVector;
26+
std::regex(R"(.*OVCompiledModelBaseTest.import_from_.*)"),
27+
};
28+
29+
return patterns;
2630
}

0 commit comments

Comments
 (0)