Skip to content

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

[ONNX FE] Add support for LpPool operation (#37172)

Maxim Vafin9876b3114b10
diff --git a/docs/articles_en/documentation/compatibility-and-support/supported-operations.rst b/docs/articles_en/documentation/compatibility-and-support/supported-operations.rst
index 77b1f9bf986..4bc896d76d9 100644
--- a/docs/articles_en/documentation/compatibility-and-support/supported-operations.rst
+++ b/docs/articles_en/documentation/compatibility-and-support/supported-operations.rst
@@ -163,6 +163,7 @@ Data as of OpenVINO 2025.4.1 (December 18, 2025).
LogSoftmax
Loop
LpNormalization
+ LpPool
LRN
LSTM
MatMul
diff --git a/src/frontends/onnx/docs/supported_ops.md b/src/frontends/onnx/docs/supported_ops.md
index 51924ad7bca..1166a551115 100644
--- a/src/frontends/onnx/docs/supported_ops.md
+++ b/src/frontends/onnx/docs/supported_ops.md
@@ -103,7 +103,7 @@ OpenVINO provides support for operations of Default Opset (empty in table below)
| |LogSoftmax |13, 1 |13, 11, 1 | |
| |Loop |1 |21, 19, 16, 13, 11, 1 | |
| |LpNormalization |1 |22, 1 | |
-| |LpPool | |22, 18, 11, 2, 1 | |
+| |LpPool |2, 1 |22, 18, 11, 2, 1 | |
| |MatMul |1 |13, 9, 1 | |
| |MatMulInteger |10 |10 | |
| |Max |8, 1 |13, 12, 8, 6, 1 | |
diff --git a/src/frontends/onnx/frontend/src/op/lp_pool.cpp b/src/frontends/onnx/frontend/src/op/lp_pool.cpp
index 044f8603b87..a7b0cc5cc34 100644
--- a/src/frontends/onnx/frontend/src/op/lp_pool.cpp
+++ b/src/frontends/onnx/frontend/src/op/lp_pool.cpp
@@ -10,6 +10,7 @@
#include "openvino/op/reshape.hpp"
#include "utils/common.hpp"
#include "utils/norm.hpp"
+#include "utils/pooling_factory.hpp"
#include "utils/split.hpp"
using namespace ov::op;
using ov::Shape;
@@ -55,8 +56,29 @@ ov::OutputVector global_lp_pool(const ov::frontend::onnx::Node& node) {
return {std::make_shared<v0::Concat>(slices, channel_axis)};
}
-ONNX_OP("GlobalLpPool", OPSET_SINCE(1), ai_onnx::opset_1::global_lp_pool);
+ov::OutputVector lp_pool(const ov::frontend::onnx::Node& node) {
+ // In opset 1 the 'p' attribute is a float, since opset 2 it is an integer.
+ const auto p_norm = node.get_attribute_value<float>("p", 2.f);
+ return pooling::PoolingFactory(node).make_lp_pool(p_norm);
+}
+
+static bool register_multiple_translators(void) {
+ ONNX_OP_M("GlobalLpPool", OPSET_SINCE(1), ai_onnx::opset_1::global_lp_pool);
+ ONNX_OP_M("LpPool", OPSET_IN(1), ai_onnx::opset_1::lp_pool);
+ return true;
+}
+
+static bool registered = register_multiple_translators();
} // namespace opset_1
+
+namespace opset_2 {
+ov::OutputVector lp_pool(const ov::frontend::onnx::Node& node) {
+ const auto p_norm = node.get_attribute_value<std::int64_t>("p", 2);
+ return pooling::PoolingFactory(node).make_lp_pool(static_cast<float>(p_norm));
+}
+
+ONNX_OP("LpPool", OPSET_SINCE(2), ai_onnx::opset_2::lp_pool);
+} // namespace opset_2
} // namespace ai_onnx
} // namespace onnx
} // namespace frontend
diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp
index 14bfc9f5271..034f3013d65 100644
--- a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp
+++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp
@@ -6,11 +6,17 @@
#include <iterator>
+#include "exceptions.hpp"
#include "openvino/core/coordinate_diff.hpp"
#include "openvino/frontend/exception.hpp"
+#include "openvino/op/abs.hpp"
#include "openvino/op/avg_pool.hpp"
#include "openvino/op/constant.hpp"
+#include "openvino/op/convert.hpp"
+#include "openvino/op/convert_like.hpp"
#include "openvino/op/max_pool.hpp"
+#include "openvino/op/multiply.hpp"
+#include "openvino/op/power.hpp"
#include "openvino/op/transpose.hpp"
#include "utils/convpool.hpp"
@@ -53,8 +59,7 @@ PoolingFactory::PoolingFactory(const Node& node)
m_storage_order = static_cast<StorageOrder>(node.get_attribute_value<int64_t>("storage_order", 0));
}
-ov::OutputVector PoolingFactory::make_avg_pool() const {
- const bool count_include_pad = m_onnx_node.get_attribute_value<std::int64_t>("count_include_pad", 0);
+ov::Output<ov::Node> PoolingFactory::make_avg_pool_op(const ov::Output<ov::Node>& data, bool exclude_pad) const {
const bool is_ceil_mode = m_rounding_type == ov::op::RoundingType::CEIL;
const bool has_dilations = std::any_of(m_dilations.begin(), m_dilations.end(), [](size_t d) {
@@ -62,26 +67,66 @@ ov::OutputVector PoolingFactory::make_avg_pool() const {
});
if (!has_dilations && !is_ceil_mode) {
- return {std::make_shared<v1::AvgPool>(m_inputs.at(0),
- m_strides,
- m_padding_below,
- m_padding_above,
- m_kernel_shape,
- !count_include_pad,
- m_rounding_type,
- m_auto_pad)};
+ return std::make_shared<v1::AvgPool>(data,
+ m_strides,
+ m_padding_below,
+ m_padding_above,
+ m_kernel_shape,
+ exclude_pad,
+ m_rounding_type,
+ m_auto_pad);
}
// ONNX ceil_mode must not let a window start in padding; only CEIL_TORCH enforces that.
const auto rounding_type = is_ceil_mode ? ov::op::RoundingType::CEIL_TORCH : m_rounding_type;
- return {std::make_shared<v16::AvgPool>(m_inputs.at(0),
- m_strides,
- m_dilations,
- m_padding_below,
- m_padding_above,
- m_kernel_shape,
- !count_include_pad,
- rounding_type,
- m_auto_pad)};
+ return std::make_shared<v16::AvgPool>(data,
+ m_strides,
+ m_dilations,
+ m_padding_below,
+ m_padding_above,
+ m_kernel_shape,
+ exclude_pad,
+ rounding_type,
+ m_auto_pad);
+}
+
+ov::OutputVector PoolingFactory::make_avg_pool() const {
+ const bool count_include_pad = m_onnx_node.get_attribute_value<std::int64_t>("count_include_pad", 0);
+ return {make_avg_pool_op(m_inputs.at(0), !count_include_pad)};
+}
+
+ov::OutputVector PoolingFactory::make_lp_pool(float p_norm) const {
+ CHECK_VALID_NODE(m_onnx_node, p_norm > 0.f, "Only positive values are supported for 'p' attribute.");
+
+ const auto& data = m_inputs.at(0);
+
+ // Lp pooling is a sum of |x|^p over a pooling window, followed by the p-th root.
+ // The sum is obtained from an average pooling which always divides by the (constant)
+ // kernel volume, hence exclude_pad has to be disabled.
+ // The norm is computed in f32 regardless of the input's element type to avoid overflow
+ // or precision loss for reduced-precision inputs (e.g. fp16 can already overflow with
+ // p=2 once |x| > 256), then converted back to the original type at the end.
+ // f64 is deliberately not preserved here: Abs/Power reference evaluate() only support
+ // {f32, i32, i64, u32, u64}, so an f64 Abs/Power would not be executable by any backend
+ // (including the interpreter/template one), unlike a plain f64 AveragePool.
+ ov::Output<ov::Node> pooled = std::make_shared<v0::Convert>(data, ov::element::f32);
+ pooled = std::make_shared<v0::Abs>(pooled);
+ if (p_norm != 1.f) {
+ const auto p_const = v0::Constant::create(ov::element::f32, ov::Shape{}, {p_norm});
+ pooled = std::make_shared<v1::Power>(pooled, p_const);
+ }
+
+ pooled = make_avg_pool_op(pooled, false);
+
+ const auto kernel_volume =
+ v0::Constant::create(ov::element::f32, ov::Shape{}, {static_cast<float>(shape_size(m_kernel_shape))});
+ pooled = std::make_shared<v1::Multiply>(pooled, kernel_volume);
+
+ if (p_norm != 1.f) {
+ const auto inv_p = v0::Constant::create(ov::element::f32, ov::Shape{}, {1.f / p_norm});
+ pooled = std::make_shared<v1::Power>(pooled, inv_p);
+ }
+
+ return {std::make_shared<v1::ConvertLike>(pooled, data)};
}
ov::OutputVector PoolingFactory::make_max_pool() const {
diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp
index 11629038655..1cc232603ea 100644
--- a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp
+++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp
@@ -25,8 +25,9 @@ namespace pooling {
/// \note This factory is intended for creating pooling operations like:
/// - AveragePool
/// - MaxPool
+/// - LpPool
///
-/// This class holds all common attributes like srides, dilations,
+/// This class holds all common attributes like strides, dilations,
/// paddings, kernel shape and auto_pad type.
class PoolingFactory {
public:
@@ -48,6 +49,16 @@ public:
/// \brief Creates max pooling ONNX operation with 2 outputs (values and indices).
ov::OutputVector make_max_pool_with_indices() const;
+ ///
+ /// \brief Creates Lp pooling ONNX operation.
+ ///
+ /// \param[in] p_norm The p value of the Lp norm computed over each pooling window.
+ /// Non-integer values are supported, as required by the opset 1 schema.
+ ///
+ /// \return Vector of output nodes.
+ ///
+ ov::OutputVector make_lp_pool(float p_norm) const;
+
protected:
Node m_onnx_node;
@@ -63,6 +74,13 @@ protected:
enum class StorageOrder : int64_t { ROW_MAJOR = 0, COLUMN_MAJOR = 1 };
StorageOrder m_storage_order;
+
+private:
+ /// \brief Creates an average pooling operation matching the attributes of the ONNX node.
+ ///
+ /// \param[in] data The tensor to be pooled.
+ /// \param[in] exclude_pad Determines whether zero-padded values are counted in the divisor.
+ ov::Output<ov::Node> make_avg_pool_op(const ov::Output<ov::Node>& data, bool exclude_pad) const;
};
} // namespace pooling
} // namespace onnx
diff --git a/src/frontends/onnx/tests/__init__.py b/src/frontends/onnx/tests/__init__.py
index 19df22f32b3..31a386feb44 100644
--- a/src/frontends/onnx/tests/__init__.py
+++ b/src/frontends/onnx/tests/__init__.py
@@ -141,7 +141,6 @@ xfail_issue_119900 = xfail_test(reason="While validating ONNX node '<Node(Resize
"tf_half_pixel_for_nn, asymmetric, align_corners, pytorch_half_pixel, "
"half_pixel")
xfail_issue_119903 = xfail_test(reason="DeformConv operation is not supported")
-xfail_issue_119906 = xfail_test(reason="LpPool operation is not supported")
xfail_issue_119919 = xfail_test(reason="While validating ONNX node '<Node(Pad): y>': Unsupported padding mode: [wrap]")
xfail_issue_119922 = xfail_test(reason="ai.onnx.ml operators domain isn't supported")
xfail_issue_119925 = xfail_test(reason="AveragePool AssertionError: Not equal to tolerance rtol=0.001, atol=1e-07")
diff --git a/src/frontends/onnx/tests/models/lp_pool_opset1_float_p.prototxt b/src/frontends/onnx/tests/models/lp_pool_opset1_float_p.prototxt
new file mode 100644
index 00000000000..8ffc9ed9ae1
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_opset1_float_p.prototxt
@@ -0,0 +1,75 @@
+ir_version: 3
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "strides"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ f: 2.0
+ type: FLOAT
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 4
+ }
+ dim {
+ dim_value: 4
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 2
+ }
+ dim {
+ dim_value: 2
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 1
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_opset1_fractional_p.prototxt b/src/frontends/onnx/tests/models/lp_pool_opset1_fractional_p.prototxt
new file mode 100644
index 00000000000..76d81afd110
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_opset1_fractional_p.prototxt
@@ -0,0 +1,75 @@
+ir_version: 3
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "strides"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ f: 1.5
+ type: FLOAT
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 4
+ }
+ dim {
+ dim_value: 4
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 2
+ }
+ dim {
+ dim_value: 2
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 1
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_p0_invalid.prototxt b/src/frontends/onnx/tests/models/lp_pool_p0_invalid.prototxt
new file mode 100644
index 00000000000..3efde45cac9
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_p0_invalid.prototxt
@@ -0,0 +1,75 @@
+ir_version: 7
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ i: 0
+ type: INT
+ }
+ attribute {
+ name: "strides"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 4
+ }
+ dim {
+ dim_value: 4
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 2
+ }
+ dim {
+ dim_value: 2
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 11
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_p1_pads.prototxt b/src/frontends/onnx/tests/models/lp_pool_p1_pads.prototxt
new file mode 100644
index 00000000000..f875eb024f4
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_p1_pads.prototxt
@@ -0,0 +1,77 @@
+ir_version: 7
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "kernel_shape"
+ ints: 3
+ ints: 3
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ i: 1
+ type: INT
+ }
+ attribute {
+ name: "pads"
+ ints: 1
+ ints: 1
+ ints: 1
+ ints: 1
+ type: INTS
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 3
+ }
+ dim {
+ dim_value: 3
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 3
+ }
+ dim {
+ dim_value: 3
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 11
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_p2.prototxt b/src/frontends/onnx/tests/models/lp_pool_p2.prototxt
new file mode 100644
index 00000000000..781cd067d2c
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_p2.prototxt
@@ -0,0 +1,75 @@
+ir_version: 7
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ i: 2
+ type: INT
+ }
+ attribute {
+ name: "strides"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 4
+ }
+ dim {
+ dim_value: 4
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 2
+ }
+ dim {
+ dim_value: 2
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 11
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_p3_dilations.prototxt b/src/frontends/onnx/tests/models/lp_pool_p3_dilations.prototxt
new file mode 100644
index 00000000000..d8314d65fef
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_p3_dilations.prototxt
@@ -0,0 +1,86 @@
+ir_version: 7
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "ceil_mode"
+ i: 1
+ type: INT
+ }
+ attribute {
+ name: "dilations"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ i: 3
+ type: INT
+ }
+ attribute {
+ name: "strides"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 4
+ }
+ dim {
+ dim_value: 4
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 2
+ }
+ dim {
+ dim_value: 2
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 18
+}
diff --git a/src/frontends/onnx/tests/models/lp_pool_same_upper.prototxt b/src/frontends/onnx/tests/models/lp_pool_same_upper.prototxt
new file mode 100644
index 00000000000..6d26c34da7a
--- /dev/null
+++ b/src/frontends/onnx/tests/models/lp_pool_same_upper.prototxt
@@ -0,0 +1,74 @@
+ir_version: 7
+producer_name: "OpenVINO ONNX Frontend"
+graph {
+ node {
+ input: "A"
+ output: "B"
+ op_type: "LpPool"
+ attribute {
+ name: "auto_pad"
+ s: "SAME_UPPER"
+ type: STRING
+ }
+ attribute {
+ name: "kernel_shape"
+ ints: 2
+ ints: 2
+ type: INTS
+ }
+ attribute {
+ name: "p"
+ i: 2
+ type: INT
+ }
+ }
+ name: "compute_graph"
+ input {
+ name: "A"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 3
+ }
+ dim {
+ dim_value: 3
+ }
+ }
+ }
+ }
+ }
+ output {
+ name: "B"
+ type {
+ tensor_type {
+ elem_type: 1
+ shape {
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 1
+ }
+ dim {
+ dim_value: 3
+ }
+ dim {
+ dim_value: 3
+ }
+ }
+ }
+ }
+ }
+}
+opset_import {
+ domain: ""
+ version: 11
+}
diff --git a/src/frontends/onnx/tests/onnx_import_convpool.in.cpp b/src/frontends/onnx/tests/onnx_import_convpool.in.cpp
index af138e74c94..bb829f2899d 100644
--- a/src/frontends/onnx/tests/onnx_import_convpool.in.cpp
+++ b/src/frontends/onnx/tests/onnx_import_convpool.in.cpp
@@ -447,6 +447,105 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p3) {
test_case.run();
}
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_p2) {
+ auto model = convert_model("lp_pool_p2.onnx");
+
+ Inputs inputs{std::vector<float>(1 * 1 * 4 * 4)};
+ std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
+
+ std::vector<float> expected_output{6.480741f, 9.899495f, 21.400934f, 25.337719f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_multiple_inputs(inputs);
+ test_case.add_expected_output(Shape{1, 1, 2, 2}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
+// LpPool requires a strictly positive 'p' attribute; p=0 must fail fast at conversion time.
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_p0_invalid) {
+ EXPECT_THROW(convert_model("lp_pool_p0_invalid.onnx"), ov::Exception);
+}
+
+// The 'p' attribute is a float in the opset 1 version of LpPool.
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_opset1_float_p) {
+ auto model = convert_model("lp_pool_opset1_float_p.onnx");
+
+ Inputs inputs{std::vector<float>(1 * 1 * 4 * 4)};
+ std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
+
+ std::vector<float> expected_output{6.480741f, 9.899495f, 21.400934f, 25.337719f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_multiple_inputs(inputs);
+ test_case.add_expected_output(Shape{1, 1, 2, 2}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
+// The opset 1 'p' attribute is a float, so non-integer values must not be truncated.
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_opset1_fractional_p) {
+ auto model = convert_model("lp_pool_opset1_fractional_p.onnx");
+
+ Inputs inputs{std::vector<float>(1 * 1 * 4 * 4)};
+ std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
+
+ std::vector<float> expected_output{7.412289f, 11.936901f, 26.713474f, 31.712298f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_multiple_inputs(inputs);
+ test_case.add_expected_output(Shape{1, 1, 2, 2}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
+// Zero padding must not contribute to the pooled Lp norm.
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_p1_pads) {
+ auto model = convert_model("lp_pool_p1_pads.onnx");
+
+ std::vector<float> input{-1.f, 2.f, -3.f, 4.f, -5.f, 6.f, -7.f, 8.f, -9.f};
+
+ std::vector<float> expected_output{12.f, 21.f, 16.f, 27.f, 45.f, 33.f, 24.f, 39.f, 28.f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_input(input);
+ test_case.add_expected_output(Shape{1, 1, 3, 3}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_p3_dilations) {
+ auto model = convert_model("lp_pool_p3_dilations.onnx");
+
+ Inputs inputs{std::vector<float>(1 * 1 * 4 * 4)};
+ std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
+
+ std::vector<float> expected_output{11.497794f, 12.632719f, 14.460854f, 15.874010f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_multiple_inputs(inputs);
+ test_case.add_expected_output(Shape{1, 1, 2, 2}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
+OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lp_pool_same_upper) {
+ auto model = convert_model("lp_pool_same_upper.onnx");
+
+ Inputs inputs{std::vector<float>(1 * 1 * 3 * 3)};
+ std::iota(std::begin(inputs.front()), std::end(inputs.front()), 1.f);
+
+ std::vector<float> expected_output{6.782330f,
+ 8.602325f,
+ 6.708204f,
+ 12.409674f,
+ 14.352700f,
+ 10.816654f,
+ 10.630146f,
+ 12.041595f,
+ 9.000000f};
+
+ auto test_case = ov::test::TestCase(model, s_device);
+ test_case.add_multiple_inputs(inputs);
+ test_case.add_expected_output(Shape{1, 1, 3, 3}, expected_output);
+ test_case.run_with_tolerance_as_fp(1e-5f);
+}
+
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape) {
auto model = convert_model("convtranspose_output_shape.onnx");
diff --git a/src/frontends/onnx/tests/tests_python/test_backend.py b/src/frontends/onnx/tests/tests_python/test_backend.py
index b4dd7cea43f..ece12196772 100644
--- a/src/frontends/onnx/tests/tests_python/test_backend.py
+++ b/src/frontends/onnx/tests/tests_python/test_backend.py
@@ -47,7 +47,6 @@ from tests import (
skip_issue_119896,
xfail_issue_119900,
xfail_issue_119903,
- xfail_issue_119906,
xfail_issue_119919,
xfail_issue_119922,
xfail_issue_119925,
@@ -450,17 +449,6 @@ tests_expected_to_fail = [
"OnnxBackendNodeModelTest.test_deform_conv_with_mask_bias_cpu",
"OnnxBackendNodeModelTest.test_deform_conv_with_multiple_offset_groups_cpu",
),
- (
- xfail_issue_119906,
- "OnnxBackendNodeModelTest.test_lppool_1d_default_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_default_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_dilations_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_pads_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_same_lower_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_same_upper_cpu",
- "OnnxBackendNodeModelTest.test_lppool_2d_strides_cpu",
- "OnnxBackendNodeModelTest.test_lppool_3d_default_cpu",
- ),
(
xfail_issue_119919,
"OnnxBackendNodeModelTest.test_wrap_pad_cpu",