From 1536ece2df1d49e7b0b1f76bbdb659856cc74e7e Mon Sep 17 00:00:00 2001 From: xipingya Date: Tue, 10 Dec 2024 15:33:58 +0800 Subject: [PATCH] Because convert node is sensitive to different platform for fp16 precision. So change convert's dst precision to i8. Signed-off-by: xipingya --- .../subgraph_tests/src/common/stateful_init_graph.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/stateful_init_graph.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/stateful_init_graph.cpp index cfde5a6077fbd4..2ebc46e9d97a58 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/stateful_init_graph.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/stateful_init_graph.cpp @@ -227,18 +227,18 @@ class InitGraphStatefulDiffPrimitiveModel : public InitGraphStatefulModelBase { input_params[0]->set_friendly_name("input"); // init_graph - auto convert = std::make_shared(input_params[0], ov::element::f16); + auto convert = std::make_shared(input_params[0], exePrc); convert->set_friendly_name("init_graph/convert"); const std::string variable_name("var_diff_precison"); - statePrc = ov::element::f16; + statePrc = exePrc; auto variable = std::make_shared( ov::op::util::VariableInfo{{inputDynamicShapes[0]}, statePrc, variable_name}); auto readvalue = std::make_shared(convert, variable); std::shared_ptr add = - std::make_shared(readvalue, ov::op::v0::Constant::create(ov::element::f16, {1}, {1.0f})); + std::make_shared(readvalue, ov::op::v0::Constant::create(exePrc, {1}, {1.0f})); auto assign = std::make_shared(directPair ? readvalue : add, variable); @@ -248,12 +248,15 @@ class InitGraphStatefulDiffPrimitiveModel : public InitGraphStatefulModelBase { } void check_init_graph_node() override { - CheckNumberOfNodesWithType(compiledModel, "Convert", function->is_dynamic() ? 1 : 0); + CheckNumberOfNodesWithType(compiledModel, "Convert", 0); } ov::Shape get_state_shape(size_t i) override { return inputShapes[0].second[i]; } + +private: + const ov::element::Type exePrc = ElementType::i8; }; TEST_P(InitGraphStatefulDiffPrimitiveModel, CompareWithRefs) {