Skip to content

Commit

Permalink
[CPU Test] use internal_properties for snippets_mode (openvinotoolkit…
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie authored Dec 12, 2023
1 parent 1542100 commit a2cc6a0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "common_test_utils/node_builders/eltwise.hpp"
#include "gtest/gtest.h"
#include "internal_properties.hpp"
#include "openvino/core/type/element_type.hpp"
#include "openvino/runtime/properties.hpp"
#include "test_utils/cpu_test_utils.hpp"
Expand Down Expand Up @@ -150,9 +151,9 @@ void EltwiseLayerCPUTest::SetUp() {
#endif

if (enforceSnippets) {
configuration.insert({"SNIPPETS_MODE", "IGNORE_CALLBACK"});
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::IGNORE_CALLBACK));
} else {
configuration.insert({"SNIPPETS_MODE", "DISABLE"});
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::DISABLE));
}
ov::ParameterVector parameters{std::make_shared<ov::op::v0::Parameter>(netType, inputDynamicShapes.front())};
std::shared_ptr<ov::Node> secondaryInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "common_test_utils/node_builders/convolution.hpp"
#include "common_test_utils/node_builders/activation.hpp"
#include "common_test_utils/node_builders/convolution.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "internal_properties.hpp"
#include "ov_models/builders.hpp"
#include "ov_models/utils/ov_helpers.hpp"
#include "ov_ops/type_relaxed.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "test_utils/convolution_params.hpp"
#include "test_utils/fusing_test_utils.hpp"
#include "internal_properties.hpp"

#include <regex>

Expand Down Expand Up @@ -132,8 +132,8 @@ class ConvSumInPlaceTest : public testing::WithParamInterface<convSumBroadcastPa
function = makeNgraphFunction(getNetType(), inputParams, sum, "ConvolutionSumBroadcast");

targetDevice = ov::test::utils::DEVICE_CPU;
if (!configuration.count("SNIPPETS_MODE")) {
configuration.insert({"SNIPPETS_MODE", "DISABLE"});
if (!configuration.count(ov::intel_cpu::snippets_mode.name())) {
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::DISABLE));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/ov_tensor_utils.hpp"
#include "functional_test_utils/skip_tests_config.hpp"
#include "internal_properties.hpp"
#include "ov_models/builders.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "test_utils/cpu_test_utils.hpp"
Expand Down Expand Up @@ -235,8 +236,8 @@ class MHATest : public testing::WithParamInterface<MHATuple>, virtual public Sub
// Snippets MHA tokenization has limitations to avoid performance degradations. These limitations depend on
// target machine. Just for testing, we disable these limitations to allow Snippets to tokenize pattern on all
// machines for validation.
if (!configuration.count("SNIPPETS_MODE")) {
configuration.insert({"SNIPPETS_MODE", "IGNORE_CALLBACK"});
if (!configuration.count(ov::intel_cpu::snippets_mode.name())) {
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::IGNORE_CALLBACK));
}
}
};
Expand Down Expand Up @@ -617,8 +618,8 @@ class MHAQuantTest : public testing::WithParamInterface<MHATuple>,
// Snippets MHA tokenization has limitations to avoid performance degradations. These limitations depend on
// target machine. Just for testing, we disable these limitations to allow Snippets to tokenize pattern on all
// machines for validation.
if (!configuration.count("SNIPPETS_MODE")) {
configuration.insert({"SNIPPETS_MODE", "IGNORE_CALLBACK"});
if (!configuration.count(ov::intel_cpu::snippets_mode.name())) {
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::IGNORE_CALLBACK));
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/ov_tensor_utils.hpp"
#include "internal_properties.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "test_utils/cpu_test_utils.hpp"

Expand Down Expand Up @@ -201,8 +202,8 @@ class NgramCPUTest : public testing::WithParamInterface<NgramTestParams>,
init_input_shapes(inputShapes);
function = initNgram(inputDynamicShapes, data_et, idces_et, k);

if (!configuration.count("SNIPPETS_MODE")) {
configuration.insert({"SNIPPETS_MODE", "DISABLE"});
if (!configuration.count(ov::intel_cpu::snippets_mode.name())) {
configuration.insert(ov::intel_cpu::snippets_mode(ov::intel_cpu::SnippetsMode::DISABLE));
}
}
};
Expand Down

0 comments on commit a2cc6a0

Please sign in to comment.