OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[PaddlePaddle] upgrade the paddle version to 3.0.0 (#31312)
Yuan Hu5faf4d448998
diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txtindex dd3377c0e95..e8cc9c55964 100644--- a/src/bindings/python/constraints.txt+++ b/src/bindings/python/constraints.txt@@ -19,7 +19,7 @@ packaging>=22.0# Frontendsh5py>=3.1.0,<3.15.0docopt~=0.6.2-paddlepaddle==2.6.2+paddlepaddle==3.0.0tensorflow>=1.15.5,<2.20.0protobuf>=3.18.1,<7.0.0onnx==1.17.0diff --git a/src/frontends/paddle/src/op/assign_value.cpp b/src/frontends/paddle/src/op/assign_value.cppindex a91236f63a7..b7545e0f6cc 100644--- a/src/frontends/paddle/src/op/assign_value.cpp+++ b/src/frontends/paddle/src/op/assign_value.cpp@@ -48,8 +48,13 @@ NamedOutputs assign_value(const NodeContext& node) {break;}case element::boolean: {- auto values = node.get_attribute<std::vector<int32_t>>("bool_values");- const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, values)};+ if (node.has_attribute("bool_values")) {+ auto values = node.get_attribute<std::vector<int32_t>>("bool_values");+ const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, values)};+ } else {+ auto values = node.get_attribute<std::vector<bool>>("values");+ const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, values)};+ }break;}case element::i64: {diff --git a/src/frontends/paddle/tests/CMakeLists.txt b/src/frontends/paddle/tests/CMakeLists.txtindex de51a707683..5340c41271a 100644--- a/src/frontends/paddle/tests/CMakeLists.txt+++ b/src/frontends/paddle/tests/CMakeLists.txt@@ -1,109 +1,5 @@# Copyright (C) 2018-2025 Intel Corporation# SPDX-License-Identifier: Apache-2.0#--set(TARGET_NAME "paddle_tests")--# Test model generating-set(PADDLE_REQ "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt")-if(Python3_Interpreter_FOUND)- execute_process(- COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/paddle_pip_check.py" ${PADDLE_REQ}- RESULT_VARIABLE EXIT_CODE- OUTPUT_VARIABLE OUTPUT_TEXT- ERROR_VARIABLE ERROR_TEXT)-endif()--if(NOT EXIT_CODE EQUAL 0)- set(paddlepaddle_FOUND OFF)- message(WARNING "Python requirement file ${PADDLE_REQ} is not installed, PaddlePaddle testing models weren't generated, some tests will fail due models not found")-else()- set(paddlepaddle_FOUND ON)-endif()--if(paddlepaddle_FOUND)- set(ctest_labels OV UNIT)-endif()--ov_add_test_target(- NAME ${TARGET_NAME}- ROOT ${CMAKE_CURRENT_SOURCE_DIR}- DEPENDENCIES- paddle_test_models- openvino_paddle_frontend- paddle_fe_standalone_build_test- LINK_LIBRARIES- openvino::cnpy- frontend_shared_test_classes- openvino_paddle_frontend- openvino::runtime- gtest_main_manifest- func_test_utils- ADD_CLANG_FORMAT- LABELS- ${ctest_labels} PADDLE_FE-)--set(TEST_PADDLE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/paddle_test_models)-target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODELS_DIRNAME=\"${TEST_PADDLE_MODELS_DIRNAME}/\")--if(paddlepaddle_FOUND)- execute_process(- COMMAND ${Python3_EXECUTABLE} -c "import paddle; print(paddle.__version__)"- OUTPUT_VARIABLE PADDLE_VERSION- OUTPUT_STRIP_TRAILING_WHITESPACE- )- message(STATUS "PaddlePaddle version: ${PADDLE_VERSION}")-- if(PADDLE_VERSION VERSION_GREATER_EQUAL "2.6.0" OR PADDLE_VERSION VERSION_EQUAL "0.0.0")- set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.5/ppdet/modeling/ops.py")- set(PADDLEDET_OPS_SHA256 "e3da816421698ee97bb272c4410a03c300ab92045b7c87cccb9e52a8c18bc088")- set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release25/ppdet/modeling/)- else()- set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.1/ppdet/modeling/ops.py")- set(PADDLEDET_OPS_SHA256 "5cc079eda295ed78b58fba8223c51d85a931a7069ecad51c6af5c2fd26b7a8cb")- set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release21/ppdet/modeling/)- endif()-- DownloadAndCheck(${PADDLEDET_OPS_URL} ${PADDLEDET_DIRNAME}/ops.py PADDLEDET_FATAL PADDLEDET_RESULT ${PADDLEDET_OPS_SHA256})-endif()--# If 'paddlepaddle' is not found, code will still be compiled, but models will not be generated and tests will fail-# This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have-# 'paddlepaddle' installed to check code style-if(PADDLEDET_RESULT)- set(TEST_PADDLE_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/paddle_test_models/)-- file(GLOB_RECURSE PADDLE_ALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/*.py)- set(OUT_FILE ${TEST_PADDLE_MODELS}/generate_done.txt)- add_custom_command(OUTPUT ${OUT_FILE}- COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLEDET_DIRNAME}- ${Python3_EXECUTABLE}- ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_wrapper.py- ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_scripts- ${TEST_PADDLE_MODELS}- DEPENDS ${PADDLE_ALL_SCRIPTS})- add_custom_target(paddle_test_models DEPENDS ${OUT_FILE})-- install(DIRECTORY ${TEST_PADDLE_MODELS}- DESTINATION tests/${TEST_PADDLE_MODELS_DIRNAME}- COMPONENT tests- EXCLUDE_FROM_ALL)--else()- # Produce warning message at build time as well- add_custom_command(OUTPUT unable_build_paddle_models.txt- COMMAND ${CMAKE_COMMAND}- -E cmake_echo_color --red "Warning: Unable to generate PaddlePaddle test models. Running '${TARGET_NAME}' will likely fail"- )- add_custom_target(paddle_test_models DEPENDS unable_build_paddle_models.txt)-endif()--# Fuzzy tests for PaddlePaddle use IE_CPU engine-if(ENABLE_INTEL_CPU)- add_dependencies(${TARGET_NAME} openvino_intel_cpu_plugin)-endif()--ov_build_target_faster(${TARGET_NAME} PCH)-add_subdirectory(standalone_build)+add_subdirectory(pdmodel_test)diff --git a/src/frontends/paddle/tests/common.cmake b/src/frontends/paddle/tests/common.cmakenew file mode 100644index 00000000000..06c47589473--- /dev/null+++ b/src/frontends/paddle/tests/common.cmake@@ -0,0 +1,116 @@+# Copyright (C) 2018-2025 Intel Corporation+# SPDX-License-Identifier: Apache-2.0+#++# Test model generating+set(CODE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)+set(PADDLE_REQ "${CODE_ROOT_DIR}/requirements.txt")+if(Python3_Interpreter_FOUND)+ execute_process(+ COMMAND ${Python3_EXECUTABLE} "${CODE_ROOT_DIR}/paddle_pip_check.py" ${PADDLE_REQ}+ RESULT_VARIABLE EXIT_CODE+ OUTPUT_VARIABLE OUTPUT_TEXT+ ERROR_VARIABLE ERROR_TEXT)+endif()++if(NOT EXIT_CODE EQUAL 0)+ set(paddlepaddle_FOUND OFF)+ message(WARNING "Python requirement file ${PADDLE_REQ} is not installed, PaddlePaddle testing models weren't generated, some tests will fail due models not found")+else()+ set(paddlepaddle_FOUND ON)+endif()++ov_add_test_target(+ NAME ${TARGET_NAME}+ ROOT ${CODE_ROOT_DIR}+ DEPENDENCIES+ paddle_test_models_${PD_MODEL_TAG}+ openvino_paddle_frontend+ paddle_fe_standalone_build_test+ LINK_LIBRARIES+ openvino::cnpy+ frontend_shared_test_classes+ openvino_paddle_frontend+ openvino::runtime+ gtest_main_manifest+ func_test_utils+ ADD_CLANG_FORMAT+ LABELS+ ${ctest_labels} PADDLE_FE+)+++if(paddlepaddle_FOUND)+ execute_process(+ COMMAND ${Python3_EXECUTABLE} -c "import paddle; print(paddle.__version__)"+ OUTPUT_VARIABLE PADDLE_VERSION+ OUTPUT_STRIP_TRAILING_WHITESPACE+ )+ message(STATUS "PaddlePaddle version: ${PADDLE_VERSION}")+ if(PADDLE_VERSION VERSION_GREATER_EQUAL "3.0.0" OR PADDLE_VERSION VERSION_EQUAL "0.0.0")+ set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.8.1/ppdet/modeling/ops.py")+ set(PADDLEDET_OPS_SHA256 "9b3193d91d617a6c9e6ef49896dc8612cbcbb67c146d0a76ce16bf2b64dac86f")+ set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release281/ppdet/modeling/)+ set(paddle_gen_tag "ge3")+ elseif(PADDLE_VERSION VERSION_GREATER_EQUAL "2.6.0")+ set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.5/ppdet/modeling/ops.py")+ set(PADDLEDET_OPS_SHA256 "e3da816421698ee97bb272c4410a03c300ab92045b7c87cccb9e52a8c18bc088")+ set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release25/ppdet/modeling/)+ set(paddle_gen_tag "ge2")+ else()+ set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.1/ppdet/modeling/ops.py")+ set(PADDLEDET_OPS_SHA256 "5cc079eda295ed78b58fba8223c51d85a931a7069ecad51c6af5c2fd26b7a8cb")+ set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release21/ppdet/modeling/)+ set(paddle_gen_tag "ge2")+ endif()++ DownloadAndCheck(${PADDLEDET_OPS_URL} ${PADDLEDET_DIRNAME}/ops.py PADDLEDET_FATAL PADDLEDET_RESULT ${PADDLEDET_OPS_SHA256})+else()+ set(paddle_gen_tag "unkown")+endif()+++set(TEST_PADDLE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/paddle_test_models/${PD_MODEL_TAG})+target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODELS_DIRNAME=\"${TEST_PADDLE_MODELS_DIRNAME}/\")+target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODEL_EXT=\"${TEST_PADDLE_MODEL_EXT}\")+target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_ENABLE_PIR=\"${ENABLE_PIR}\")+target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_GEN_TAG=\"${paddle_gen_tag}\")++# If 'paddlepaddle' is not found, code will still be compiled, but models will not be generated and tests will fail+# This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have+# 'paddlepaddle' installed to check code style+if(PADDLEDET_RESULT)+ set(TEST_PADDLE_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/paddle_test_models/${PD_MODEL_TAG}/)++ file(GLOB_RECURSE PADDLE_ALL_SCRIPTS ${CODE_ROOT_DIR}/*.py)+ set(OUT_FILE ${TEST_PADDLE_MODELS}/generate_done_${PD_MODEL_TAG}.txt)+ add_custom_command(OUTPUT ${OUT_FILE}+ COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLEDET_DIRNAME} FLAGS_enable_pir_api=${ENABLE_PIR}+ ${Python3_EXECUTABLE}+ ${CODE_ROOT_DIR}/test_models/gen_wrapper.py+ ${CODE_ROOT_DIR}/test_models/gen_scripts+ ${TEST_PADDLE_MODELS}+ DEPENDS ${PADDLE_ALL_SCRIPTS})+ add_custom_target(paddle_test_models_${PD_MODEL_TAG} DEPENDS ${OUT_FILE})++ install(DIRECTORY ${TEST_PADDLE_MODELS}+ DESTINATION tests/${TEST_PADDLE_MODELS_DIRNAME}+ COMPONENT tests+ EXCLUDE_FROM_ALL)++else()+ # Produce warning message at build time as well+ add_custom_command(OUTPUT unable_build_paddle_models.txt+ COMMAND ${CMAKE_COMMAND}+ -E cmake_echo_color --red "Warning: Unable to generate PaddlePaddle test models. Running '${TARGET_NAME}' will likely fail"+ )+ add_custom_target(paddle_test_models_${PD_MODEL_TAG} DEPENDS unable_build_paddle_models.txt)+endif()++# Fuzzy tests for PaddlePaddle use IE_CPU engine+if(ENABLE_INTEL_CPU)+ add_dependencies(${TARGET_NAME} openvino_intel_cpu_plugin)+endif()++ov_build_target_faster(${TARGET_NAME} PCH)+diff --git a/src/frontends/paddle/tests/cut_specific_model.cpp b/src/frontends/paddle/tests/cut_specific_model.cppindex bb7c38f7871..d6576ca50b3 100644--- a/src/frontends/paddle/tests/cut_specific_model.cpp+++ b/src/frontends/paddle/tests/cut_specific_model.cpp@@ -14,10 +14,17 @@ static CutModelParam getTestData_2in_2out() {CutModelParam res;res.m_frontEndName = PADDLE_FE;res.m_modelsPath = std::string(TEST_PADDLE_MODELS_DIRNAME);- res.m_modelName = "2in_2out/2in_2out.pdmodel";+ res.m_modelName = "2in_2out/2in_2out" + std::string(TEST_PADDLE_MODEL_EXT);res.m_oldInputs = {"inputX1", "inputX2"};res.m_newInputs = {"add1.tmp_0"};- res.m_oldOutputs = {"save_infer_model/scale_0.tmp_0", "save_infer_model/scale_1.tmp_0"};+ if (std::string(TEST_GEN_TAG) == "ge3") {+ res.m_oldOutputs = {"relu3a.tmp_0/Result", "relu3b.tmp_0/Result"};+ } else if (std::string(TEST_GEN_TAG) == "ge2") {+ res.m_oldOutputs = {"save_infer_model/scale_0.tmp_0", "save_infer_model/scale_1.tmp_0"};+ } else {+ // Unexpected TEST_GEN_TAG value. This branch is reached if TEST_GEN_TAG is neither "ge2" nor "ge3".+ throw std::runtime_error("Unsupported TEST_PADDLE_VERSION: " + std::string(TEST_GEN_TAG));+ }res.m_newOutputs = {"add2.tmp_0"};res.m_tensorValueName = "conv2dX2.tmp_0";res.m_tensorValue = {1, 2, 3, 4, 5, 6, 7, 8, 9};diff --git a/src/frontends/paddle/tests/pdmodel_test/CMakeLists.txt b/src/frontends/paddle/tests/pdmodel_test/CMakeLists.txtnew file mode 100644index 00000000000..ecb554d2676--- /dev/null+++ b/src/frontends/paddle/tests/pdmodel_test/CMakeLists.txt@@ -0,0 +1,9 @@+# Copyright (C) 2018-2025 Intel Corporation+# SPDX-License-Identifier: Apache-2.0+#+set(TARGET_NAME "paddle_tests")+set(PD_MODEL_TAG "pdmodel")+set(TEST_PADDLE_MODEL_EXT ".pdmodel")+set(ENABLE_PIR "0")+include(../common.cmake)+diff --git a/src/frontends/paddle/tests/read_paddle_model_test.cpp b/src/frontends/paddle/tests/read_paddle_model_test.cppindex a768028e01e..dac4a739c1a 100644--- a/src/frontends/paddle/tests/read_paddle_model_test.cpp+++ b/src/frontends/paddle/tests/read_paddle_model_test.cpp@@ -18,14 +18,17 @@#include "openvino/pass/serialize.hpp"TEST(Paddle_Reader_Tests, LoadModelMemoryToCore) {- auto model =- FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) + "conv2d_relu/conv2d_relu.pdmodel");+ auto model = FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) ++ "conv2d_relu/conv2d_relu" + std::string(TEST_PADDLE_MODEL_EXT));auto param = FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) +"conv2d_relu/conv2d_relu.pdiparams");ov::Core core;auto read_file = [&](const std::string& file_name, size_t& size) {FILE* sFile = fopen(file_name.c_str(), "r");+ if (sFile == nullptr) {+ return (uint8_t*)nullptr;+ }fseek(sFile, 0, SEEK_END);size = ftell(sFile);uint8_t* ss = (uint8_t*)malloc(size);@@ -40,7 +43,9 @@ TEST(Paddle_Reader_Tests, LoadModelMemoryToCore) {size_t xml_size, bin_size;auto xml_ptr = read_file(model, xml_size);+ ASSERT_TRUE(xml_ptr != nullptr) << "can't open " << model;auto bin_ptr = read_file(param, bin_size);+ ASSERT_TRUE(bin_ptr != nullptr) << "can't open " << param;ov::Tensor weight_tensor = ov::Tensor(ov::element::u8, {1, bin_size}, bin_ptr);std::string model_str = std::string((char*)xml_ptr, xml_size);auto function = core.read_model(model_str, weight_tensor);@@ -62,15 +67,24 @@ TEST(Paddle_Reader_Tests, LoadModelMemoryToCore) {const auto relu = std::make_shared<ov::opset1::Relu>(conv2d->output(0));relu->set_friendly_name("relu_0.tmp_0");relu->output(0).get_tensor().add_names({"relu_0.tmp_0"});- const auto bias = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 0.0);- const auto scale = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 1.0);- const auto mul = std::make_shared<ov::opset1::Multiply>(relu->output(0), scale);- const auto add = std::make_shared<ov::opset1::Add>(mul->output(0), bias);- add->set_friendly_name("scale_0.tmp_0");- add->output(0).get_tensor().add_names({"save_infer_model/scale_0.tmp_0"});- const auto result = std::make_shared<ov::opset1::Result>(add->output(0));- result->set_friendly_name("save_infer_model/scale_0.tmp_0/Result");+ std::shared_ptr<ov::opset1::Result> result;+ if (std::string(TEST_GEN_TAG) == "ge3") {+ result = std::make_shared<ov::opset1::Result>(relu->output(0));+ result->set_friendly_name("save_infer_model/scale_0.tmp_0");+ } else if (std::string(TEST_GEN_TAG) == "ge2") {+ const auto bias = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 0.0);+ const auto scale = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 1.0);+ const auto mul = std::make_shared<ov::opset1::Multiply>(relu->output(0), scale);+ const auto add = std::make_shared<ov::opset1::Add>(mul->output(0), bias);+ add->set_friendly_name("scale_0.tmp_0");+ add->output(0).get_tensor().add_names({"save_infer_model/scale_0.tmp_0"});++ result = std::make_shared<ov::opset1::Result>(add->output(0));+ result->set_friendly_name("save_infer_model/scale_0.tmp_0/Result");+ } else {+ ASSERT_TRUE(false) << "Unsupported TEST_GEN_TAG: " << std::string(TEST_GEN_TAG);+ }const auto reference = std::make_shared<ov::Model>(ov::OutputVector{result}, ov::ParameterVector{data}, "Model0");const FunctionsComparator func_comparator = FunctionsComparator::with_default().enable(FunctionsComparator::NONE);@@ -81,7 +95,8 @@ TEST(Paddle_Reader_Tests, LoadModelMemoryToCore) {}TEST(Paddle_Reader_Tests, ImportBasicModelToCore) {- auto model = FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) + "relu/relu.pdmodel");+ auto model = FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) + "relu/relu" ++ std::string(TEST_PADDLE_MODEL_EXT));ov::Core core;auto function = core.read_model(FrontEndTestUtils::make_model_path(model));@@ -94,15 +109,22 @@ TEST(Paddle_Reader_Tests, ImportBasicModelToCore) {const auto relu = std::make_shared<ov::opset1::Relu>(data->output(0));relu->set_friendly_name("relu_0.tmp_0");relu->output(0).get_tensor().add_names({"relu_0.tmp_0"});- const auto bias = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 0.0);- const auto scale = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 1.0);- const auto mul = std::make_shared<ov::opset1::Multiply>(relu->output(0), scale);- const auto add = std::make_shared<ov::opset1::Add>(mul->output(0), bias);- add->set_friendly_name("save_infer_model/scale_0.tmp_0");- add->output(0).get_tensor().add_names({"save_infer_model/scale_0.tmp_0"});-- const auto result = std::make_shared<ov::opset1::Result>(add->output(0));- result->set_friendly_name("save_infer_model/scale_0.tmp_0/Result");+ std::shared_ptr<ov::opset1::Result> result;+ if (std::string(TEST_GEN_TAG) == "ge3") {+ result = std::make_shared<ov::opset1::Result>(relu->output(0));+ result->set_friendly_name("save_infer_model/scale_0.tmp_0");+ } else if (std::string(TEST_GEN_TAG) == "ge2") {+ const auto bias = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 0.0);+ const auto scale = std::make_shared<ov::opset1::Constant>(ov::element::f32, ov::Shape{}, 1.0);+ const auto mul = std::make_shared<ov::opset1::Multiply>(relu->output(0), scale);+ const auto add = std::make_shared<ov::opset1::Add>(mul->output(0), bias);+ add->set_friendly_name("save_infer_model/scale_0.tmp_0");+ add->output(0).get_tensor().add_names({"save_infer_model/scale_0.tmp_0"});+ result = std::make_shared<ov::opset1::Result>(add->output(0));+ result->set_friendly_name("save_infer_model/scale_0.tmp_0/Result");+ } else {+ ASSERT_TRUE(false) << "Unsupported TEST_GEN_TAG: " << std::string(TEST_GEN_TAG);+ }const auto reference = std::make_shared<ov::Model>(ov::OutputVector{result}, ov::ParameterVector{data}, "Model0");const FunctionsComparator func_comparator = FunctionsComparator::with_default().enable(FunctionsComparator::NAMES);@@ -112,7 +134,7 @@ TEST(Paddle_Reader_Tests, ImportBasicModelToCore) {#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)TEST(Paddle_Reader_Tests, ImportBasicModelToCoreWstring) {- std::string win_dir_path{TEST_PADDLE_MODELS_DIRNAME "relu/relu.pdmodel"};+ std::string win_dir_path{TEST_PADDLE_MODELS_DIRNAME "relu/relu" + std::string(TEST_PADDLE_MODEL_EXT)};win_dir_path = FrontEndTestUtils::make_model_path(win_dir_path);std::wstring wmodel =ov::test::utils::addUnicodePostfixToPath(win_dir_path, ov::test::utils::test_unicode_postfix_vector[0]);diff --git a/src/frontends/paddle/tests/telemetry.cpp b/src/frontends/paddle/tests/telemetry.cppindex e5b9015a1cc..ad3ac5eae46 100644--- a/src/frontends/paddle/tests/telemetry.cpp+++ b/src/frontends/paddle/tests/telemetry.cpp@@ -14,11 +14,17 @@ static TelemetryFEParam getTestData() {TelemetryFEParam res;res.m_frontEndName = PADDLE_FE;res.m_modelsPath = std::string(TEST_PADDLE_MODELS_DIRNAME);- res.m_modelName = "relu/relu.pdmodel";- res.m_expected_events = {{std::make_tuple("mo", "op_count", "paddle_feed", 1),- std::make_tuple("mo", "op_count", "paddle_fetch", 1),- std::make_tuple("mo", "op_count", "paddle_relu", 1),- std::make_tuple("mo", "op_count", "paddle_scale", 1)}};+ res.m_modelName = "relu/relu" + std::string(TEST_PADDLE_MODEL_EXT);+ if (std::string(TEST_GEN_TAG) == "ge3") {+ res.m_expected_events = {{std::make_tuple("mo", "op_count", "paddle_feed", 1),+ std::make_tuple("mo", "op_count", "paddle_fetch", 1),+ std::make_tuple("mo", "op_count", "paddle_relu", 1)}};+ } else if (std::string(TEST_GEN_TAG) == "ge2") {+ res.m_expected_events = {{std::make_tuple("mo", "op_count", "paddle_feed", 1),+ std::make_tuple("mo", "op_count", "paddle_fetch", 1),+ std::make_tuple("mo", "op_count", "paddle_relu", 1),+ std::make_tuple("mo", "op_count", "paddle_scale", 1)}};+ }return res;}diff --git a/src/frontends/paddle/tests/test_models/gen_scripts/generate_cond.py b/src/frontends/paddle/tests/test_models/gen_scripts/generate_cond.pyindex 3c492ccf7cd..8a8e7d00db2 100644--- a/src/frontends/paddle/tests/test_models/gen_scripts/generate_cond.py+++ b/src/frontends/paddle/tests/test_models/gen_scripts/generate_cond.py@@ -106,7 +106,7 @@ exportModel('conditional_block_2inputs_dyn_2outputs', test_model_dyn_2outputs, [""""""""""""""""""""""""""""""""""""""""""""""""""""""-"""question: how to make test case for only one+"""question: how to make test case for only oneconditional_block ?? """""""""""""""""""""""""""""""""""""""""""""""""""""""""@paddle.jit.to_static@@ -121,11 +121,11 @@ def test_model_dyn_conditionalblock_only(a):a = paddle.to_tensor([[1.0, 2.0, 3.0],[4.0, 5.0, 6.0]])# 95436: sporadic failure-exportModel('conditional_block_dyn_conditionalblock_only', test_model_dyn_conditionalblock_only, [a], target_dir=sys.argv[1])+exportModel('conditional_block_dyn_conditionalblock_only', test_model_dyn_conditionalblock_only, [a], dyn_shapes = [[None, 3]], target_dir=sys.argv[1])""""""""""""""""""""""""""""""""""""""""""""""""""""""-"""return type: tensor, tuple(tensor), list(tensor)+"""return type: tensor, tuple(tensor), list(tensor)question: how to work with LoDTensorArray ?? """""""""""""""""""""""""""""""""""""""""""""""""""""""""diff --git a/src/frontends/paddle/tests/test_models/gen_scripts/generate_conv2d_relu.py b/src/frontends/paddle/tests/test_models/gen_scripts/generate_conv2d_relu.pyindex a411563fa20..e65fee19186 100644--- a/src/frontends/paddle/tests/test_models/gen_scripts/generate_conv2d_relu.py+++ b/src/frontends/paddle/tests/test_models/gen_scripts/generate_conv2d_relu.py@@ -5,7 +5,7 @@ import paddleimport numpy as npimport sys-from save_model import saveModel+from save_model import saveModelif paddle.__version__ >= '2.6.0':import paddle.base as fluid@@ -24,7 +24,6 @@ else:x = fluid.data(name='xxx', shape=[1, 3, 4, 4], dtype='float32')test_layer = fluid.layers.conv2d(input=x, num_filters=5, filter_size=(1, 1), stride=(1, 1), padding=(1, 1),dilation=(1, 1), groups=1, bias_attr=False)-if paddle.__version__ >= '2.0.0':relu = paddle.nn.functional.relu(test_layer)else:diff --git a/src/frontends/paddle/tests/test_models/gen_scripts/generate_loop.py b/src/frontends/paddle/tests/test_models/gen_scripts/generate_loop.pyindex 27525c8bec4..e552a95cc8c 100644--- a/src/frontends/paddle/tests/test_models/gen_scripts/generate_loop.py+++ b/src/frontends/paddle/tests/test_models/gen_scripts/generate_loop.py@@ -103,7 +103,7 @@ def loop_dyn():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xt = paddle.full(shape=[1], fill_value=10, dtype='int64')j = i + 1@@ -123,7 +123,7 @@ def loop_dyn_x():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xt = paddle.full(shape=[1], fill_value=10, dtype='int64')@@ -141,7 +141,7 @@ def loop_if():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xt = paddle.full(shape=[1], fill_value=10, dtype='int64')@@ -162,7 +162,7 @@ def loop_if_loop():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xt = paddle.full(shape=[1], fill_value=10, dtype='int64')@@ -184,7 +184,7 @@ def loop_if_loop_if():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xt = paddle.full(shape=[1], fill_value=10, dtype='int64')@@ -210,7 +210,7 @@ def loop_if_loop_complex():def test_model(x, y):i = paddle.full(shape=[1], fill_value=0, dtype='int64')j = paddle.full(shape=[1], fill_value=0, dtype='int64')-+i = i + xj = j + yt = paddle.full(shape=[1], fill_value=10, dtype='int64')@@ -241,7 +241,7 @@ def loop_tensor_array():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int32')-+t = paddle.full(shape=[1], fill_value=10, dtype='int32')y = paddle.full(shape=[30,3], fill_value=2, dtype='float32')@@ -261,7 +261,7 @@ def loop_if_tensor_array():@paddle.jit.to_staticdef test_model(x):i = paddle.full(shape=[1], fill_value=0, dtype='int32')-+t = paddle.full(shape=[1], fill_value=10, dtype='int32')y = paddle.full(shape=[30,3], fill_value=2, dtype='float32')@@ -295,4 +295,6 @@ if __name__ == "__main__":print(loop_if_loop_if().numpy())print(loop_if_loop_complex())print(loop_tensor_array().numpy())- x, y = loop_if_tensor_array()+ #https://github.com/PaddlePaddle/Paddle/issues/73919+ #CVS-167349+ #x, y = loop_if_tensor_array()diff --git a/src/frontends/paddle/tests/test_models/gen_scripts/generate_place_test_model.py b/src/frontends/paddle/tests/test_models/gen_scripts/generate_place_test_model.pyindex 56966dff680..9bcc17a12cc 100644--- a/src/frontends/paddle/tests/test_models/gen_scripts/generate_place_test_model.py+++ b/src/frontends/paddle/tests/test_models/gen_scripts/generate_place_test_model.py@@ -23,6 +23,11 @@ def paddle_rnn_lstm(input_size, hidden_size, layers, direction):prev_c = paddle.ones(shape=[layers * num_of_directions, 4, hidden_size], dtype=np.float32, name="const_2")y, (h, c) = rnn(data, (prev_h, prev_c))+ # in paddle 2.6.2, it alway add a scale in the generated model, but after updated to 3.0.0, the scale is removed,+ output1 = paddle.scale(y, scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)+ output2 = paddle.scale(h, scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)+ output3 = paddle.scale(c, scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)+relu_1 = paddle.nn.functional.relu(c, name="relu_1")relu_2 = paddle.nn.functional.relu(c, name="relu_2")relu_3 = paddle.nn.functional.relu(c, name="relu_3")@@ -33,12 +38,12 @@ def paddle_rnn_lstm(input_size, hidden_size, layers, direction):outs = exe.run(feed={'x': np.ones([4, 3, input_size]).astype(np.float32)},- fetch_list=[y, h, c],+ fetch_list=[output1, output2, output3],program=main_program)if paddle.__version__ >= '2.0.0':feed_vars = [data]- fetch_vars = [y, h, c, relu_1, relu_2, relu_3]+ fetch_vars = [output1, output2, output3, relu_1, relu_2, relu_3]saveModel("place_test_model", exe, feed_vars=feed_vars,fetchlist=fetch_vars,inputs=[np.ones([4, 3, input_size]).astype(np.float32)],@@ -66,7 +71,7 @@ def paddle_rnn_lstm(input_size, hidden_size, layers, direction):else:saveModel("place_test_model", exe, feed_vars=[data],- fetch_vars=[y, h, c, relu_1, relu_2, relu_3],+ fetch_vars=[output1, output2, output3, relu_1, relu_2, relu_3],inputs=[np.ones([4, 3, input_size]).astype(np.float32)],outputs=outs, target_dir=sys.argv[1])