Skip to content

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

[PT FE] Improve torch.export with version 2.6.0 (#28879)

Maxim Vafinf14d14f1efa0
diff --git a/src/bindings/python/src/openvino/frontend/pytorch/fx_decoder.py b/src/bindings/python/src/openvino/frontend/pytorch/fx_decoder.py
index 83c2cfab16a..b1ebd9076e1 100644
--- a/src/bindings/python/src/openvino/frontend/pytorch/fx_decoder.py
+++ b/src/bindings/python/src/openvino/frontend/pytorch/fx_decoder.py
@@ -6,6 +6,7 @@
import logging
import inspect
+from typing import Any, Optional
import torch
from openvino.frontend.pytorch.py_pytorch_frontend import _FrontEndPytorchDecoder as Decoder
@@ -15,7 +16,6 @@ from openvino.frontend.pytorch.utils import (
make_constant, fetch_attr, pt_to_ov_type_map, torch_tensor_to_ov_const)
logger = logging.getLogger(__name__)
-logger.setLevel(logging.WARNING)
class BaseFXDecoder (Decoder):
diff --git a/src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/decompositions.py b/src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/decompositions.py
index b008c7d856e..f5d527f5980 100644
--- a/src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/decompositions.py
+++ b/src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/decompositions.py
@@ -303,5 +303,16 @@ def ops_to_not_decompose():
# List of operations that shouldn't be decomposed
return [
torch.ops.aten.col2im.default,
+ torch.ops.aten.linear.default,
+ torch.ops.aten.upsample_nearest1d.default,
+ torch.ops.aten.upsample_nearest1d.vec,
torch.ops.aten.upsample_nearest2d.default,
+ torch.ops.aten.upsample_nearest2d.vec,
+ torch.ops.aten.upsample_nearest3d.default,
+ torch.ops.aten.upsample_nearest3d.vec,
+ torch.ops.aten.upsample_linear1d.vec,
+ torch.ops.aten.upsample_bilinear2d.vec,
+ torch.ops.aten.upsample_trilinear3d.vec,
+ torch.ops.aten.upsample_bicubic2d.vec,
+ torch.ops.aten.scaled_dot_product_attention.default,
]
diff --git a/src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp b/src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp
index ac99ce2ec5f..29ba8407809 100644
--- a/src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp
+++ b/src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp
@@ -129,6 +129,8 @@ public:
std::shared_ptr<ov::Model> convert_subgraph(size_t index) const;
private:
+ ov::Any apply_additional_conversion_rules(const ov::Any& data, const std::type_info& type_info) const override;
+
std::shared_ptr<TorchDecoder> m_decoder;
const TensorMap& m_ext_tensor_map;
std::shared_ptr<TensorMap> m_tensor_map;
diff --git a/src/frontends/pytorch/src/node_context.cpp b/src/frontends/pytorch/src/node_context.cpp
index 8edd353adb4..f0d771ef7d3 100644
--- a/src/frontends/pytorch/src/node_context.cpp
+++ b/src/frontends/pytorch/src/node_context.cpp
@@ -371,6 +371,26 @@ Any NodeContext::get_values_from_const_input(int index) const {
return 0;
}
+ov::Any NodeContext::apply_additional_conversion_rules(const ov::Any& data, const std::type_info& type_info) const {
+ if (data.is<Output<Node>>() && type_info != typeid(Output<Node>)) {
+ auto const_node = as_type_ptr<v0::Constant>(data.as<Output<Node>>().get_node_shared_ptr());
+ FRONT_END_GENERAL_CHECK(const_node, "Attribute must be const if requested as not a Node.");
+ if (type_info == typeid(bool)) {
+ bool res = const_node->cast_vector<bool>()[0];
+ return res;
+ } else if (type_info == typeid(int32_t)) {
+ int32_t res = const_node->cast_vector<int32_t>()[0];
+ return res;
+ } else {
+ FRONT_END_GENERAL_CHECK(false,
+ "Could not decode attribute for ",
+ get_name(),
+ " node. Provided type is not known.");
+ }
+ }
+ return data;
+}
+
} // namespace pytorch
} // namespace frontend
} // namespace ov
diff --git a/src/frontends/pytorch/src/op/bucketize.cpp b/src/frontends/pytorch/src/op/bucketize.cpp
index c3ad133651d..81afb438a94 100644
--- a/src/frontends/pytorch/src/op/bucketize.cpp
+++ b/src/frontends/pytorch/src/op/bucketize.cpp
@@ -27,11 +27,15 @@ OutputVector translate_bucketize(const NodeContext& context) {
element::Type output_type = ov::element::i64;
if (!context.input_is_none(2) && context.const_input<bool>(2)) {
output_type = ov::element::i32;
+ } else if (context.has_attribute("out_int32") && context.get_attribute<bool>("out_int32")) {
+ output_type = ov::element::i32;
}
bool with_right_bound = true;
if (!context.input_is_none(3)) {
with_right_bound = !context.const_input<bool>(3);
+ } else if (context.has_attribute("right")) {
+ with_right_bound = !context.get_attribute<bool>("right");
}
auto bucketize =
diff --git a/src/frontends/pytorch/src/op/embedding_bag.cpp b/src/frontends/pytorch/src/op/embedding_bag.cpp
index 6241df321fa..2ac7eff302a 100644
--- a/src/frontends/pytorch/src/op/embedding_bag.cpp
+++ b/src/frontends/pytorch/src/op/embedding_bag.cpp
@@ -20,7 +20,10 @@ OutputVector translate_embedding_bag_common(const NodeContext& context) {
// per_sample_weights=None, include_last_offset=False, padding_idx=None)
// we have only EmbeddingBag case support, check it before translation
- auto mode = context.const_input<int64_t>(4);
+ int64_t mode = 0;
+ if (!context.input_is_none(4)) {
+ mode = context.const_input<int64_t>(4);
+ }
PYTORCH_OP_CONVERSION_CHECK(mode <= 1, "Only sum and mean mode supported for aten::embedding_bag translation");
auto weight = context.get_input(0);
auto indices = context.get_input(1);
@@ -78,7 +81,7 @@ OutputVector translate_embedding_bag(const NodeContext& context) {
}
OutputVector translate_embedding_bag_fx(const NodeContext& context) {
- num_inputs_check(context, 7, 9);
+ num_inputs_check(context, 3, 9);
ov::OutputVector output = translate_embedding_bag_common(context);
return {context.mark_node(make_list_construct(output))};
}
diff --git a/src/frontends/pytorch/src/op/max_poolnd.cpp b/src/frontends/pytorch/src/op/max_poolnd.cpp
index c5015284e62..3fa01988c2d 100644
--- a/src/frontends/pytorch/src/op/max_poolnd.cpp
+++ b/src/frontends/pytorch/src/op/max_poolnd.cpp
@@ -28,8 +28,8 @@ namespace pytorch {
namespace op {
using namespace ov::op;
-OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
- num_inputs_check(context, 3, 6);
+OutputVector translate_max_pool_base(const NodeContext& context, int dims, bool return_indices) {
+ num_inputs_check(context, 2, 6);
auto input = context.get_input(0);
auto input_shape = context.mark_node(std::make_shared<v3::ShapeOf>(input));
@@ -68,7 +68,7 @@ OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
} else {
pads = context.const_input<Shape>(3); // pytorch supports only symmetric paddings
}
- Strides dilations;
+ auto dilations = Strides(dims, 1);
if (!context.input_is_none(4)) {
dilations = context.const_input<Strides>(4);
}
@@ -91,7 +91,7 @@ OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
2));
if (is_static) {
if (no_batch_dim) {
- if (context.get_output_size() == 2) {
+ if (return_indices) {
auto out1 = res->output(0);
auto out2 = res->output(1);
out1 = context.mark_node(std::make_shared<v0::Squeeze>(out1, const_0));
@@ -102,7 +102,7 @@ OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
return {res};
}
} else {
- if (context.get_output_size() == 2) {
+ if (return_indices) {
auto out1 = res->output(0);
auto out2 = res->output(1);
return {std::move(out1), std::move(out2)};
@@ -125,7 +125,7 @@ OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
auto concat_shape = context.mark_node(
std::make_shared<v0::Concat>(OutputVector{slice_input_shape, slice_pooled_output_shape}, 0));
- if (context.get_output_size() == 2) {
+ if (return_indices) {
auto out1 = res->output(0);
auto out2 = res->output(1);
out1 = context.mark_node(std::make_shared<v1::Reshape>(out1, concat_shape, true));
@@ -139,24 +139,24 @@ OutputVector translate_max_pool_base(const NodeContext& context, int dims) {
};
OutputVector translate_max_pool1d(const NodeContext& context) {
- return translate_max_pool_base(context, 1);
+ return translate_max_pool_base(context, 1, context.get_output_size() == 2);
};
OutputVector translate_max_pool2d(const NodeContext& context) {
- return translate_max_pool_base(context, 2);
+ return translate_max_pool_base(context, 2, context.get_output_size() == 2);
};
OutputVector translate_max_pool3d(const NodeContext& context) {
- return translate_max_pool_base(context, 3);
+ return translate_max_pool_base(context, 3, context.get_output_size() == 2);
};
OutputVector translate_max_pool2d_fx(const NodeContext& context) {
- auto output = translate_max_pool2d(context);
+ auto output = translate_max_pool_base(context, 2, true);
return {context.mark_node(make_list_construct(output))};
};
OutputVector translate_max_pool3d_fx(const NodeContext& context) {
- auto output = translate_max_pool3d(context);
+ auto output = translate_max_pool_base(context, 3, true);
return {context.mark_node(make_list_construct(output))};
};
diff --git a/src/frontends/pytorch/src/op/norm.cpp b/src/frontends/pytorch/src/op/norm.cpp
index ea12d978de9..ebbf638e0c2 100644
--- a/src/frontends/pytorch/src/op/norm.cpp
+++ b/src/frontends/pytorch/src/op/norm.cpp
@@ -181,11 +181,14 @@ OutputVector translate_linalg_vector_norm(const NodeContext& context) {
// dtype=None) -> Tensor
// aten::linalg_vector_norm.out(Tensor self, Scalar ord=2, int[1]? dim=None, bool
// keepdim=False, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!):
- num_inputs_check(context, 4, 6);
+ num_inputs_check(context, 3, 6);
auto x = context.get_input(0);
// ord defines the vector norm that is computed.
auto ord = context.const_input<float>(1);
- bool keep_dim = context.const_input<bool>(3);
+ bool keep_dim = false;
+ if (!context.input_is_none(3)) {
+ keep_dim = context.const_input<bool>(3);
+ }
Output<Node> dim;
Output<Node> result;
// If dim= None, x will be flattened before the norm is computed.
diff --git a/src/frontends/pytorch/src/op/scaled_dot_product_attention.cpp b/src/frontends/pytorch/src/op/scaled_dot_product_attention.cpp
index a60c2e9e3bb..ba5911fda6c 100644
--- a/src/frontends/pytorch/src/op/scaled_dot_product_attention.cpp
+++ b/src/frontends/pytorch/src/op/scaled_dot_product_attention.cpp
@@ -27,13 +27,21 @@ std::shared_ptr<ov::Node> translate_scaled_dot_product_attention_common(const No
if (!context.input_is_none(3))
inputs.push_back(context.get_input(3));
- else if (!context.input_is_none(6)) {
- // need to fill a gap in inputs with scalar 0 to be able to pass one extra input after that
- auto zero = op::v0::Constant::create(element::f32, Shape{}, {0});
- inputs.push_back(context.mark_node(std::make_shared<v1::ConvertLike>(zero, query)));
- }
- if (!context.input_is_none(6))
+ if (!context.input_is_none(6)) {
+ if (inputs.size() < 4) {
+ // need to fill a gap in inputs with scalar 0 to be able to pass one extra input after that
+ auto zero = op::v0::Constant::create(element::f32, Shape{}, {0});
+ inputs.push_back(context.mark_node(std::make_shared<v1::ConvertLike>(zero, query)));
+ }
inputs.push_back(context.mark_node(std::make_shared<v1::ConvertLike>(context.get_input(6), query)));
+ } else if (context.has_attribute("scale")) {
+ const auto scale = context.get_input("scale");
+ if (inputs.size() < 4) {
+ auto zero = op::v0::Constant::create(element::f32, Shape{}, {0});
+ inputs.push_back(context.mark_node(std::make_shared<v1::ConvertLike>(zero, query)));
+ }
+ inputs.push_back(context.mark_node(std::make_shared<v1::ConvertLike>(scale, query)));
+ }
if (!context.input_is_none(7)) {
auto enable_gqa = context.const_input<bool>(7);
PYTORCH_OP_CONVERSION_CHECK(enable_gqa == false,
@@ -46,7 +54,7 @@ std::shared_ptr<ov::Node> translate_scaled_dot_product_attention_common(const No
OutputVector translate_scaled_dot_product_attention(const NodeContext& context) {
// aten::scaled_dot_product_attention(Tensor query, Tensor key, Tensor value, Tensor? attn_mask=None, float
// dropout_p=0., bool is_causal=False, float scale=None, bool enable_gqa=False)
- num_inputs_check(context, 6, 8);
+ num_inputs_check(context, 3, 8);
return {translate_scaled_dot_product_attention_common(context)};
};
diff --git a/src/frontends/pytorch/src/op/var_mean.cpp b/src/frontends/pytorch/src/op/var_mean.cpp
index 6415a5d8271..2d83c4ed85f 100644
--- a/src/frontends/pytorch/src/op/var_mean.cpp
+++ b/src/frontends/pytorch/src/op/var_mean.cpp
@@ -98,17 +98,11 @@ OutputVector translate_var_mean_fx(const NodeContext& context) {
}
int32_t correction = 0;
if (context.has_attribute("correction")) {
- auto correction_node = context.get_attribute<Output<Node>>("correction");
- auto const_node = as_type_ptr<v0::Constant>(correction_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "correction must be const.");
- correction = const_node->cast_vector<int32_t>()[0];
+ correction = context.get_attribute<int32_t>("correction");
}
bool keepdim = false;
if (context.has_attribute("keepdim")) {
- auto keepdim_node = context.get_attribute<Output<Node>>("keepdim");
- auto const_node = as_type_ptr<v0::Constant>(keepdim_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "keepdim must be const.");
- keepdim = const_node->cast_vector<bool>()[0];
+ keepdim = context.get_attribute<bool>("keepdim");
}
auto res = translate_var_mean_common(context, data, axes, correction, keepdim);
return {context.mark_node(make_list_construct(res))};
@@ -124,17 +118,11 @@ OutputVector translate_var_fx(const NodeContext& context) {
}
int32_t correction = 0;
if (context.has_attribute("correction")) {
- auto correction_node = context.get_attribute<Output<Node>>("correction");
- auto const_node = as_type_ptr<v0::Constant>(correction_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "correction must be const.");
- correction = const_node->cast_vector<int32_t>()[0];
+ correction = context.get_attribute<int32_t>("correction");
}
bool keepdim = false;
if (context.has_attribute("keepdim")) {
- auto keepdim_node = context.get_attribute<Output<Node>>("keepdim");
- auto const_node = as_type_ptr<v0::Constant>(keepdim_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "keepdim must be const.");
- keepdim = const_node->cast_vector<bool>()[0];
+ keepdim = context.get_attribute<bool>("keepdim");
}
auto res = translate_var_mean_common(context, data, axes, correction, keepdim);
return {res[0]};
@@ -155,17 +143,11 @@ OutputVector translate_std_fx(const NodeContext& context) {
}
int32_t correction = 0;
if (context.has_attribute("correction")) {
- auto correction_node = context.get_attribute<Output<Node>>("correction");
- auto const_node = as_type_ptr<v0::Constant>(correction_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "correction must be const.");
- correction = const_node->cast_vector<int32_t>()[0];
+ correction = context.get_attribute<int32_t>("correction");
}
bool keepdim = false;
if (context.has_attribute("keepdim")) {
- auto keepdim_node = context.get_attribute<Output<Node>>("keepdim");
- auto const_node = as_type_ptr<v0::Constant>(keepdim_node.get_node_shared_ptr());
- PYTORCH_OP_CONVERSION_CHECK(const_node, "keepdim must be const.");
- keepdim = const_node->cast_vector<bool>()[0];
+ keepdim = context.get_attribute<bool>("keepdim");
}
auto res = translate_var_mean_common(context, data, axes, correction, keepdim);
diff --git a/src/frontends/pytorch/src/op_table.cpp b/src/frontends/pytorch/src/op_table.cpp
index ef2919855d3..47115879bf1 100644
--- a/src/frontends/pytorch/src/op_table.cpp
+++ b/src/frontends/pytorch/src/op_table.cpp
@@ -769,8 +769,10 @@ const std::unordered_map<std::string, CreatorFunction> get_supported_ops_fx() {
{"aten._adaptive_avg_pool1d.default", op::translate_adaptive_avg_pool1d},
{"aten._adaptive_avg_pool2d.default", op::translate_adaptive_avg_pool2d},
{"aten._adaptive_avg_pool3d.default", op::translate_adaptive_avg_pool3d},
+ {"aten._cdist_forward.default", op::translate_cdist},
{"aten._convolution.default", op::translate_convolution},
{"aten._embedding_bag.default", op::translate_embedding_bag_fx},
+ {"aten._embedding_bag_forward_only.default", op::translate_embedding_bag_fx},
{"aten._fake_quantize_per_tensor_affine_cachemask_tensor_qparams.default",
op::translate_fake_quantize_per_tensor_affine_fx},
{"aten._local_scalar_dense.default", op::skip_node},
@@ -826,6 +828,7 @@ const std::unordered_map<std::string, CreatorFunction> get_supported_ops_fx() {
{"aten.bitwise_or.Tensor", op::translate_bitwise_or},
{"aten.bitwise_xor.Tensor", op::translate_bitwise_xor},
{"aten.bmm.default", op::translate_1to1_match_2_inputs_align_types<opset10::MatMul>},
+ {"aten.bucketize.Tensor", op::translate_bucketize},
{"aten.cat.default", op::translate_cat_fx},
{"aten.ceil.default", op::translate_1to1_match_1_inputs<opset10::Ceiling>},
{"aten.celu.default", op::translate_celu},
@@ -902,6 +905,7 @@ const std::unordered_map<std::string, CreatorFunction> get_supported_ops_fx() {
{"aten.leaky_relu_.default", op::inplace_op<op::translate_leaky_relu_fx>},
{"aten.lift_fresh_copy.default", op::skip_node},
{"aten.linalg_vector_norm.default", op::translate_linalg_vector_norm},
+ {"aten.linear.default", op::translate_linear},
{"aten.log.default", op::translate_1to1_match_1_inputs_with_fp32_type_alignment<opset10::Log>},
{"aten.log_sigmoid_forward.default", op::translate_log_sigmoid_fx},
{"aten.log10.default", op::translate_log10},
@@ -964,6 +968,7 @@ const std::unordered_map<std::string, CreatorFunction> get_supported_ops_fx() {
{"aten.rsub.Scalar", op::translate_rsub_fx},
{"aten.rsub.Tensor", op::translate_rsub_fx},
{"aten.scalar_tensor.default", op::translate_scalar_tensor_fx},
+ {"aten.scaled_dot_product_attention.default", op::translate_scaled_dot_product_attention},
{"aten.scatter.src", op::translate_scatter},
{"aten.scatter.value", op::translate_scatter},
{"aten.scatter_add.default", op::translate_scatter_add},
@@ -1006,7 +1011,16 @@ const std::unordered_map<std::string, CreatorFunction> get_supported_ops_fx() {
{"aten.unfold.default", op::translate_unfold},
{"aten.unsqueeze.default", op::translate_1to1_match_2_inputs<opset10::Unsqueeze>},
{"aten.unsqueeze_copy.default", op::translate_1to1_match_2_inputs<opset10::Unsqueeze>},
+ {"aten.upsample_bicubic2d.vec", op::translate_upsample_bicubic2d},
+ {"aten.upsample_bilinear2d.vec", op::translate_upsample_bilinear2d},
+ {"aten.upsample_linear1d.vec", op::translate_upsample_linear1d},
+ {"aten.upsample_nearest1d.default", op::translate_upsample_nearest1d},
+ {"aten.upsample_nearest1d.vec", op::translate_upsample_nearest1d},
{"aten.upsample_nearest2d.default", op::translate_upsample_nearest2d},
+ {"aten.upsample_nearest2d.vec", op::translate_upsample_nearest2d},
+ {"aten.upsample_nearest3d.default", op::translate_upsample_nearest3d},
+ {"aten.upsample_nearest3d.vec", op::translate_upsample_nearest3d},
+ {"aten.upsample_trilinear3d.vec", op::translate_upsample_trilinear3d},
{"aten.var.correction", op::translate_var_fx},
{"aten.var_mean.correction", op::translate_var_mean_fx},
{"aten.view.default", op::translate_reshape},
diff --git a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
index 8463a0547a6..466842603fa 100644
--- a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
+++ b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
@@ -280,22 +280,20 @@ class PytorchLayerTest:
return om
def torch_compile_backend_test(self, model, inputs, **kwargs):
+ torch._dynamo.config.suppress_errors = True
+
torch._dynamo.reset()
+ model.eval()
with torch.no_grad():
- model.eval()
fw_res = model(*inputs)
- torch._dynamo.reset()
with torch.no_grad():
- model.eval()
- options={"testing": 1,}
- if ("aot_autograd" in kwargs):
- options.update({"aot_autograd": True,})
+ options = {"testing": 1}
+ if "aot_autograd" in kwargs:
+ options.update({"aot_autograd": True})
if "dynamic_quantization_group_size" in kwargs:
options["config"] = {"DYNAMIC_QUANTIZATION_GROUP_SIZE": str(kwargs["dynamic_quantization_group_size"])}
- dynamic = False
- if ("dynamic" in kwargs):
- dynamic = kwargs["dynamic"]
+ dynamic = kwargs.get("dynamic", False)
ov_model = torch.compile(
model, backend="openvino", dynamic=dynamic, options=options)
@@ -307,7 +305,6 @@ class PytorchLayerTest:
if not isinstance(ov_res, (tuple)):
ov_res = (ov_res,)
- flatten_fw_res, flatten_ov_res = [], []
flatten_fw_res = flattenize_outputs(fw_res)
flatten_ov_res = flattenize_outputs(ov_res)
@@ -328,9 +325,8 @@ class PytorchLayerTest:
else:
fw_eps = 1e-4
is_ok = True
- for i in range(len(flatten_ov_res)):
+ for i, cur_fw_res in enumerate(flatten_fw_res):
cur_ov_res = flatten_ov_res[i]
- cur_fw_res = flatten_fw_res[i]
if not torch.allclose(cur_fw_res, cur_ov_res,
atol=fw_eps, rtol=fw_eps,
equal_nan=True):
diff --git a/tests/layer_tests/pytorch_tests/test_any.py b/tests/layer_tests/pytorch_tests/test_any.py
index ac3acd35315..ff09bba3c9d 100644
--- a/tests/layer_tests/pytorch_tests/test_any.py
+++ b/tests/layer_tests/pytorch_tests/test_any.py
@@ -77,6 +77,7 @@ class TestAny(PytorchLayerTest):
@pytest.mark.parametrize("out", [skip_if_export(True), False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_any_noparams(self, input_shape, d_type, out, ie_device, precision, ir_version):
if type(input_shape) is list:
@@ -105,6 +106,7 @@ class TestAny(PytorchLayerTest):
@pytest.mark.parametrize("out", [skip_if_export(True), False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.xfail(condition=platform.system() in ('Darwin', 'Linux') and platform.machine() in ('arm', 'armv7l',
'aarch64',
diff --git a/tests/layer_tests/pytorch_tests/test_bitwise_ops.py b/tests/layer_tests/pytorch_tests/test_bitwise_ops.py
index b2c3f78a45f..f43ada6dd11 100644
--- a/tests/layer_tests/pytorch_tests/test_bitwise_ops.py
+++ b/tests/layer_tests/pytorch_tests/test_bitwise_ops.py
@@ -4,7 +4,7 @@
import numpy as np
import pytest
import torch
-from packaging import version
+from packaging.version import parse as parse_version
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
@@ -171,8 +171,10 @@ class TestBitwiseInplaceOp(PytorchLayerTest):
return aten_bitwise(op), None, op
+ @pytest.mark.skipif(PytorchLayerTest.use_torch_export() and parse_version(torch.__version__) < parse_version("2.6.0"), reason="unsupported on pytorch before 2.6 with torch.export")
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("dtype", ["bool", "int32"])
@pytest.mark.parametrize(
("lhs_shape", "rhs_shape"),
@@ -197,4 +199,4 @@ class TestBitwiseInplaceOp(PytorchLayerTest):
},
trace_model=True,
freeze_model=False,
- )
\ No newline at end of file
+ )
diff --git a/tests/layer_tests/pytorch_tests/test_bucketize.py b/tests/layer_tests/pytorch_tests/test_bucketize.py
index bca8991eb38..29d34435e86 100644
--- a/tests/layer_tests/pytorch_tests/test_bucketize.py
+++ b/tests/layer_tests/pytorch_tests/test_bucketize.py
@@ -39,6 +39,7 @@ class TestBucketize(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("out_int32", [True, False])
@pytest.mark.parametrize("right", [True, False])
@pytest.mark.parametrize("is_out", [True, False])
diff --git a/tests/layer_tests/pytorch_tests/test_chunk.py b/tests/layer_tests/pytorch_tests/test_chunk.py
index ece2fc257e1..38cc7266f1c 100644
--- a/tests/layer_tests/pytorch_tests/test_chunk.py
+++ b/tests/layer_tests/pytorch_tests/test_chunk.py
@@ -93,6 +93,7 @@ class TestChunk(PytorchLayerTest):
@pytest.mark.parametrize("unsafe", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_chunk(self, input_shape, chunks, unsafe, ie_device, precision, ir_version):
self.input_shape = input_shape
@@ -128,6 +129,7 @@ class TestChunk(PytorchLayerTest):
@pytest.mark.parametrize("unsafe", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_chunk_getitem(self, input_shape, chunks, unsafe, ie_device, precision, ir_version):
self.input_shape = input_shape
for dim, dim_shape in enumerate(input_shape):
diff --git a/tests/layer_tests/pytorch_tests/test_deformable_convolution.py b/tests/layer_tests/pytorch_tests/test_deformable_convolution.py
index 820af9fd19c..90fee06544b 100644
--- a/tests/layer_tests/pytorch_tests/test_deformable_convolution.py
+++ b/tests/layer_tests/pytorch_tests/test_deformable_convolution.py
@@ -170,6 +170,7 @@ class TestDeformableConvolution(PytorchLayerTest):
@pytest.mark.parametrize("mask", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_deformable_convolution2d(self, params, bias, mask, ie_device, precision, ir_version):
self._test(*self.create_model(**params, bias=bias, mask=mask),
diff --git a/tests/layer_tests/pytorch_tests/test_distance.py b/tests/layer_tests/pytorch_tests/test_distance.py
index da80d8c32ad..0d9dce465d8 100644
--- a/tests/layer_tests/pytorch_tests/test_distance.py
+++ b/tests/layer_tests/pytorch_tests/test_distance.py
@@ -30,6 +30,7 @@ class TestCdist(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("p", [2., 4., 6., 8.,])
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
@@ -62,6 +63,7 @@ class TestPairwiseDistance(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("p", [2., 4., 6., 8.,])
@pytest.mark.parametrize("eps", [1e-06, 0.00001, 1e-07])
@pytest.mark.parametrize("keepdim", [True, False])
diff --git a/tests/layer_tests/pytorch_tests/test_embedding_bag.py b/tests/layer_tests/pytorch_tests/test_embedding_bag.py
index 25614eb2285..6834651d819 100644
--- a/tests/layer_tests/pytorch_tests/test_embedding_bag.py
+++ b/tests/layer_tests/pytorch_tests/test_embedding_bag.py
@@ -55,6 +55,7 @@ class TestEmbeddingBag1dOffsets(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("indicies_dtype", ["int", "int32"])
@pytest.mark.parametrize(
@@ -124,6 +125,7 @@ class TestEmbeddingBag2d(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("indicies_size", [[1, 1], [2, 5], [3, 10], [4, 7]])
@pytest.mark.parametrize("indicies_dtype", ["int", "int32"])
@@ -203,6 +205,7 @@ class TestEmbeddingBagPretrained(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("indicies_size", [[1, 1], [2, 5], [3, 10], [4, 7]])
@pytest.mark.parametrize("indicies_dtype", ["int", "int32"])
diff --git a/tests/layer_tests/pytorch_tests/test_fp16.py b/tests/layer_tests/pytorch_tests/test_fp16.py
index 5ceca59327a..e8303dbd70e 100644
--- a/tests/layer_tests/pytorch_tests/test_fp16.py
+++ b/tests/layer_tests/pytorch_tests/test_fp16.py
@@ -26,6 +26,7 @@ class TestBF16(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("to_trace", [True, False])
def test_bf16(self, ie_device, precision, ir_version, to_trace):
self._test(*self.create_model(), ie_device, precision,
@@ -50,6 +51,7 @@ class TestFP16(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("to_trace", [True, False])
def test_fp16(self, ie_device, precision, ir_version, to_trace):
self._test(*self.create_model(), ie_device, precision,
diff --git a/tests/layer_tests/pytorch_tests/test_grid_sampler.py b/tests/layer_tests/pytorch_tests/test_grid_sampler.py
index f045f763b19..83b6323b8c6 100644
--- a/tests/layer_tests/pytorch_tests/test_grid_sampler.py
+++ b/tests/layer_tests/pytorch_tests/test_grid_sampler.py
@@ -37,6 +37,7 @@ class TestGridSampler(PytorchLayerTest):
@pytest.mark.parametrize("align_corners", [True, False, None])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
diff --git a/tests/layer_tests/pytorch_tests/test_hadsigmoid.py b/tests/layer_tests/pytorch_tests/test_hadsigmoid.py
index 049c66d3353..eaa0ff858f0 100644
--- a/tests/layer_tests/pytorch_tests/test_hadsigmoid.py
+++ b/tests/layer_tests/pytorch_tests/test_hadsigmoid.py
@@ -29,6 +29,7 @@ class TestHardSigmoid(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("shape", [[1, 10], [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]])
@pytest.mark.parametrize("dtype", ["float32", "float64"])
@pytest.mark.parametrize("inplace", [skip_if_export(True), False])
diff --git a/tests/layer_tests/pytorch_tests/test_im2col.py b/tests/layer_tests/pytorch_tests/test_im2col.py
index 3da9470bfae..427245e9b83 100644
--- a/tests/layer_tests/pytorch_tests/test_im2col.py
+++ b/tests/layer_tests/pytorch_tests/test_im2col.py
@@ -37,6 +37,7 @@ class TestIm2Col(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("kernel_size", [[2, 3], [3, 2], [3, 3], [2, 2], [1, 1]])
@pytest.mark.parametrize("dilation", [1, 2, 3, (1, 2)])
@pytest.mark.parametrize("padding", [0, 5, 1, [2, 3]])
diff --git a/tests/layer_tests/pytorch_tests/test_layer_norm.py b/tests/layer_tests/pytorch_tests/test_layer_norm.py
index 45b270b4ea9..2b3c3e1d2c8 100644
--- a/tests/layer_tests/pytorch_tests/test_layer_norm.py
+++ b/tests/layer_tests/pytorch_tests/test_layer_norm.py
@@ -49,5 +49,6 @@ class TestLayerNorm(PytorchLayerTest):
@pytest.mark.parametrize("eps", [1e-5, 0.005])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_layer_norm(self, normalized_shape, weight, bias, eps, ie_device, precision, ir_version):
self._test(*self.create_model(normalized_shape, weight, bias, eps), ie_device, precision, ir_version)
\ No newline at end of file
diff --git a/tests/layer_tests/pytorch_tests/test_leaky_relu.py b/tests/layer_tests/pytorch_tests/test_leaky_relu.py
index e8126fdbef5..338e989f9b1 100644
--- a/tests/layer_tests/pytorch_tests/test_leaky_relu.py
+++ b/tests/layer_tests/pytorch_tests/test_leaky_relu.py
@@ -32,6 +32,7 @@ class TestLeakyRelu(PytorchLayerTest):
@pytest.mark.parametrize("inplace", [skip_if_export(True), False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_leaky_relu(self, alpha, inplace, ie_device, precision, ir_version):
self._test(*self.create_model(alpha, inplace), ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_linear.py b/tests/layer_tests/pytorch_tests/test_linear.py
index 7b1388d89ce..cfb5bbbbd5a 100644
--- a/tests/layer_tests/pytorch_tests/test_linear.py
+++ b/tests/layer_tests/pytorch_tests/test_linear.py
@@ -45,6 +45,7 @@ class TestMatMul(PytorchLayerTest):
])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_matmul(self, kwargs_to_prepare_input, ie_device, precision, ir_version):
self._test(*self.create_model(len(kwargs_to_prepare_input) == 3), ie_device, precision, ir_version,
kwargs_to_prepare_input=kwargs_to_prepare_input)
@@ -73,6 +74,7 @@ class TestLinearBiasList(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_linear_bias_list(self, ie_device, precision, ir_version):
self._test(*self.create_model(), ie_device, precision, ir_version,
trace_model=True, freeze_model=False)
diff --git a/tests/layer_tests/pytorch_tests/test_logsumexp.py b/tests/layer_tests/pytorch_tests/test_logsumexp.py
index 806e3b80540..0aee5526ff0 100644
--- a/tests/layer_tests/pytorch_tests/test_logsumexp.py
+++ b/tests/layer_tests/pytorch_tests/test_logsumexp.py
@@ -28,6 +28,7 @@ class TestLogsumexp(PytorchLayerTest):
@pytest.mark.parametrize("keepdim", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_logsumexp(self, dim, keepdim, ie_device, precision, ir_version):
self._test(aten_logsumexp(dim, keepdim), None, "aten::logsumexp",
diff --git a/tests/layer_tests/pytorch_tests/test_masked_fill.py b/tests/layer_tests/pytorch_tests/test_masked_fill.py
index 95c3bb0214e..9d9792e8806 100644
--- a/tests/layer_tests/pytorch_tests/test_masked_fill.py
+++ b/tests/layer_tests/pytorch_tests/test_masked_fill.py
@@ -6,7 +6,7 @@ import torch
from packaging.version import parse as parse_version
import pytest
-from pytorch_layer_test_class import PytorchLayerTest
+from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestMaskedFill(PytorchLayerTest):
@@ -51,9 +51,10 @@ class TestMaskedFill(PytorchLayerTest):
"mask_fill", ['zeros', 'ones', 'random'])
@pytest.mark.parametrize("input_dtype", [np.float32, np.float64, int, np.int32])
@pytest.mark.parametrize("mask_dtype", [bool]) # np.float32 incorrectly casted to bool
- @pytest.mark.parametrize("inplace", [True, False])
+ @pytest.mark.parametrize("inplace", [skip_if_export(True), False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_masked_fill(self, value, mask_fill, mask_dtype, input_dtype, inplace, ie_device, precision, ir_version):
self._test(*self.create_model(value, inplace),
@@ -69,6 +70,7 @@ class TestMaskedFill(PytorchLayerTest):
@pytest.mark.parametrize("inplace", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_masked_fill_non_bool_mask(self, value, mask_fill, mask_dtype, input_dtype, inplace, ie_device, precision, ir_version):
self._test(*self.create_model(value, inplace),
ie_device, precision, ir_version,
diff --git a/tests/layer_tests/pytorch_tests/test_matmul.py b/tests/layer_tests/pytorch_tests/test_matmul.py
index 4613ac3e761..39edbd8796b 100644
--- a/tests/layer_tests/pytorch_tests/test_matmul.py
+++ b/tests/layer_tests/pytorch_tests/test_matmul.py
@@ -20,6 +20,7 @@ class TestMatMulOperation(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("matrix, vector, dtype", [
(np.array([[1, 2], [3, 4]]), np.array([5, 6]), torch.float64),
(np.array([[0, 0], [0, 0]]), np.array([1, 2]), torch.float32),
diff --git a/tests/layer_tests/pytorch_tests/test_narrow.py b/tests/layer_tests/pytorch_tests/test_narrow.py
index 02a84901f4a..a9224780501 100644
--- a/tests/layer_tests/pytorch_tests/test_narrow.py
+++ b/tests/layer_tests/pytorch_tests/test_narrow.py
@@ -34,6 +34,7 @@ class TestNarrow(PytorchLayerTest):
@pytest.mark.parametrize("length", [1, 2])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_narrow(self, input_shape, dim, start, length, ie_device, precision, ir_version):
self.input_shape = input_shape
self._test(*self.create_model(dim, start, length), ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_or.py b/tests/layer_tests/pytorch_tests/test_or.py
index 2fc32b16b8a..625425eb60d 100644
--- a/tests/layer_tests/pytorch_tests/test_or.py
+++ b/tests/layer_tests/pytorch_tests/test_or.py
@@ -50,6 +50,7 @@ class TestOr(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_or_tensor(self, ie_device, precision, ir_version):
self.input_data = (
np.array([True, False, False], dtype=np.bool_),
@@ -59,12 +60,14 @@ class TestOr(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_or_bool(self, ie_device, precision, ir_version):
self.input_data = (np.array(True, dtype=np.bool_), np.array(True, dtype=np.bool_))
self._test(*self.create_model_bool_input(), ie_device, precision, ir_version)
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_or_int(self, ie_device, precision, ir_version):
if ie_device == "GPU":
pytest.xfail(reason="bitwise ops are not supported on GPU")
@@ -73,6 +76,7 @@ class TestOr(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_or_int_tensor(self, ie_device, precision, ir_version):
if ie_device == "GPU":
pytest.xfail(reason="bitwise ops are not supported on GPU")
diff --git a/tests/layer_tests/pytorch_tests/test_pooling.py b/tests/layer_tests/pytorch_tests/test_pooling.py
index a479bd13c80..a163c54a7c9 100644
--- a/tests/layer_tests/pytorch_tests/test_pooling.py
+++ b/tests/layer_tests/pytorch_tests/test_pooling.py
@@ -201,6 +201,7 @@ class TestPooling(PytorchLayerTest):
@pytest.mark.parametrize("is_dynamic_shapes", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
def test_max_pool2d(self, input_shape, params, ceil_mode, dilation, dtype, ie_device, precision, ir_version, is_dynamic_shapes):
@@ -218,6 +219,7 @@ class TestPooling(PytorchLayerTest):
@pytest.mark.parametrize("is_dynamic_shapes", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
def test_max_pool3d(self, input_shape, params, ceil_mode, dilation, ie_device, precision, ir_version, is_dynamic_shapes):
@@ -232,6 +234,7 @@ class TestPooling(PytorchLayerTest):
@pytest.mark.parametrize("is_dynamic_shapes", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
def test_max_pool1d_indices(self, input_shape, params, ceil_mode, dilation, ie_device, precision, ir_version, is_dynamic_shapes):
@@ -246,6 +249,7 @@ class TestPooling(PytorchLayerTest):
@pytest.mark.parametrize("is_dynamic_shapes", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
@@ -264,6 +268,7 @@ class TestPooling(PytorchLayerTest):
@pytest.mark.parametrize("is_dynamic_shapes", [True, False])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64',
reason='Ticket - 122715')
diff --git a/tests/layer_tests/pytorch_tests/test_prelu.py b/tests/layer_tests/pytorch_tests/test_prelu.py
index 43343725998..c1679e9551a 100644
--- a/tests/layer_tests/pytorch_tests/test_prelu.py
+++ b/tests/layer_tests/pytorch_tests/test_prelu.py
@@ -30,5 +30,6 @@ class TestPRelu(PytorchLayerTest):
@pytest.mark.parametrize("alpha", [0.01, 1.01, -0.01])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_prelu(self, alpha, ie_device, precision, ir_version):
self._test(*self.create_model(alpha), ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_pythonop.py b/tests/layer_tests/pytorch_tests/test_pythonop.py
index 1714b6c7dc9..240d983493d 100644
--- a/tests/layer_tests/pytorch_tests/test_pythonop.py
+++ b/tests/layer_tests/pytorch_tests/test_pythonop.py
@@ -39,7 +39,7 @@ class TestPythonOp(PytorchLayerTest):
pytest.param(
False,
marks=pytest.mark.xfail(
- reason="Subgraph of prim::PythonOp cannot be retrived using if using scripting."
+ reason="Subgraph of prim::PythonOp cannot be retrieved using if using scripting."
),
),
],
diff --git a/tests/layer_tests/pytorch_tests/test_roi_align.py b/tests/layer_tests/pytorch_tests/test_roi_align.py
index 6f0d7aa21bb..816c2a96443 100644
--- a/tests/layer_tests/pytorch_tests/test_roi_align.py
+++ b/tests/layer_tests/pytorch_tests/test_roi_align.py
@@ -52,6 +52,7 @@ class TestROIAlign(PytorchLayerTest):
@pytest.mark.parametrize('aligned', (True, False))
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_roi_align(self, ie_device, precision, ir_version, input_shape, boxes, output_size,
spatial_scale, sampling_ratio, aligned):
diff --git a/tests/layer_tests/pytorch_tests/test_sign.py b/tests/layer_tests/pytorch_tests/test_sign.py
index 0e60b779495..a2d7fdcd186 100644
--- a/tests/layer_tests/pytorch_tests/test_sign.py
+++ b/tests/layer_tests/pytorch_tests/test_sign.py
@@ -45,6 +45,7 @@ class TestSilu(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("input_type", ["zeros", "positive", "negative", "mixed"])
@pytest.mark.parametrize("out", [True, False])
diff --git a/tests/layer_tests/pytorch_tests/test_softplus.py b/tests/layer_tests/pytorch_tests/test_softplus.py
index 33bcba6b419..1e5176f15e5 100644
--- a/tests/layer_tests/pytorch_tests/test_softplus.py
+++ b/tests/layer_tests/pytorch_tests/test_softplus.py
@@ -19,6 +19,7 @@ class TestSoftplus(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_softplus(self, ie_device, precision, ir_version):
self._test(aten_softplus(), None, "aten::softplus",
ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_split.py b/tests/layer_tests/pytorch_tests/test_split.py
index 497f314b747..3f3253ee53e 100644
--- a/tests/layer_tests/pytorch_tests/test_split.py
+++ b/tests/layer_tests/pytorch_tests/test_split.py
@@ -61,6 +61,7 @@ class TestSplit(PytorchLayerTest):
@pytest.mark.parametrize("getitem", [-5, -2, -1, 0, 1, 4])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_split_getitem(self, params, getitem, ie_device, precision, ir_version):
(self.split_param, self.axis) = params
self.getitem = getitem
@@ -70,6 +71,7 @@ class TestSplit(PytorchLayerTest):
@pytest.mark.parametrize("params", test_cases)
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_split_listunpack(self, params, ie_device, precision, ir_version):
(self.split_param, self.axis) = params
self._test(
@@ -99,6 +101,7 @@ class TestSplitWithSizes(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_split_with_sizes(self, ie_device, precision, ir_version):
self._test(*self.create_model(),
diff --git a/tests/layer_tests/pytorch_tests/test_square.py b/tests/layer_tests/pytorch_tests/test_square.py
index bda4368c393..37e05787903 100644
--- a/tests/layer_tests/pytorch_tests/test_square.py
+++ b/tests/layer_tests/pytorch_tests/test_square.py
@@ -29,6 +29,7 @@ class TestSquareTypes(PytorchLayerTest):
@pytest.mark.parametrize(("shape"), [[2, 3], [],])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_square_types(self, ie_device, precision, ir_version, type, shape):
if ie_device == "GPU" and type != torch.float32:
pytest.xfail(reason="square is not supported on GPU for integer types")
diff --git a/tests/layer_tests/pytorch_tests/test_squeeze.py b/tests/layer_tests/pytorch_tests/test_squeeze.py
index 3fa70532a46..0f94e67e09c 100644
--- a/tests/layer_tests/pytorch_tests/test_squeeze.py
+++ b/tests/layer_tests/pytorch_tests/test_squeeze.py
@@ -42,6 +42,7 @@ class TestSqueeze(PytorchLayerTest):
@pytest.mark.parametrize("dim", [-1, 2])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_squeeze_non_1(self, dim, ie_device, precision, ir_version):
# Dynamic shapes are introducing dynamic rank, with is not suppoerted by Squeeze operation.
self._test(*self.create_model(dim), ie_device, precision, ir_version, dynamic_shapes=False)
diff --git a/tests/layer_tests/pytorch_tests/test_stack.py b/tests/layer_tests/pytorch_tests/test_stack.py
index 59ebb09dfb1..04d1808063c 100644
--- a/tests/layer_tests/pytorch_tests/test_stack.py
+++ b/tests/layer_tests/pytorch_tests/test_stack.py
@@ -38,6 +38,7 @@ class TestStack2D(PytorchLayerTest):
]))
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_stack2D(self, input_shape, dim, ie_device, precision, ir_version):
self.input_tensors = [
np.random.randn(*input_shape).astype(np.float32),
@@ -77,6 +78,7 @@ class TestStack3D(PytorchLayerTest):
]))
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_stack3D(self, input_shape, dim, ie_device, precision, ir_version):
self.input_tensors = [
np.random.randn(*input_shape).astype(np.float32),
diff --git a/tests/layer_tests/pytorch_tests/test_strided_const.py b/tests/layer_tests/pytorch_tests/test_strided_const.py
index e3a010925e1..41f7f0b0916 100644
--- a/tests/layer_tests/pytorch_tests/test_strided_const.py
+++ b/tests/layer_tests/pytorch_tests/test_strided_const.py
@@ -30,5 +30,6 @@ class TestStrides(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_strides(self, ie_device, precision, ir_version):
self._test(*self.create_model(), ie_device, precision, ir_version, use_convert_model=True)
diff --git a/tests/layer_tests/pytorch_tests/test_tile.py b/tests/layer_tests/pytorch_tests/test_tile.py
index fab140d97b3..6923d061639 100644
--- a/tests/layer_tests/pytorch_tests/test_tile.py
+++ b/tests/layer_tests/pytorch_tests/test_tile.py
@@ -28,6 +28,7 @@ class TestTile(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.parametrize("dims", [(2, 2), (1, 1), (1, 2, 3, 4)])
def test_tile(self, dims, ie_device, precision, ir_version):
self._test(*self.create_model(dims), ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_topk.py b/tests/layer_tests/pytorch_tests/test_topk.py
index f15210bcfa8..44d5a20df89 100644
--- a/tests/layer_tests/pytorch_tests/test_topk.py
+++ b/tests/layer_tests/pytorch_tests/test_topk.py
@@ -61,6 +61,7 @@ class TestTopK(PytorchLayerTest):
])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
def test_topK(self, input_shape, k, dim, largest, sort, ie_device, precision, ir_version):
self.input_tensor = np.random.randn(*input_shape).astype(np.float32)
diff --git a/tests/layer_tests/pytorch_tests/test_trilu.py b/tests/layer_tests/pytorch_tests/test_trilu.py
index fcff055791b..0d4bd397218 100644
--- a/tests/layer_tests/pytorch_tests/test_trilu.py
+++ b/tests/layer_tests/pytorch_tests/test_trilu.py
@@ -69,13 +69,13 @@ class TestTriuTrilTensor(PytorchLayerTest):
def tril(self, x):
return x.tril(self.diagonal), x
-
+
def tril_(self, x):
return x.tril_(self.diagonal), x
-
+
def triu(self, x):
return x.triu(self.diagonal), x
-
+
def triu_(self, x):
return x.triu_(self.diagonal), x
diff --git a/tests/layer_tests/pytorch_tests/test_unbind.py b/tests/layer_tests/pytorch_tests/test_unbind.py
index 0aa5b2e66a4..bcb72a4f0bf 100644
--- a/tests/layer_tests/pytorch_tests/test_unbind.py
+++ b/tests/layer_tests/pytorch_tests/test_unbind.py
@@ -31,5 +31,6 @@ class TestUnbind(PytorchLayerTest):
@pytest.mark.parametrize(("dim"), [0, 1, 2, 3])
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_unbind(self, dim, ie_device, precision, ir_version):
self._test(*self.create_model(dim), ie_device, precision, ir_version)
diff --git a/tests/layer_tests/pytorch_tests/test_var_mean.py b/tests/layer_tests/pytorch_tests/test_var_mean.py
index 95e40a33846..182996cbe1e 100644
--- a/tests/layer_tests/pytorch_tests/test_var_mean.py
+++ b/tests/layer_tests/pytorch_tests/test_var_mean.py
@@ -52,6 +52,7 @@ class TestVarMean(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("unbiased", [True, False])
@pytest.mark.parametrize("op_type", ["var", "var_mean", "std", "std_mean"])
@@ -62,6 +63,7 @@ class TestVarMean(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
@pytest.mark.precommit_fx_backend
@pytest.mark.parametrize("unbiased", [False, True])
@pytest.mark.parametrize("dim", [None, 0, 1, 2, 3, -1, -2, (0, 1), (-1, -2), (0, 1, -1), (0, 1, 2, 3)])
diff --git a/tests/layer_tests/pytorch_tests/test_xor.py b/tests/layer_tests/pytorch_tests/test_xor.py
index 34b24d11ada..597fdd34290 100644
--- a/tests/layer_tests/pytorch_tests/test_xor.py
+++ b/tests/layer_tests/pytorch_tests/test_xor.py
@@ -50,6 +50,7 @@ class TestXor(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_xor_tensor(self, ie_device, precision, ir_version):
self.input_data = (
np.array([True, False, False], dtype=np.bool_),
@@ -59,12 +60,14 @@ class TestXor(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_xor_bool(self, ie_device, precision, ir_version):
self.input_data = (np.array(True, dtype=np.bool_), np.array(True, dtype=np.bool_))
self._test(*self.create_model_bool_input(), ie_device, precision, ir_version)
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_xor_int(self, ie_device, precision, ir_version):
if ie_device == "GPU":
pytest.xfail(reason="bitwise ops are not supported on GPU")
@@ -73,6 +76,7 @@ class TestXor(PytorchLayerTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.precommit_torch_export
def test_xor_int_tensor(self, ie_device, precision, ir_version):
if ie_device == "GPU":
pytest.xfail(reason="bitwise ops are not supported on GPU")