diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag index ce4f85afe44d28..55feab1748536e 100644 --- a/.github/dockerfiles/docker_tag +++ b/.github/dockerfiles/docker_tag @@ -1 +1 @@ -pr-28972 +pr-29664 diff --git a/.github/dockerfiles/ov_test/ubuntu_20_04_arm64/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_20_04_arm64/Dockerfile index e46a1a2ea03ef6..6a457512f6563b 100644 --- a/.github/dockerfiles/ov_test/ubuntu_20_04_arm64/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_20_04_arm64/Dockerfile @@ -30,6 +30,13 @@ RUN apt-get update && \ python3.11-venv \ python3.11-distutils \ libhdf5-dev \ + # libGL for PyTorch Models tests + ffmpeg \ + libsm6 \ + libxext6 \ + libgl1 \ + libgl1-mesa-glx \ + libglib2.0-0 \ && \ rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml index 4b9ef8a49c8b54..3c3471b322434e 100644 --- a/.github/workflows/linux_arm64.yml +++ b/.github/workflows/linux_arm64.yml @@ -239,9 +239,8 @@ jobs: PyTorch_Models_Tests: name: PyTorch Models tests - if: ${{ 'false' }} # TODO: Enable once the dependencies are ready for arm (no tensorflow-text available for arm from PyPI) - # if: fromJSON(needs.smart_ci.outputs.affected_components).PyTorch_FE.test - needs: [ Build, Docker, Smart_CI ] + if: fromJSON(needs.smart_ci.outputs.affected_components).PyTorch_FE.test + needs: [ Build, Docker, Smart_CI, Openvino_tokenizers ] uses: ./.github/workflows/job_pytorch_models_tests.yml with: runner: 'aks-linux-16-cores-32gb-arm' diff --git a/tests/model_hub_tests/pytorch/test_aliked.py b/tests/model_hub_tests/pytorch/test_aliked.py index 87c18303c91faf..29da86aea7daf6 100644 --- a/tests/model_hub_tests/pytorch/test_aliked.py +++ b/tests/model_hub_tests/pytorch/test_aliked.py @@ -3,6 +3,7 @@ import math import os +import platform import subprocess import sys import tempfile @@ -120,9 +121,15 @@ def teardown_class(self): # remove all downloaded files from cache self.repo_dir.cleanup() + def get_supported_precommit_models(): + models = [] + if platform.machine() not in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + models.extend(['aliked-n16rot']) + return models + @pytest.mark.nightly @pytest.mark.precommit - @pytest.mark.parametrize("name", ['aliked-n16rot']) + @pytest.mark.parametrize("name", get_supported_precommit_models()) def test_convert_model_all_models_default(self, name, ie_device): self.run(name, None, ie_device) diff --git a/tests/model_hub_tests/pytorch/test_detectron2.py b/tests/model_hub_tests/pytorch/test_detectron2.py index 76ee55a122298f..1cd8d2565c5d34 100644 --- a/tests/model_hub_tests/pytorch/test_detectron2.py +++ b/tests/model_hub_tests/pytorch/test_detectron2.py @@ -4,6 +4,7 @@ import os import sys import subprocess +import platform import pytest import torch from models_hub_common.utils import get_models_list, compare_two_tensors @@ -94,6 +95,8 @@ def teardown_class(self): get_models_list(os.path.join(os.path.dirname(__file__), "detectron2_precommit"))) @pytest.mark.precommit def test_detectron2_precommit(self, name, type, mark, reason, ie_device): + if platform.machine() in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + pytest.skip("Detectron2 models are not enabled on ARM") self.run(name, None, ie_device) @pytest.mark.parametrize("name", diff --git a/tests/model_hub_tests/pytorch/test_easyocr.py b/tests/model_hub_tests/pytorch/test_easyocr.py index a3306def2f8732..cc1a467815e380 100644 --- a/tests/model_hub_tests/pytorch/test_easyocr.py +++ b/tests/model_hub_tests/pytorch/test_easyocr.py @@ -1,6 +1,7 @@ # Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +import platform import pytest import torch @@ -29,4 +30,6 @@ def load_model(self, model_name, model_link): @pytest.mark.nightly @pytest.mark.parametrize("name", ["detector", "recognizer"]) def test_convert_model(self, name, ie_device): + if platform.machine() in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + pytest.skip("EasyOCR models are not enabled on ARM") self.run(name, None, ie_device) diff --git a/tests/model_hub_tests/pytorch/test_hf_transformers.py b/tests/model_hub_tests/pytorch/test_hf_transformers.py index 38178ad52aaded..1d59a5857b0b33 100644 --- a/tests/model_hub_tests/pytorch/test_hf_transformers.py +++ b/tests/model_hub_tests/pytorch/test_hf_transformers.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +import platform from datasets import Audio, load_dataset from huggingface_hub import hf_hub_download, model_info @@ -525,6 +526,8 @@ def load_model_with_default_class(name, **kwargs): ]) @pytest.mark.precommit def test_convert_model_precommit(self, name, type, ie_device): + if platform.machine() in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + pytest.skip("hf_transformers models are not enabled on ARM") self.run(model_name=name, model_link=type, ie_device=ie_device) @pytest.mark.parametrize("name,type", [("bert-base-uncased", "bert"), @@ -532,6 +535,8 @@ def test_convert_model_precommit(self, name, type, ie_device): ]) @pytest.mark.precommit def test_convert_model_precommit_export(self, name, type, ie_device): + if platform.machine() in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + pytest.skip("hf_transformers models are not enabled on ARM") self.mode = "export" self.run(model_name=name, model_link=type, ie_device=ie_device) diff --git a/tests/model_hub_tests/pytorch/test_llm.py b/tests/model_hub_tests/pytorch/test_llm.py index 7f3a214636d9ec..7fd49818fe1404 100644 --- a/tests/model_hub_tests/pytorch/test_llm.py +++ b/tests/model_hub_tests/pytorch/test_llm.py @@ -5,6 +5,7 @@ import inspect import numpy as np +import platform import pytest import torch from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM @@ -237,12 +238,19 @@ def get_pkv(model, tokenizer): return pkv, for_pkv["attention_mask"] - @pytest.mark.parametrize("type,name", [ - ("opt_gptq", "katuni4ka/opt-125m-gptq"), - ("llama", "TinyLlama/TinyLlama-1.1B-Chat-v1.0"), - ("gpt2", "openai-community/gpt2"), - ("llama_awq", "casperhansen/tinyllama-1b-awq") - ]) + def get_supported_precommit_models(): + models = [ + ("gpt2", "openai-community/gpt2"), + ] + if platform.machine() not in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + models.extend([ + ("opt_gptq", "katuni4ka/opt-125m-gptq"), + ("llama", "TinyLlama/TinyLlama-1.1B-Chat-v1.0"), + ("llama_awq", "casperhansen/tinyllama-1b-awq"), + ]) + return models + + @pytest.mark.parametrize("type,name", get_supported_precommit_models()) @pytest.mark.precommit @pytest.mark.nightly def test_convert_model_precommit(self, name, type, ie_device): diff --git a/tests/model_hub_tests/pytorch/test_timm.py b/tests/model_hub_tests/pytorch/test_timm.py index fd8bf3c8605194..7bf02438199df4 100644 --- a/tests/model_hub_tests/pytorch/test_timm.py +++ b/tests/model_hub_tests/pytorch/test_timm.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +import platform import pytest import timm @@ -70,13 +71,22 @@ def infer_fw_model(self, model_obj, inputs): fw_outputs = [fw_outputs.numpy(force=True)] return fw_outputs - @pytest.mark.parametrize("name", ["mobilevitv2_050.cvnets_in1k", - "poolformerv2_s12.sail_in1k", - "vit_base_patch8_224.augreg_in21k", - "beit_base_patch16_224.in22k_ft_in22k", - "sequencer2d_l.in1k", - "gcresnext26ts.ch_in1k", - "volo_d2_224.sail_in1k"]) + def get_supported_precommit_models(): + models = [ + "mobilevitv2_050.cvnets_in1k", + "poolformerv2_s12.sail_in1k", + "sequencer2d_l.in1k", + ] + if platform.machine() not in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + models.extend([ + "beit_base_patch16_224.in22k_ft_in22k", + "gcresnext26ts.ch_in1k", + "vit_base_patch8_224.augreg_in21k", + "volo_d2_224.sail_in1k", + ]) + return models + + @pytest.mark.parametrize("name", get_supported_precommit_models()) @pytest.mark.precommit def test_convert_model_precommit(self, name, ie_device): self.mode = "trace" diff --git a/tests/model_hub_tests/pytorch/test_torchvision_models.py b/tests/model_hub_tests/pytorch/test_torchvision_models.py index a000c5600f3791..53c93c2683d9c1 100644 --- a/tests/model_hub_tests/pytorch/test_torchvision_models.py +++ b/tests/model_hub_tests/pytorch/test_torchvision_models.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +import platform import tempfile import pytest @@ -98,11 +99,19 @@ def infer_fw_model(self, model_obj, inputs): fw_outputs = [fw_outputs.numpy(force=True)] return fw_outputs - @pytest.mark.parametrize("model_name", ["efficientnet_b7", - "raft_small", - "swin_v2_s", - "quantized_mobilenet_v3_large", - ]) + def get_supported_precommit_models(): + models = [ + "efficientnet_b7", + ] + if platform.machine() not in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + models.extend([ + "raft_small", + "swin_v2_s", + "quantized_mobilenet_v3_large", + ]) + return models + + @pytest.mark.parametrize("model_name", get_supported_precommit_models()) @pytest.mark.precommit def test_convert_model_precommit(self, model_name, ie_device): self.mode = "trace" diff --git a/tests/model_hub_tests/transformation_tests/test_pa_transformation.py b/tests/model_hub_tests/transformation_tests/test_pa_transformation.py index 46a029bdca956d..2bbc99735308c8 100644 --- a/tests/model_hub_tests/transformation_tests/test_pa_transformation.py +++ b/tests/model_hub_tests/transformation_tests/test_pa_transformation.py @@ -112,6 +112,8 @@ def run_pa(tmp_path, def test_pa_precommit(tmp_path, model_name, model_link, mark, reason, ie_device): assert mark is None or mark == 'skip' or mark == 'xfail', \ "Incorrect test case: {}, {}".format(model_name, model_link) + if platform.machine() in ['arm', 'armv7l', 'aarch64', 'arm64', 'ARM64']: + pytest.skip("PagedAttention tests are not enabled on ARM") if mark == 'skip': pytest.skip(reason) elif mark == 'xfail':