Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU] extend bf16 fp16 cpu functional tests on LNL+ systems (#29168)

Bo Liu2b477c1dd9d0
diff --git a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp
index 956c90d1c8e..625e1409342 100644
--- a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp
+++ b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp
@@ -1238,10 +1238,17 @@ void ScaledDotProductAttention::createPrimitive() {
std::shared_ptr<Executor> executor = nullptr;
#ifdef OPENVINO_ARCH_X86_64
if (rtPrecision == ov::element::bf16) {
- executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context,
- m_key_quant_param.groupSize,
- m_value_quant_param.groupSize,
- m_key_quant_param.isByChannel);
+ if (ov::with_cpu_x86_bfloat16()) {
+ executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context,
+ m_key_quant_param.groupSize,
+ m_value_quant_param.groupSize,
+ m_key_quant_param.isByChannel);
+ } else {
+ executor = std::make_shared<AttentionExecutor<KT_REF, ov::bfloat16>>(context,
+ m_key_quant_param.groupSize,
+ m_value_quant_param.groupSize,
+ m_key_quant_param.isByChannel);
+ }
} else if (rtPrecision == ov::element::f16) {
if (with_cpu_x86_avx512_core_fp16()) {
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::float16>>(context,
@@ -2075,7 +2082,7 @@ const ScaledDotProductAttention::SDPAQuantParam& ScaledDotProductAttention::getV
ov::element::Type ScaledDotProductAttention::getRuntimePrecision() const {
auto rtPrecision = getOriginalInputPrecisionAtPort(0);
// bf16 should be enabled only when platform supports
- if (rtPrecision == ov::element::bf16 && ov::with_cpu_x86_bfloat16()) {
+ if (rtPrecision == ov::element::bf16 && (ov::with_cpu_x86_bfloat16() || mayiuse(cpu_isa_t::avx2_vnni_2))) {
rtPrecision = ov::element::bf16;
} else if (rtPrecision == ov::element::f16 && ov::intel_cpu::hasHardwareSupport(ov::element::f16)) {
rtPrecision = ov::element::f16;
diff --git a/src/plugins/intel_cpu/src/nodes/topk.cpp b/src/plugins/intel_cpu/src/nodes/topk.cpp
index 3fc7a330912..22f0b88c6d2 100644
--- a/src/plugins/intel_cpu/src/nodes/topk.cpp
+++ b/src/plugins/intel_cpu/src/nodes/topk.cpp
@@ -18,6 +18,7 @@
#include "onednn/dnnl.h"
#include "openvino/core/parallel.hpp"
#include "openvino/op/topk.hpp"
+#include "utils/cpu_utils.hpp"
#include "utils/ngraph_utils.hpp"
using namespace dnnl;
@@ -1985,11 +1986,9 @@ void TopK::initSupportedPrimitiveDescriptors() {
ov::element::u8};
ov::element::Type dataPrecision = getOriginalOutputPrecisionAtPort(TOPK_DATA);
- if (dataPrecision == ov::element::bf16 && !mayiuse(avx512_core)) {
- THROW_CPU_NODE_ERR("gets incorrect isa for BF16! AVX512 must be supported!");
- }
bool precisionSupported = std::find(std::begin(supportedPrecision), std::end(supportedPrecision), dataPrecision) !=
std::end(supportedPrecision);
+ precisionSupported = (dataPrecision == ov::element::bf16 && !mayiuse(avx512_core)) ? false : precisionSupported;
if (!precisionSupported) {
if (dataPrecision.is_real()) {
dataPrecision = ov::element::f32;
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/conversion.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/conversion.cpp
index 510da1e2645..4e17ed0b280 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/conversion.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/conversion.cpp
@@ -145,6 +145,12 @@ void ConvertCPULayerTest::SetUp() {
auto conversion = std::make_shared<ov::op::v0::Convert>(params.front(), outPrc);
function = makeNgraphFunction(inPrc, params, conversion, "ConversionCPU");
+
+ // issue 161636
+ if (special_value == ov::test::SpecialValue::none && outPrc == ov::element::f8e4m3) {
+ abs_threshold = 0.0078125f;
+ rel_threshold = 1e-2f;
+ }
}
void ConvertCPULayerTest::generate_inputs(const std::vector<ov::Shape>& targetInputStaticShapes) {
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp
index f69a587986d..bc9f56b9c0c 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp
@@ -158,6 +158,15 @@ void EltwiseLayerCPUTest::SetUp() {
std::tie(inFmts, outFmts, priority, selectedType) = cpuParams;
std::tie(postOpMgrPtr, fusedOps) = fusingParams;
+ // issue 163147
+ if (ElementType::f16 == netType && enforceSnippets) {
+ auto fusedOpsNames = postOpMgrPtr ? postOpMgrPtr->getFusedOpsNames() : "";
+ if (fusedOpsNames.find("PerChannel") != std::string::npos) {
+ rel_threshold = 0.01f;
+ abs_threshold = 0.0078125f;
+ }
+ }
+
shapes.resize(2);
switch (opType) {
case ov::test::utils::OpType::SCALAR: {
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
index 454b0bfc5b9..3edba65967f 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
@@ -59,7 +59,12 @@ void ScaledAttnLayerCPUTest::SetUp() {
}
if (inType == ElementType::bf16) {
- rel_threshold = 2e-2f;
+ // Issue: 163144
+ if (with_cpu_x86_avx2_vnni_2()) {
+ rel_threshold = 0.2f;
+ } else {
+ rel_threshold = 2e-2f;
+ }
}
selectedType = makeSelectedTypeStr(selectedType, inType);
init_input_shapes(inputShapes);
@@ -133,7 +138,7 @@ TEST_P(ScaledAttnLayerCPUTest, CompareWithRefs) {
bool has_scale;
std::string targetDevice;
std::tie(inType, inputShapes, is_causal, has_attn, has_scale, targetDevice, cpuParams) = this->GetParam();
- if (inType == ElementType::bf16 && !ov::with_cpu_x86_bfloat16())
+ if (inType == ElementType::bf16 && !ov::with_cpu_x86_bfloat16() && !with_cpu_x86_avx2_vnni_2())
GTEST_SKIP();
run();
CheckPluginRelatedResults(compiledModel, "ScaledAttn");
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/matmul.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/matmul.cpp
index c9910641411..3405f12e0c3 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/matmul.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/matmul.cpp
@@ -157,7 +157,7 @@ std::vector<ov::AnyMap> filterAdditionalConfig_Brgemm() {
#else
std::vector<ov::AnyMap> additionalConfig = {{}};
#endif
- if (with_cpu_x86_bfloat16()) {
+ if (with_cpu_x86_bfloat16() || with_cpu_x86_avx2_vnni_2()) {
additionalConfig.push_back({ov::hint::inference_precision(ov::element::bf16)});
}
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/normalize.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/normalize.cpp
index b48813baf96..582ea471db1 100755
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/normalize.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/normalize.cpp
@@ -64,7 +64,13 @@ protected:
if (selectedType.empty()) {
selectedType = getPrimitiveType();
}
- selectedType = makeSelectedTypeStr("unknown", inType);
+
+ if (!with_cpu_x86_avx512_core() && inType == ElementType::bf16) {
+ selectedType = makeSelectedTypeStr("unknown", ElementType::f32);
+ } else {
+ selectedType = makeSelectedTypeStr("unknown", inType);
+ }
+
targetDevice = ov::test::utils::DEVICE_CPU;
init_input_shapes({shapes});
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp
index bb1802f9fe8..afaf03eb067 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp
@@ -194,7 +194,12 @@ protected:
selectedType = getPrimitiveType();
}
selectedType.push_back('_');
- selectedType += netPrecision.to_string();
+
+ if (!with_cpu_x86_avx512_core() && netPrecision == ElementType::bf16) {
+ selectedType += ov::element::f32.to_string();
+ } else {
+ selectedType += netPrecision.to_string();
+ }
if (netPrecision == ov::element::bf16) {
rel_threshold = 1e-2;
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/topk.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/topk.cpp
index ab93c3ad607..82f4310dd57 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/topk.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/topk.cpp
@@ -102,7 +102,11 @@ protected:
inPrc = outPrc = netPrecision;
configuration.insert(additionalConfig.begin(), additionalConfig.end());
- selectedType = getPrimitiveType() + "_" + ov::element::Type(netPrecision).get_type_name();
+ if (!ov::with_cpu_x86_avx512_core() && netPrecision == ElementType::bf16) {
+ selectedType = makeSelectedTypeStr(getPrimitiveType(), ElementType::f32);
+ } else {
+ selectedType = makeSelectedTypeStr(getPrimitiveType(), netPrecision);
+ }
staticShape = inputShape.first.rank() == 0;
if (staticShape) {
diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/interaction.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/interaction.cpp
index c691aec32d4..8d498e76861 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/interaction.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/interaction.cpp
@@ -149,7 +149,7 @@ protected:
ElementType inType;
InputShape inputShape;
std::tie(inType, inputShape) = this->GetParam();
- bool with_bf16 = ov::with_cpu_x86_bfloat16();
+ bool with_bf16 = ov::with_cpu_x86_bfloat16() || with_cpu_x86_avx2_vnni_2();
if (with_bf16 && (inType == ov::element::bf16 || inType == ov::element::i32)) {
selectedType = makeSelectedTypeStr("ref_any", ov::element::bf16);
} else {
@@ -177,6 +177,8 @@ TEST_P(IntertactionCPUTest_FP16, CompareWithRefs) {
GTEST_SKIP() << "Skipping test, platform don't support precision f16";
}
configuration.insert({ov::hint::inference_precision.name(), ov::element::f16});
+ rel_threshold = 0.01;
+ abs_threshold = 0.0078125;
run();
CheckNumberOfNodesWithType(compiledModel, "Interaction", 1);
diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
index 7a563847d8c..0cf401cb05d 100644
--- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
+++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
@@ -9,10 +9,11 @@
#if defined(OPENVINO_ARCH_RISCV64)
# include "nodes/kernels/riscv64/cpu_isa_traits.hpp"
#endif
-
#include <string>
#include <vector>
+#include "utils/cpu_test_utils.hpp"
+
std::vector<std::string> disabledTestPatterns() {
std::vector<std::string> retVector{
// TODO: Issue 31841
@@ -491,7 +492,7 @@ std::vector<std::string> disabledTestPatterns() {
retVector.emplace_back(R"(.*smoke_RDFT_CPU_1D/RDFTTestCPU.CompareWithRefs/prec=f32_IS0=\[\]_TS0=\(\(126\)\)_constAxes=true_axes=\(\(0\)\)_isInverse=false.*)");
retVector.emplace_back(R"(.*smoke_RDFT_CPU_2D/RDFTTestCPU.CompareWithRefs/prec=f32_IS0=\[\]_TS0=\(\(16.38\)\)_constAxes=true_axes=\(\(0.1\)\)_isInverse=false.*)");
#endif
- if (!ov::with_cpu_x86_avx512_core()) {
+ if (!ov::intel_cpu::hasHardwareSupport(ov::element::bf16)) {
// on platforms which do not support bfloat16, we are disabling bf16 tests since there are no bf16 primitives,
// tests are useless on such platforms
retVector.emplace_back(R"(.*(BF|bf)16.*)");
@@ -504,7 +505,7 @@ std::vector<std::string> disabledTestPatterns() {
retVector.emplace_back(R"(.*Snippets.*MHA.*)");
retVector.emplace_back(R"(.*Snippets.*(MatMul|Matmul).*)");
}
- if (!ov::with_cpu_x86_avx512_core_fp16()) {
+ if (!ov::intel_cpu::hasHardwareSupport(ov::element::f16)) {
// Skip fp16 tests for paltforms that don't support fp16 precision
retVector.emplace_back(R"(.*INFERENCE_PRECISION_HINT=(F|f)16.*)");
retVector.emplace_back(R"(.*ConcatMultiQuerySDPTest.*f16.*)");
@@ -638,7 +639,7 @@ std::vector<std::string> disabledTestPatterns() {
retVector.emplace_back(R"(.*smoke_Deconv_(2|3)D_NSPC_INT8_AMX/DeconvolutionLayerCPUTest.*)");
}
- if (ov::with_cpu_x86_avx512_core_fp16()) {
+ if (ov::with_cpu_x86_avx512_core_fp16() || CPUTestUtils::with_cpu_x86_avx2_vnni_2()) {
// Issue: 143852
retVector.emplace_back(R"(smoke_ConvertRangeSubgraphCPUTest/ConvertRangeSubgraphCPUTest\.CompareWithRefs.*Prc=f16.*)");
retVector.emplace_back(R"((smoke|nightly)_FC_3D_FP16/.*_Fused=Multiply\(PerChannel\).*)");
@@ -649,5 +650,13 @@ std::vector<std::string> disabledTestPatterns() {
retVector.emplace_back(R"(smoke_Conv_Sum_Broadcast_FP16/ConvSumInPlaceTest.*Relu\.Multiply\(PerChannel\)\.Add\(PerChannel\).*)");
}
+ if (CPUTestUtils::with_cpu_x86_avx2_vnni_2()) {
+ // jit_gemm_BF16 kernels are not supported for conv,inner_product,matmul on avx2_vnni_2 platforms
+ retVector.emplace_back(R"(smoke_Conv_.*D_GEMM_BF16.*)");
+ retVector.emplace_back(
+ R"(smoke_GroupConv_.*D_Gemm_BF16/GroupConvolutionLayerCPUTest.CompareWithRefs.*primitive=jit_gemm.*)");
+ retVector.emplace_back(R"(smoke_.*MatMulLayerCPUTest.*INFERENCE_PRECISION_HINT=bf16.*_primitive=jit_gemm.*)");
+ }
+
return retVector;
}
diff --git a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp
index 6e3ef21c38b..90f4c2acb42 100644
--- a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp
+++ b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp
@@ -12,6 +12,9 @@
#include "transformations/rt_info/primitives_priority_attribute.hpp"
#include "utils/general_utils.h"
#include "utils/rt_info/memory_formats_attribute.hpp"
+#if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64)
+# include <xbyak/xbyak_util.h>
+#endif
namespace CPUTestUtils {
const char* CPUTestsBase::any_type = "any_type";
@@ -45,6 +48,22 @@ const char* CPUTestsBase::cpu_fmt2str(cpu_memory_format_t v) {
return "undef";
}
+#if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64)
+static Xbyak::util::Cpu& get_cpu_info() {
+ static Xbyak::util::Cpu cpu;
+ return cpu;
+}
+bool with_cpu_x86_avx2_vnni_2() {
+ return get_cpu_info().has(Xbyak::util::Cpu::tAVX2 | Xbyak::util::Cpu::tAVX_VNNI) &&
+ get_cpu_info().has(Xbyak::util::Cpu::tAVX_VNNI_INT8) &&
+ get_cpu_info().has(Xbyak::util::Cpu::tAVX_NE_CONVERT);
+}
+#else // OPENVINO_ARCH_X86 || OPENVINO_ARCH_X86_64
+bool with_cpu_x86_avx2_vnni_2() {
+ return false;
+}
+#endif // OPENVINO_ARCH_X86 || OPENVINO_ARCH_X86_64
+
cpu_memory_format_t CPUTestsBase::cpu_str2fmt(const char* str) {
#define CASE(_fmt) \
do { \
@@ -472,9 +491,10 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
if (it != configuration.end()) {
auto inferencePrecisionConfig = it->second.as<ov::element::Type>();
inferencePrecisionSetExplicitly = true;
- // TODO also need to check (dnnl::impl::cpu::x64::avx2_vnni_2)
- if ((inferencePrecisionConfig == ov::element::bf16 && ov::with_cpu_x86_avx512_core()) ||
- (inferencePrecisionConfig == ov::element::f16 && ov::with_cpu_x86_avx512_core_fp16()) ||
+ if ((inferencePrecisionConfig == ov::element::bf16 &&
+ (ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2())) ||
+ (inferencePrecisionConfig == ov::element::f16 &&
+ (ov::with_cpu_x86_avx512_core_fp16() || with_cpu_x86_avx2_vnni_2())) ||
(inferencePrecisionConfig == ov::element::f32) || (inferencePrecisionConfig == ov::element::dynamic)) {
inferencePrecision = inferencePrecisionConfig;
}
@@ -495,7 +515,8 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
ov::element::Type deducedType = opPrecision;
// enforceInferPrecision stage
if (inferencePrecision == ov::element::bf16) {
- deducedType = ov::with_cpu_x86_avx512_core() ? ov::element::bf16 : ov::element::f32;
+ deducedType =
+ (ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
}
// ngraph transform pipeline stage
@@ -505,7 +526,8 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
}
}
if (deducedType == ov::element::bf16) {
- deducedType = ov::with_cpu_x86_avx512_core() ? ov::element::bf16 : ov::element::f32;
+ deducedType =
+ (ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
} else if (deducedType == ov::element::f16) {
if (inferencePrecision != ov::element::f16 && inferencePrecision != ov::element::dynamic) {
deducedType = ov::element::f32;
diff --git a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp
index 1a77918142e..2e43e8c51b0 100644
--- a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp
+++ b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp
@@ -113,7 +113,7 @@ inline std::string nodeType2str(nodeType nt) {
return "GroupConvolutionBackpropData";
throw std::runtime_error("Undefined node type to convert to string!");
}
-
+bool with_cpu_x86_avx2_vnni_2();
class CPUTestsBase {
public:
typedef std::map<std::string, ov::Any> CPUInfo;
diff --git a/src/tests/functional/plugin/shared/include/snippets/mha.hpp b/src/tests/functional/plugin/shared/include/snippets/mha.hpp
index e024357fe0e..136a4f3b2cc 100644
--- a/src/tests/functional/plugin/shared/include/snippets/mha.hpp
+++ b/src/tests/functional/plugin/shared/include/snippets/mha.hpp
@@ -58,6 +58,7 @@ public:
protected:
std::shared_ptr<SnippetsFunctionBase> get_subgraph() const override;
void init_params(std::vector<InputShape>& input_shapes, ov::element::Type& prc, ov::AnyMap& additional_config) override;
+ void init_thresholds() override;
bool m_with_mul = false;
};
diff --git a/src/tests/functional/plugin/shared/src/snippets/mha.cpp b/src/tests/functional/plugin/shared/src/snippets/mha.cpp
index 0a8fcc77717..5ee1b18c17a 100644
--- a/src/tests/functional/plugin/shared/src/snippets/mha.cpp
+++ b/src/tests/functional/plugin/shared/src/snippets/mha.cpp
@@ -153,6 +153,17 @@ std::shared_ptr<SnippetsFunctionBase> MHA::get_subgraph() const {
return std::make_shared<ov::test::snippets::MHAFunction>(inputDynamicShapes, m_input_types, m_with_mul, is_with_reshape);
}
+void MHA::init_thresholds() {
+ MHABase::init_thresholds();
+ auto precision_hint = configuration.count(ov::hint::inference_precision.name())
+ ? configuration.at(ov::hint::inference_precision.name())
+ : ov::element::f32;
+ if (m_input_types.size() > 1 && m_input_types[0] == ov::element::bf16 && precision_hint == ov::element::f32) {
+ rel_threshold = 0.01f;
+ abs_threshold = 0.0078125f;
+ }
+}
+
void MHASelect::generate_inputs(const std::vector<ov::Shape>& targetInputStaticShapes) {
inputs.clear();
auto model_inputs = function->inputs();
diff --git a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp
index 5dd5029f279..525fe48fcaf 100644
--- a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp
+++ b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp
@@ -306,7 +306,7 @@ void SubgraphBaseTest::compile_model() {
std::cout << "[ PLUGIN ] `SubgraphBaseTest::compile_model()` is finished successfully. Duration is " << duration.count() << "s" << std::endl;
}
try {
- inference_precision = core->get_property(targetDevice, ov::hint::inference_precision);
+ inference_precision = compiledModel.get_property(ov::hint::inference_precision);
} catch (std::exception& e) {
std::cout << "[ WARNING ] Impossible to get Inference Precision with exception: " << e.what() << std::endl;
}