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 230b5defec7..83d3ca88272 100644 --- a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py +++ b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py @@ -12,6 +12,7 @@ from openvino.frontend.pytorch.ts_decoder import TorchScriptPythonDecoder from openvino.frontend import FrontEndManager from openvino.runtime import Core, Type, PartialShape +import openvino.properties.hint as hints import torch from packaging import version import openvino.torch @@ -123,7 +124,10 @@ class PytorchLayerTest: smodel.inlined_graph, op), f"Operation {op} type doesn't exist in provided graph" # OV infer: core = Core() - compiled = core.compile_model(converted_model, ie_device) + config = {} + if ie_device == "GPU" and precision == "FP32": + config[hints.inference_precision] = Type.f32 + compiled = core.compile_model(converted_model, ie_device, config) infer_res = compiled(deepcopy(ov_inputs)) if hasattr(self, 'skip_framework') and self.skip_framework: diff --git a/tests/layer_tests/pytorch_tests/test_adaptive_avg_pool.py b/tests/layer_tests/pytorch_tests/test_adaptive_avg_pool.py index c71d9259519..7184e6307f9 100644 --- a/tests/layer_tests/pytorch_tests/test_adaptive_avg_pool.py +++ b/tests/layer_tests/pytorch_tests/test_adaptive_avg_pool.py @@ -34,6 +34,8 @@ class TestAdaptiveAvgPool3D(PytorchLayerTest): @pytest.mark.precommit_torch_export @pytest.mark.precommit_fx_backend def test_adaptive_avg_pool3d(self, ie_device, precision, ir_version, input_tensor, output_size): + if ie_device == "GPU" and len(input_tensor) < 5: + pytest.xfail(reason="Unsupported shape for adaptive pool on GPU") self.input_tensor = np.random.randn(*input_tensor).astype(np.float32) self._test(*self.create_model(output_size), ie_device, precision, ir_version) @@ -96,5 +98,3 @@ class TestAdaptiveAvgPool1D(PytorchLayerTest): def test_adaptive_avg_pool1d(self, ie_device, precision, ir_version, input_shape, output_size): self.input_tensor = np.random.randn(*input_shape).astype(np.float32) self._test(*self.create_model(output_size), ie_device, precision, ir_version) - - diff --git a/tests/layer_tests/pytorch_tests/test_adaptive_max_pool.py b/tests/layer_tests/pytorch_tests/test_adaptive_max_pool.py index 5348dff7061..c937ce2cdd3 100644 --- a/tests/layer_tests/pytorch_tests/test_adaptive_max_pool.py +++ b/tests/layer_tests/pytorch_tests/test_adaptive_max_pool.py @@ -52,6 +52,8 @@ class TestAdaptiveMaxPool3D(PytorchLayerTest): @pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64', reason='Ticket - 122715') def test_adaptive_max_pool3d(self, ie_device, precision, ir_version, input_shape, output_size, return_indices): + if ie_device == "GPU" and len(input_shape) < 5: + pytest.xfail(reason="Unsupported shape for adaptive pool on GPU") self.input_tensor = np.random.randn(*input_shape).astype(np.float32) self._test(*self.create_model(output_size, return_indices), ie_device, precision, ir_version) diff --git a/tests/layer_tests/pytorch_tests/test_and.py b/tests/layer_tests/pytorch_tests/test_and.py index 939b68aa454..54cb4239cc0 100644 --- a/tests/layer_tests/pytorch_tests/test_and.py +++ b/tests/layer_tests/pytorch_tests/test_and.py @@ -69,13 +69,17 @@ class TestAnd(PytorchLayerTest): @pytest.mark.precommit @pytest.mark.precommit_torch_export def test_and_int(self, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="bitwise ops are not supported on GPU") self.input_data = (np.array(3, dtype=np.int32), np.array(4, dtype=np.int32)) self._test(*self.create_model_int_input(), ie_device, precision, ir_version) @pytest.mark.nightly @pytest.mark.precommit @pytest.mark.precommit_torch_export - def test_and_tensor(self, ie_device, precision, ir_version): + def test_and_int_tensor(self, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="bitwise ops are not supported on GPU") self.input_data = (np.array([3, 5, 8], dtype=np.int32), np.array([7, 11, 2], dtype=np.int32)) self._test( *self.create_model_tensor_input(), ie_device, precision, ir_version, freeze_model=False, trace_model=True diff --git a/tests/layer_tests/pytorch_tests/test_bitwise_ops.py b/tests/layer_tests/pytorch_tests/test_bitwise_ops.py index 72578bd75f2..1cf458500bc 100644 --- a/tests/layer_tests/pytorch_tests/test_bitwise_ops.py +++ b/tests/layer_tests/pytorch_tests/test_bitwise_ops.py @@ -71,6 +71,8 @@ class TestBitwiseOp(PytorchLayerTest): def test_bitwise_mixed_dtypes( self, op_type, out, lhs_dtype, rhs_dtype, lhs_shape, rhs_shape, ie_device, precision, ir_version ): + if ie_device == "GPU" and (lhs_dtype != "bool" or rhs_dtype != "bool"): + pytest.xfail(reason="bitwise ops are not supported on GPU") self._test( *self.create_model(op_type, out), ie_device, @@ -120,6 +122,8 @@ class TestBitwiseOperators(PytorchLayerTest): ], ) def test_bitwise_operators(self, lhs_dtype, rhs_dtype, lhs_shape, rhs_shape, ie_device, precision, ir_version): + if ie_device == "GPU" and (lhs_dtype != "bool" or rhs_dtype != "bool"): + pytest.xfail(reason="bitwise ops are not supported on GPU") self._test( *self.create_model(), ie_device, diff --git a/tests/layer_tests/pytorch_tests/test_convolution.py b/tests/layer_tests/pytorch_tests/test_convolution.py index 48ee72692d7..4f974ae27cf 100644 --- a/tests/layer_tests/pytorch_tests/test_convolution.py +++ b/tests/layer_tests/pytorch_tests/test_convolution.py @@ -210,6 +210,8 @@ class TestConvolution(PytorchLayerTest): @pytest.mark.precommit_fx_backend @pytest.mark.precommit_torch_export def test_convolution1d(self, params, bias, underscore, ie_device, precision, ir_version): + if ie_device == "GPU" and params["dilations"] != [1]: + pytest.xfail(reason="Unsupported dilations of Convolution on GPU") self._test(*self.create_model(**params, bias=bias, underscore=underscore), ie_device, precision, ir_version, dynamic_shapes=params['groups'] == 1, kwargs_to_prepare_input={'ndim': 3}) @@ -222,6 +224,8 @@ class TestConvolution(PytorchLayerTest): @pytest.mark.precommit_fx_backend @pytest.mark.precommit_torch_export def test_convolution2d(self, params, bias, underscore, ie_device, precision, ir_version): + if ie_device == "GPU" and params["dilations"] != [1, 1]: + pytest.xfail(reason="Unsupported dilations of Convolution on GPU") self._test(*self.create_model(**params, bias=bias, underscore=underscore), ie_device, precision, ir_version, dynamic_shapes=params['groups'] == 1) diff --git a/tests/layer_tests/pytorch_tests/test_cross.py b/tests/layer_tests/pytorch_tests/test_cross.py index 1152922aec4..22a76ca8bfc 100644 --- a/tests/layer_tests/pytorch_tests/test_cross.py +++ b/tests/layer_tests/pytorch_tests/test_cross.py @@ -32,10 +32,10 @@ class TestLinalgCross(PytorchLayerTest): def forward(self, x, y): return torch.linalg.cross(x, y, dim=self.dim) - + def forward_out(self, x, y, out): return torch.linalg.cross(x, y, dim=self.dim, out=out), out - + def forward_no_dim_out(self, x, y, out): return torch.linalg.cross(x, y, out=out), out @@ -54,13 +54,17 @@ class TestLinalgCross(PytorchLayerTest): ((4, 3), (1, 3), 1), ((3, 5), (3, 5), 0), ((2, 3, 4), (2, 3, 4), 1) - ]) + ]) @pytest.mark.parametrize('dtype', ['float32', 'float64']) @pytest.mark.parametrize("out", [True, False]) def test_linalg_cross(self, x_shape, y_shape, dim, out, dtype, ie_device, precision, ir_version): self._test( - *self.create_model(dim, out), ie_device, precision, ir_version, use_convert_model=True, - kwargs_to_prepare_input={"x_shape":x_shape, "y_shape": y_shape, "out": out, 'dtype': dtype}) + *self.create_model(dim, out), ie_device, precision, ir_version, use_convert_model=True, + kwargs_to_prepare_input={"x_shape": x_shape, + "y_shape": y_shape, + "out": out, + 'dtype': dtype}, + dynamic_shapes=ie_device != "GPU") class TestCross(PytorchLayerTest): @@ -87,10 +91,10 @@ class TestCross(PytorchLayerTest): def forward(self, x, y): return torch.cross(x, y, dim=self.dim) - + def forward_out(self, x, y, out): return torch.cross(x, y, dim=self.dim, out=out), out - + def forward_no_dim_out(self, x, y, out): x = torch.reshape(x, self.shape) return torch.cross(x, y, out=out), out @@ -113,10 +117,14 @@ class TestCross(PytorchLayerTest): ((3, 1), (3, 4), None), ((4, 3), (4, 3), None), ((2, 3, 4), (2, 3, 4), None), - ]) + ]) @pytest.mark.parametrize("out", [True, False]) @pytest.mark.parametrize('dtype', ['float32', 'float64']) def test_linalg_cross(self, x_shape, y_shape, dim, out, dtype, ie_device, precision, ir_version): - self._test(*self.create_model(dim, out, x_shape), ie_device, precision, ir_version, - use_convert_model=True, - kwargs_to_prepare_input={"x_shape":x_shape, "y_shape": y_shape, "out": out, "dtype": dtype}) \ No newline at end of file + self._test(*self.create_model(dim, out, x_shape), ie_device, precision, ir_version, + use_convert_model=True, + kwargs_to_prepare_input={"x_shape": x_shape, + "y_shape": y_shape, + "out": out, + "dtype": dtype}, + dynamic_shapes=ie_device != "GPU") diff --git a/tests/layer_tests/pytorch_tests/test_cumsum.py b/tests/layer_tests/pytorch_tests/test_cumsum.py index 6be05f0676c..b786dfbb1e8 100644 --- a/tests/layer_tests/pytorch_tests/test_cumsum.py +++ b/tests/layer_tests/pytorch_tests/test_cumsum.py @@ -75,6 +75,8 @@ class TestCumSum(PytorchLayerTest): @pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64', reason='Ticket - 122715') def test_cumsum(self, axis, dtype, out, dtype_from_input, ie_device, precision, ir_version): + if ie_device == "GPU" and dtype == "int8": + pytest.xfail(reason="Cumsum for i8 is unsupported on GPU") if out and PytorchLayerTest.use_torch_export(): pytest.skip(reason="export fails for out") self._test(*self.create_model(axis, dtype, out, dtype_from_input), ie_device, precision, ir_version, kwargs_to_prepare_input={"out": out, "out_dtype": dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_deformable_convolution.py b/tests/layer_tests/pytorch_tests/test_deformable_convolution.py index 45fac8ea0b8..a5475f470c9 100644 --- a/tests/layer_tests/pytorch_tests/test_deformable_convolution.py +++ b/tests/layer_tests/pytorch_tests/test_deformable_convolution.py @@ -172,6 +172,7 @@ class TestDeformableConvolution(PytorchLayerTest): @pytest.mark.precommit @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), ie_device, precision, ir_version, trace_model=True - ) + self._test(*self.create_model(**params, bias=bias, mask=mask), + ie_device, precision, ir_version, trace_model=True, + dynamic_shapes=ie_device != "GPU" + ) diff --git a/tests/layer_tests/pytorch_tests/test_einsum.py b/tests/layer_tests/pytorch_tests/test_einsum.py index 5907c254330..15523b80f23 100644 --- a/tests/layer_tests/pytorch_tests/test_einsum.py +++ b/tests/layer_tests/pytorch_tests/test_einsum.py @@ -100,4 +100,4 @@ class TestEinsumTranspose(PytorchLayerTest): @pytest.mark.nightly @pytest.mark.precommit def test_einsum_transpose(self, ie_device, precision, ir_version): - self._test(*self.create_model(), ie_device, precision, ir_version) \ No newline at end of file + self._test(*self.create_model(), ie_device, precision, ir_version) diff --git a/tests/layer_tests/pytorch_tests/test_embedding.py b/tests/layer_tests/pytorch_tests/test_embedding.py index 8980388c361..0c51656919c 100644 --- a/tests/layer_tests/pytorch_tests/test_embedding.py +++ b/tests/layer_tests/pytorch_tests/test_embedding.py @@ -31,4 +31,4 @@ class TestEmbedding(PytorchLayerTest): @pytest.mark.parametrize("indicies_dtype", ["int", "int32"]) def test_embedding(self, ie_device, precision, ir_version, indicies_size, indicies_dtype): self._test(*self.create_model(), ie_device, precision, ir_version, - kwargs_to_prepare_input={"indicies_size": indicies_size, "indicies_dtype": indicies_dtype}) \ No newline at end of file + kwargs_to_prepare_input={"indicies_size": indicies_size, "indicies_dtype": indicies_dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_embedding_bag.py b/tests/layer_tests/pytorch_tests/test_embedding_bag.py index e02eb8f7866..64723aece88 100644 --- a/tests/layer_tests/pytorch_tests/test_embedding_bag.py +++ b/tests/layer_tests/pytorch_tests/test_embedding_bag.py @@ -50,7 +50,7 @@ class TestEmbeddingBag1dOffsets(PytorchLayerTest): def test_embedding_bag(self, ie_device, precision, ir_version, indicies_dtype, per_sample_weights): self._test(*self.create_model(per_sample_weights), ie_device, precision, ir_version, kwargs_to_prepare_input={"indicies_dtype": indicies_dtype, "per_sample_weights": per_sample_weights}, - trace_model=True, dynamic_shapes=not per_sample_weights) + trace_model=True, dynamic_shapes=not per_sample_weights and ie_device != "GPU") class TestEmbeddingBag2d(PytorchLayerTest): @@ -96,4 +96,4 @@ class TestEmbeddingBag2d(PytorchLayerTest): def test_embedding_bag(self, ie_device, precision, ir_version, indicies_dtype, indicies_size, per_sample_weights): self._test(*self.create_model(per_sample_weights), ie_device, precision, ir_version, kwargs_to_prepare_input={"indicies_size": indicies_size, "indicies_dtype": indicies_dtype, "per_sample_weights": per_sample_weights}, - trace_model=True, dynamic_shapes=not per_sample_weights) + trace_model=True, dynamic_shapes=not per_sample_weights and ie_device != "GPU") diff --git a/tests/layer_tests/pytorch_tests/test_eye.py b/tests/layer_tests/pytorch_tests/test_eye.py index d73dda1d0a7..c79422731ee 100644 --- a/tests/layer_tests/pytorch_tests/test_eye.py +++ b/tests/layer_tests/pytorch_tests/test_eye.py @@ -54,6 +54,8 @@ class TestEye(PytorchLayerTest): @pytest.mark.parametrize("dtype", ["bool", "int8", "uint8", "int32", "int64", "float32", "float64"]) @pytest.mark.parametrize("m", [2, 3, 4, 5]) def test_eye_square(self, dtype, m, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="eye is not supported on GPU") self._test(*self.create_model(1, dtype), ie_device, precision, ir_version, kwargs_to_prepare_input={"m": m}) @pytest.mark.nightly @@ -61,4 +63,6 @@ class TestEye(PytorchLayerTest): @pytest.mark.parametrize("dtype", ["bool", "int8", "uint8", "int32", "int64", "float32", "float64"]) @pytest.mark.parametrize(("m", "n"), [[2, 2], [3, 4], [5, 3]]) def test_eye(self, dtype, m, n, ie_device, precision, ir_version): - self._test(*self.create_model(2, dtype), ie_device, precision, ir_version, kwargs_to_prepare_input={"m": m, "n": n}) \ No newline at end of file + if ie_device == "GPU": + pytest.xfail(reason="eye is not supported on GPU") + self._test(*self.create_model(2, dtype), ie_device, precision, ir_version, kwargs_to_prepare_input={"m": m, "n": n}) diff --git a/tests/layer_tests/pytorch_tests/test_flip.py b/tests/layer_tests/pytorch_tests/test_flip.py index 0f482e3a2bf..9e7fb207b6d 100644 --- a/tests/layer_tests/pytorch_tests/test_flip.py +++ b/tests/layer_tests/pytorch_tests/test_flip.py @@ -41,4 +41,4 @@ class TestFlip(PytorchLayerTest): @pytest.mark.parametrize("out", [skip_if_export(True), False]) @pytest.mark.parametrize("dtype", ["float32", "float64", "int32", "int64", "uint8"]) def test_flip(self, axis, out, dtype, ie_device, precision, ir_version): - self._test(*self.create_model(axis, out), ie_device, precision, ir_version, kwargs_to_prepare_input={"out": out, "dtype": dtype}) \ No newline at end of file + self._test(*self.create_model(axis, out), ie_device, precision, ir_version, kwargs_to_prepare_input={"out": out, "dtype": dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_full.py b/tests/layer_tests/pytorch_tests/test_full.py index 296c1a005bd..20a70367e04 100644 --- a/tests/layer_tests/pytorch_tests/test_full.py +++ b/tests/layer_tests/pytorch_tests/test_full.py @@ -195,6 +195,8 @@ class TestFillDiagonal(PytorchLayerTest): @pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() == 'arm64', reason='Ticket - 122715') def test_fill_diagonal(self, shape, value, input_dtype, value_dtype, wrap, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="fill_diagonal is not supported on GPU") self._test(*self.create_model(shape, wrap), ie_device, precision, ir_version, kwargs_to_prepare_input={ 'value': value, diff --git a/tests/layer_tests/pytorch_tests/test_gather.py b/tests/layer_tests/pytorch_tests/test_gather.py index 009158cafcd..4693ddaa90a 100644 --- a/tests/layer_tests/pytorch_tests/test_gather.py +++ b/tests/layer_tests/pytorch_tests/test_gather.py @@ -47,4 +47,4 @@ class TestGelu(PytorchLayerTest): def test_gather(self, m, n, axis, out, ie_device, precision, ir_version): self._test(*self.create_model(axis, out), ie_device, precision, ir_version, kwargs_to_prepare_input={ "m": m, "n": n, "max_val": m if axis == 0 else n, "out": out - }) \ No newline at end of file + }) diff --git a/tests/layer_tests/pytorch_tests/test_gelu.py b/tests/layer_tests/pytorch_tests/test_gelu.py index 75d862c94cd..19faa692e00 100644 --- a/tests/layer_tests/pytorch_tests/test_gelu.py +++ b/tests/layer_tests/pytorch_tests/test_gelu.py @@ -32,4 +32,4 @@ class TestGelu(PytorchLayerTest): @pytest.mark.precommit_torch_export @pytest.mark.parametrize("approximate", ["none", "tanh"]) def test_glu(self, approximate, ie_device, precision, ir_version): - self._test(*self.create_model(approximate), ie_device, precision, ir_version) \ No newline at end of file + self._test(*self.create_model(approximate), ie_device, precision, ir_version) diff --git a/tests/layer_tests/pytorch_tests/test_hadsigmoid.py b/tests/layer_tests/pytorch_tests/test_hadsigmoid.py index 7c779d195be..140deeaf3ed 100644 --- a/tests/layer_tests/pytorch_tests/test_hadsigmoid.py +++ b/tests/layer_tests/pytorch_tests/test_hadsigmoid.py @@ -33,4 +33,4 @@ class TestHardSigmoid(PytorchLayerTest): @pytest.mark.parametrize("dtype", ["float32", "float64"]) @pytest.mark.parametrize("inplace", [skip_if_export(True), False]) def test_hardsigmoid(self, shape, dtype, inplace, ie_device, precision, ir_version): - self._test(*self.create_model(inplace), ie_device, precision, ir_version, kwargs_to_prepare_input={"shape": shape, "dtype": dtype}) \ No newline at end of file + self._test(*self.create_model(inplace), ie_device, precision, ir_version, kwargs_to_prepare_input={"shape": shape, "dtype": dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_index_put_.py b/tests/layer_tests/pytorch_tests/test_index_put_.py index b2da06ec279..2dd74115f8d 100644 --- a/tests/layer_tests/pytorch_tests/test_index_put_.py +++ b/tests/layer_tests/pytorch_tests/test_index_put_.py @@ -237,4 +237,3 @@ class TestMaskKosmos_IndexPut(PytorchLayerTest): def test_nonzero_kosmos_index_put_(self, ie_device, precision, ir_version): self._test(*self.create_model(), ie_device, precision, ir_version, trace_model=True, use_convert_model=True) - diff --git a/tests/layer_tests/pytorch_tests/test_inverse.py b/tests/layer_tests/pytorch_tests/test_inverse.py index e8365520655..2ae418ef69b 100644 --- a/tests/layer_tests/pytorch_tests/test_inverse.py +++ b/tests/layer_tests/pytorch_tests/test_inverse.py @@ -70,6 +70,8 @@ class TestInverse(PytorchLayerTest): @pytest.mark.precommit def test_inverse(self, data, dtype, out, ie_device, precision, ir_version): self.input_tensor = np.array(data, dtype=dtype) + if ie_device == "GPU": + pytest.xfail(reason="Inverse-14 is not supported on GPU") if not out: self._test(aten_inverse(), None, "aten::linalg_inv", ie_device, precision, ir_version, trace_model=True, freeze_model=False) @@ -105,4 +107,3 @@ class TestInverse(PytorchLayerTest): else: self._test(aten_inverse_out(), None, "aten::linalg_inv", ie_device, precision, ir_version, trace_model=True, freeze_model=False, kwargs_to_prepare_input={"out": out}) - diff --git a/tests/layer_tests/pytorch_tests/test_masked_scatter.py b/tests/layer_tests/pytorch_tests/test_masked_scatter.py index a010cd5e4e3..4d4061c0efe 100644 --- a/tests/layer_tests/pytorch_tests/test_masked_scatter.py +++ b/tests/layer_tests/pytorch_tests/test_masked_scatter.py @@ -81,4 +81,4 @@ class TestMaskedScatter(PytorchLayerTest): @pytest.mark.parametrize("mask_dtype", ["uint8"]) def test_masked_scatter_inplace_u8(self, shape, input_dtype, mask_dtype, ie_device, precision, ir_version): self._test(*self.create_model(inplace=True), ie_device, precision, ir_version, - kwargs_to_prepare_input={"shape": shape, "x_dtype": input_dtype, "mask_dtype": mask_dtype}) \ No newline at end of file + kwargs_to_prepare_input={"shape": shape, "x_dtype": input_dtype, "mask_dtype": mask_dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_min_max.py b/tests/layer_tests/pytorch_tests/test_min_max.py index d857c222158..fc2e60a8d7b 100644 --- a/tests/layer_tests/pytorch_tests/test_min_max.py +++ b/tests/layer_tests/pytorch_tests/test_min_max.py @@ -89,6 +89,8 @@ class TestMinMax(PytorchLayerTest): @pytest.mark.precommit_torch_export @pytest.mark.precommit_fx_backend def test_min_max(self, op_type, first_input_dtype, second_input_dtype, ie_device, precision, ir_version): + if ie_device == "GPU" and first_input_dtype == "uint8" and second_input_dtype == "uint8": + pytest.xfail(reason="Cumsum for i8 is unsupported on GPU") self._test(*self.create_model(op_type, None, None, single_input=False, dtypes=(first_input_dtype, second_input_dtype)), ie_device, precision, ir_version, kwargs_to_prepare_input= {"second_input": True, "input_dtype": first_input_dtype, "second_input_dtype": second_input_dtype} diff --git a/tests/layer_tests/pytorch_tests/test_multinomial.py b/tests/layer_tests/pytorch_tests/test_multinomial.py index 4e494f5e0f8..cf37b61cd6f 100644 --- a/tests/layer_tests/pytorch_tests/test_multinomial.py +++ b/tests/layer_tests/pytorch_tests/test_multinomial.py @@ -90,6 +90,8 @@ class TestMultinomial(PytorchLayerTest): @pytest.mark.nightly @pytest.mark.precommit def test_multinomial(self, input, num_samples, replacement, out, test_type, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="multinomial with num_samples is unsupported on GPU") self._test( *self.create_model(replacement, out, test_type), ie_device, diff --git a/tests/layer_tests/pytorch_tests/test_narrow.py b/tests/layer_tests/pytorch_tests/test_narrow.py index cff0e597cb9..a4b52ca14c1 100644 --- a/tests/layer_tests/pytorch_tests/test_narrow.py +++ b/tests/layer_tests/pytorch_tests/test_narrow.py @@ -10,36 +10,30 @@ from pytorch_layer_test_class import PytorchLayerTest class TestNarrow(PytorchLayerTest): def _prepare_input(self): - return (self.input_tensor, self.dim, self.start, self.length) + return (np.random.randn(*self.input_shape).astype(np.float32),) - def create_model(self): + def create_model(self, dim, start, length): class aten_narrow(torch.nn.Module): + def __init__(self, dim, start, length): + super().__init__() + self.dim = dim + self.start = start + self.length = length - def forward(self, input_tensor, dim: int, start, length: int): - return torch.narrow(input_tensor, dim=dim, start=start, length=length) + def forward(self, input_tensor): + return torch.narrow(input_tensor, dim=self.dim, start=self.start, length=self.length) - ref_net = None - - return aten_narrow(), ref_net, "aten::narrow" + return aten_narrow(dim, start, length), None, "aten::narrow" @pytest.mark.parametrize("input_shape", [ [3, 3], [3, 4, 5] ]) - @pytest.mark.parametrize("dim", [ - np.array(0).astype(np.int32), np.array(1).astype(np.int32), np.array(-1).astype(np.int32) - ]) - @pytest.mark.parametrize("start", [ - np.array(0).astype(np.int32), np.array(1).astype(np.int32) - ]) - @pytest.mark.parametrize("length", [ - np.array(1).astype(np.int32), np.array(2).astype(np.int32) - ]) + @pytest.mark.parametrize("dim", [0, 1, -1]) + @pytest.mark.parametrize("start", [0, 1]) + @pytest.mark.parametrize("length", [1, 2]) @pytest.mark.nightly @pytest.mark.precommit def test_narrow(self, input_shape, dim, start, length, ie_device, precision, ir_version): - self.input_tensor = np.random.randn(*input_shape).astype(np.float32) - self.dim = dim - self.start = start - self.length = length - self._test(*self.create_model(), ie_device, precision, ir_version) \ No newline at end of file + 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 acf60538f60..d798c09ad49 100644 --- a/tests/layer_tests/pytorch_tests/test_or.py +++ b/tests/layer_tests/pytorch_tests/test_or.py @@ -66,12 +66,16 @@ class TestOr(PytorchLayerTest): @pytest.mark.nightly @pytest.mark.precommit def test_or_int(self, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="bitwise ops are not supported on GPU") self.input_data = (np.array(3, dtype=np.int32), np.array(4, dtype=np.int32)) self._test(*self.create_model_int_input(), ie_device, precision, ir_version) @pytest.mark.nightly @pytest.mark.precommit - def test_or_tensor(self, ie_device, precision, ir_version): + 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") self.input_data = (np.array([3, 5, 8], dtype=np.int32), np.array([7, 11, 2], dtype=np.int32)) self._test( *self.create_model_tensor_input(), ie_device, precision, ir_version, freeze_model=False, trace_model=True diff --git a/tests/layer_tests/pytorch_tests/test_outer.py b/tests/layer_tests/pytorch_tests/test_outer.py index bf780592b93..1b39d9dc300 100644 --- a/tests/layer_tests/pytorch_tests/test_outer.py +++ b/tests/layer_tests/pytorch_tests/test_outer.py @@ -53,4 +53,4 @@ class TestOuter(PytorchLayerTest): @pytest.mark.precommit def test_numel(self, x_shape, y_shape, x_dtype, y_dtype, out, ie_device, precision, ir_version): self._test(*self.create_model(out, x_dtype, y_dtype), ie_device, precision, ir_version, - kwargs_to_prepare_input={"out": out, "x_shape": x_shape, "y_shape": y_shape, "x_dtype": x_dtype, "y_dtype": y_dtype}) \ No newline at end of file + kwargs_to_prepare_input={"out": out, "x_shape": x_shape, "y_shape": y_shape, "x_dtype": x_dtype, "y_dtype": y_dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_permute.py b/tests/layer_tests/pytorch_tests/test_permute.py index 832cdd04480..fcae471a13a 100644 --- a/tests/layer_tests/pytorch_tests/test_permute.py +++ b/tests/layer_tests/pytorch_tests/test_permute.py @@ -56,4 +56,5 @@ class TestPermuteList(PytorchLayerTest): @pytest.mark.precommit @pytest.mark.precommit_torch_export def test_permute(self, order, ie_device, precision, ir_version): - self._test(*self.create_model(), ie_device, precision, ir_version, kwargs_to_prepare_input={"permute_shape": order}) + self._test(*self.create_model(), ie_device, precision, ir_version, + kwargs_to_prepare_input={"permute_shape": order}, dynamic_shapes=ie_device != "GPU") diff --git a/tests/layer_tests/pytorch_tests/test_pow.py b/tests/layer_tests/pytorch_tests/test_pow.py index 1321f4d6dd7..3453894b5b2 100644 --- a/tests/layer_tests/pytorch_tests/test_pow.py +++ b/tests/layer_tests/pytorch_tests/test_pow.py @@ -116,6 +116,8 @@ class TestPowMixedTypes(PytorchLayerTest): self.lhs_shape = lhs_shape self.rhs_type = rhs_type self.rhs_shape = rhs_shape + if ie_device == "GPU" and rhs_type not in [torch.float32, torch.float64] and lhs_type not in [torch.float32, torch.float64]: + pytest.xfail(reason="pow is not supported on GPU for integer types") self._test(*self.create_model(lhs_type, lhs_shape, rhs_type, rhs_shape), ie_device, precision, ir_version) diff --git a/tests/layer_tests/pytorch_tests/test_roll.py b/tests/layer_tests/pytorch_tests/test_roll.py index eabae207e2b..17ef51cd9b1 100644 --- a/tests/layer_tests/pytorch_tests/test_roll.py +++ b/tests/layer_tests/pytorch_tests/test_roll.py @@ -40,4 +40,5 @@ class TestRoll(PytorchLayerTest): @pytest.mark.precommit_torch_export @pytest.mark.precommit_fx_backend def test_roll(self, shifts, dim, ie_device, precision, ir_version): - self._test(*self.create_model(shifts, dim), ie_device, precision, ir_version) + self._test(*self.create_model(shifts, dim), ie_device, precision, ir_version, + dynamic_shapes=ie_device != "GPU") diff --git a/tests/layer_tests/pytorch_tests/test_round.py b/tests/layer_tests/pytorch_tests/test_round.py index b6b3b498ef5..bdad3ce772d 100644 --- a/tests/layer_tests/pytorch_tests/test_round.py +++ b/tests/layer_tests/pytorch_tests/test_round.py @@ -43,6 +43,8 @@ class TestRound(PytorchLayerTest): @pytest.mark.parametrize("out", [True, False]) @pytest.mark.parametrize("dtype", ["float32", "float64", "int32", "int64"]) def test_round(self, out, dtype, ie_device, precision, ir_version): + if ie_device == "GPU" and dtype not in ["float32", "float64"]: + pytest.xfail(reason="square is not supported on GPU for integer types") self._test(*self.create_model(out), ie_device, precision, ir_version, kwargs_to_prepare_input={"out": out, "dtype": dtype}) @@ -82,7 +84,9 @@ class TestRoundScalar(PytorchLayerTest): @pytest.mark.parametrize("input_type", ["int", "float"]) def test_round(self, input_type, ie_device, precision, ir_version): if input_type == "int": + if ie_device == "GPU": + pytest.xfail(reason="round is not supported on GPU for integer types") self._prepare_input = self._prepare_input_int else: self._prepare_input = self._prepare_input_float - self._test(*self.create_model(input_type), ie_device, precision, ir_version, trace_model=True) \ No newline at end of file + self._test(*self.create_model(input_type), ie_device, precision, ir_version, trace_model=True) diff --git a/tests/layer_tests/pytorch_tests/test_set_item.py b/tests/layer_tests/pytorch_tests/test_set_item.py index 513bc3042a1..7bd1107557a 100644 --- a/tests/layer_tests/pytorch_tests/test_set_item.py +++ b/tests/layer_tests/pytorch_tests/test_set_item.py @@ -29,7 +29,7 @@ class TestSetItem(PytorchLayerTest): return aten_set_item(idx), ref_net, "aten::_set_item" - @pytest.mark.parametrize("idx", [0, 1, pytest.param(-1, marks=pytest.mark.xfail(reason="103748 ov scatter do not support negative indices"))]) + @pytest.mark.parametrize("idx", [0, 1, -1]) @pytest.mark.nightly @pytest.mark.precommit @pytest.mark.xfail(condition=platform.system() == 'Darwin' and platform.machine() in ('x64', 'x86_64'), diff --git a/tests/layer_tests/pytorch_tests/test_square.py b/tests/layer_tests/pytorch_tests/test_square.py index c3f1045b475..413901002a5 100644 --- a/tests/layer_tests/pytorch_tests/test_square.py +++ b/tests/layer_tests/pytorch_tests/test_square.py @@ -30,6 +30,8 @@ class TestSquareTypes(PytorchLayerTest): @pytest.mark.nightly @pytest.mark.precommit 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") self.type = type self.shape = shape self._test(*self.create_model(type), diff --git a/tests/layer_tests/pytorch_tests/test_take_along_dim.py b/tests/layer_tests/pytorch_tests/test_take_along_dim.py index 81843750802..57e02ec9f09 100644 --- a/tests/layer_tests/pytorch_tests/test_take_along_dim.py +++ b/tests/layer_tests/pytorch_tests/test_take_along_dim.py @@ -53,4 +53,4 @@ class TestTakeAlongDim(PytorchLayerTest): def test_gather(self, m, n, axis, out, ie_device, precision, ir_version): self._test(*self.create_model(axis, out), ie_device, precision, ir_version, kwargs_to_prepare_input={ "m": m, "n": n, "max_val": m if axis == 0 else n, "out": out, "flattenize": axis is None - }) \ No newline at end of file + }) diff --git a/tests/layer_tests/pytorch_tests/test_unflatten.py b/tests/layer_tests/pytorch_tests/test_unflatten.py index 830f571958f..f4c4c75d10a 100644 --- a/tests/layer_tests/pytorch_tests/test_unflatten.py +++ b/tests/layer_tests/pytorch_tests/test_unflatten.py @@ -68,4 +68,4 @@ class TestUnflattenListSizes(PytorchLayerTest): @pytest.mark.precommit @pytest.mark.precommit_torch_export def test_unflatten(self, dim, dtype, ie_device, precision, ir_version): - self._test(*self.create_model(dim), ie_device, precision, ir_version, kwargs_to_prepare_input={"dtype": dtype}) \ No newline at end of file + self._test(*self.create_model(dim), ie_device, precision, ir_version, kwargs_to_prepare_input={"dtype": dtype}) diff --git a/tests/layer_tests/pytorch_tests/test_unfold.py b/tests/layer_tests/pytorch_tests/test_unfold.py index 671af872d96..452b0a3489e 100644 --- a/tests/layer_tests/pytorch_tests/test_unfold.py +++ b/tests/layer_tests/pytorch_tests/test_unfold.py @@ -42,5 +42,8 @@ class TestUnfold(PytorchLayerTest): @pytest.mark.precommit_fx_backend def test_unfold(self, ie_device, precision, ir_version, dimension, size, step, input_shape): self.input_tensor = np.random.randn(*input_shape).astype(np.float32) + dyn_shape = True + if ie_device == "GPU" and size == 1 and step == 1: + dyn_shape = False self._test(*self.create_model(dimension, size, step), - ie_device, precision, ir_version) + ie_device, precision, ir_version, dynamic_shapes=dyn_shape) diff --git a/tests/layer_tests/pytorch_tests/test_upsample.py b/tests/layer_tests/pytorch_tests/test_upsample.py index cfe8097395a..8811c30f965 100644 --- a/tests/layer_tests/pytorch_tests/test_upsample.py +++ b/tests/layer_tests/pytorch_tests/test_upsample.py @@ -45,6 +45,8 @@ class TestUpsample1D(PytorchLayerTest): @pytest.mark.precommit @pytest.mark.skipif(platform == 'darwin', reason="Ticket - 122182") def test_upsample1d(self, mode, size, scale, ie_device, precision, ir_version): + if ie_device == "GPU" and mode == "linear": + pytest.xfail(reason="1D linear upsample is unsupported on GPU") self._test(*self.create_model(size, scale, mode), ie_device, precision, ir_version, trace_model=True) diff --git a/tests/layer_tests/pytorch_tests/test_xor.py b/tests/layer_tests/pytorch_tests/test_xor.py index 8e7b5d2b311..47f7a091df6 100644 --- a/tests/layer_tests/pytorch_tests/test_xor.py +++ b/tests/layer_tests/pytorch_tests/test_xor.py @@ -66,12 +66,16 @@ class TestXor(PytorchLayerTest): @pytest.mark.nightly @pytest.mark.precommit def test_xor_int(self, ie_device, precision, ir_version): + if ie_device == "GPU": + pytest.xfail(reason="bitwise ops are not supported on GPU") self.input_data = (np.array(3, dtype=np.int32), np.array(4, dtype=np.int32)) self._test(*self.create_model_int_input(), ie_device, precision, ir_version) @pytest.mark.nightly @pytest.mark.precommit - def test_xor_tensor(self, ie_device, precision, ir_version): + 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") self.input_data = (np.array([3, 5, 8], dtype=np.int32), np.array([7, 11, 2], dtype=np.int32)) self._test( *self.create_model_tensor_input(), ie_device, precision, ir_version, freeze_model=False, trace_model=True