Skip to content

Commit

Permalink
Minor fixed and enable shared test eltwise, convolution for undefined…
Browse files Browse the repository at this point in the history
… type

Signed-off-by: Pawel Raasz <pawel.raasz@intel.com>
  • Loading branch information
praasz committed Feb 4, 2025
1 parent a5aa6f1 commit 5350d22
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LP_TRANSFORMATIONS_API DataPrecision {

bool empty() const noexcept {
OPENVINO_SUPPRESS_DEPRECATED_START
assert(((precision == element::dynamic || precisoin == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint)) ||
assert(((precision == element::dynamic || precision == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint)) ||
((precision != element::dynamic && precision != element::undefined) && (max != 0.f)));
return (precision == element::dynamic || precision == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint);
OPENVINO_SUPPRESS_DEPRECATED_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ using namespace CPUTestUtils;
namespace ov {
namespace test {
namespace Convolution {
OPENVINO_SUPPRESS_DEPRECATED_START
/* ============= Convolution (Gemm 1D) ============= */
INSTANTIATE_TEST_SUITE_P(smoke_Conv_1D_GEMM_FP32, ConvolutionLayerCPUTest,
::testing::Combine(
::testing::Combine(
convParams_ExplicitPadding_GEMM_1D(),
::testing::Values(ElementType::f32),
::testing::Values(ElementType::dynamic),
::testing::Values(ElementType::dynamic),
::testing::ValuesIn(inShapesGemm1D()),
::testing::Values(ov::test::utils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_1D())),
::testing::ValuesIn(fusingParamsSetWithEmpty()),
::testing::Values(empty_plugin_config)),
ConvolutionLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_Conv_1D_GEMM_FP32,
ConvolutionLayerCPUTest,
::testing::Combine(::testing::Combine(convParams_ExplicitPadding_GEMM_1D(),
::testing::Values(ElementType::f32),
::testing::Values(ElementType::dynamic, ElementType::undefined),
::testing::Values(ElementType::dynamic, ElementType::undefined),
::testing::ValuesIn(inShapesGemm1D()),
::testing::Values(ov::test::utils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_1D())),
::testing::ValuesIn(fusingParamsSetWithEmpty()),
::testing::Values(empty_plugin_config)),
ConvolutionLayerCPUTest::getTestCaseName);

std::vector<InputShape> inputShapesPlain2Blocked3d = {
{{}, {{ 1, 1, 7, 7, 7 }}},
Expand Down Expand Up @@ -62,19 +63,20 @@ INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_GEMM_FP32, ConvolutionLayerCPUTest,
::testing::Values(empty_plugin_config)),
ConvolutionLayerCPUTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(Conv_2D_GEMM_FP32_dilated_empty_fusing, ConvolutionLayerCPUTest,
::testing::Combine(
::testing::Combine(
convParams_ExplicitPadding_GEMM_2D_dilated(),
::testing::Values(ElementType::f32),
::testing::Values(ElementType::dynamic),
::testing::Values(ElementType::dynamic),
::testing::ValuesIn(inShapesGemm2D()),
::testing::Values(ov::test::utils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_2D())),
::testing::Values(emptyFusingSpec),
::testing::Values(empty_plugin_config)),
ConvolutionLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
Conv_2D_GEMM_FP32_dilated_empty_fusing,
ConvolutionLayerCPUTest,
::testing::Combine(::testing::Combine(convParams_ExplicitPadding_GEMM_2D_dilated(),
::testing::Values(ElementType::f32),
::testing::Values(ElementType::undefined, element::dynamic),
::testing::Values(ElementType::undefined, element::dynamic),
::testing::ValuesIn(inShapesGemm2D()),
::testing::Values(ov::test::utils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_2D())),
::testing::Values(emptyFusingSpec),
::testing::Values(empty_plugin_config)),
ConvolutionLayerCPUTest::getTestCaseName);
OPENVINO_SUPPRESS_DEPRECATED_END

/* ============= Convolution (2D) ============= */
INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_FP32_empty_fusing, ConvolutionLayerCPUTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ using namespace CPUTestUtils;
namespace ov {
namespace test {
namespace Eltwise {

OPENVINO_SUPPRESS_DEPRECATED_START
const auto params_4D =
::testing::Combine(::testing::Combine(::testing::ValuesIn(static_shapes_to_test_representation(inShapes_4D())),
::testing::ValuesIn(eltwiseOpTypesBinInp()),
::testing::ValuesIn(secondaryInputTypes()),
::testing::ValuesIn(opTypes()),
::testing::ValuesIn(netType()),
::testing::Values(ov::element::dynamic),
::testing::Values(ov::element::dynamic),
::testing::Values(ov::element::dynamic, ElementType::undefined),
::testing::Values(ov::element::dynamic, ElementType::undefined),
::testing::Values(ov::test::utils::DEVICE_CPU),
::testing::ValuesIn(additional_config())),
::testing::ValuesIn(filterCPUSpecificParams(cpuParams_4D())),
Expand All @@ -35,14 +35,14 @@ const auto params_4D_Snippets =
::testing::ValuesIn(secondaryInputTypes()),
::testing::ValuesIn(opTypes()),
::testing::ValuesIn(netType()),
::testing::Values(ov::element::dynamic),
::testing::Values(ov::element::dynamic),
::testing::Values(ov::element::dynamic, ElementType::undefined),
::testing::Values(ov::element::dynamic, ElementType::undefined),
::testing::Values(ov::test::utils::DEVICE_CPU),
::testing::Values(additional_config()[0])),
::testing::ValuesIn(filterCPUSpecificParams(cpuParams_4D())),
::testing::Values(emptyFusingSpec),
::testing::Values(true));

OPENVINO_SUPPRESS_DEPRECATED_END
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_4D_MemOrder_Snippets, EltwiseLayerCPUTest, params_4D_Snippets, EltwiseLayerCPUTest::getTestCaseName);

const auto params_4D_emptyCPUSpec =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ void core_configuration(ov::test::SubgraphBaseTest* test) {
}

// todo: issue: 123320
if (!((inf_prc != config.end() && inf_prc->second == element::dynamic) ||
OPENVINO_SUPPRESS_DEPRECATED_START
if (!((inf_prc != config.end() && (inf_prc->second == element::dynamic || inf_prc->second == element::undefined)) ||
(inf_prc == config.end() && exec_mode != config.end() &&
exec_mode->second == hint::ExecutionMode::ACCURACY))) {
OPENVINO_SUPPRESS_DEPRECATED_END
test->convert_precisions.insert({ov::element::bf16, ov::element::f32});
test->convert_precisions.insert({ov::element::f16, ov::element::f32});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ void SubgraphBaseTest::configure_model() {
{
auto& params = function->get_parameters();
for (size_t i = 0; i < params.size(); i++) {
if (inType != ov::element::Type_t::dynamic) {
OPENVINO_SUPPRESS_DEPRECATED_START
if (inType != ov::element::Type_t::dynamic && inType != ov::element::undefined) {
p.input(i).tensor().set_element_type(inType);
}
}
Expand All @@ -283,11 +284,12 @@ void SubgraphBaseTest::configure_model() {
{
auto results = function->get_results();
for (size_t i = 0; i < results.size(); i++) {
if (outType != ov::element::Type_t::dynamic) {
if (outType != ov::element::Type_t::dynamic && outType != ov::element::undefined) {
p.output(i).tensor().set_element_type(outType);
}
}
}
OPENVINO_SUPPRESS_DEPRECATED_END
function = p.build();
}

Expand Down Expand Up @@ -377,7 +379,10 @@ void SubgraphBaseTest::update_ref_model() {
}
const auto& outputs = functionRefs->outputs();
for (size_t i = 0; i < outputs.size(); ++i) {
if (outType != ElementType::dynamic && outType != outputs[i].get_element_type()) {
OPENVINO_SUPPRESS_DEPRECATED_START
if (outType != ElementType::dynamic && outType != element::undefined &&
outType != outputs[i].get_element_type()) {
OPENVINO_SUPPRESS_DEPRECATED_END
p.output(i).tensor().set_element_type(outType);
}
}
Expand Down

0 comments on commit 5350d22

Please sign in to comment.