OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[PT FE] Run EDSR tests in parallel (#26395)
Maxim Vafin1dc4a18534cb
diff --git a/.github/workflows/job_pytorch_models_tests.yml b/.github/workflows/job_pytorch_models_tests.ymlindex ac3579800ab..957debd77de 100644--- a/.github/workflows/job_pytorch_models_tests.yml+++ b/.github/workflows/job_pytorch_models_tests.yml@@ -134,7 +134,7 @@ jobs:if: ${{ inputs.model_scope == 'precommit' || inputs.model_scope == 'nightly_scope1' }}run: |export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH- python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/ -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_timm_tv_${{ inputs.model_scope }}_tests.html --self-contained-html -v -n 2 -k "TestTimmConvertModel or TestTorchHubConvertModel"+ python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/ -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_timm_tv_${{ inputs.model_scope }}_tests.html --self-contained-html -v -n 2 -k "TestTimmConvertModel or TestTorchHubConvertModel or TestEdsrConvertModel"env:TYPE: ${{ inputs.model_scope == 'precommit' && 'precommit' || 'nightly' }}TEST_DEVICE: CPU@@ -144,7 +144,7 @@ jobs:if: ${{ inputs.model_scope == 'precommit' || inputs.model_scope == 'nightly_scope2' }}run: |export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH- python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_${{ inputs.model_scope }}_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel)"+ python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_${{ inputs.model_scope }}_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel or TestEdsrConvertModel)"env:TYPE: ${{ inputs.model_scope == 'precommit' && 'precommit' || 'nightly' }}TEST_DEVICE: CPUdiff --git a/tests/model_hub_tests/pytorch/test_edsr.py b/tests/model_hub_tests/pytorch/test_edsr.pyindex edc6a123c7d..ef760365139 100644--- a/tests/model_hub_tests/pytorch/test_edsr.py+++ b/tests/model_hub_tests/pytorch/test_edsr.py@@ -43,6 +43,7 @@ class TestEdsrConvertModel(TestTorchConvertModel):url = 'https://paperswithcode.com/media/datasets/Set5-0000002728-07a9793f_zA3bDjj.jpg'image = Image.open(requests.get(url, stream=True).raw)assert model_name in name_to_class, "Unexpected model name"+ print(f"scale: {self.scale}")model = name_to_class[model_name].from_pretrained(f'eugenesiow/{model_name}', scale=self.scale)inputs = ImageLoader.load_image(image)@@ -55,31 +56,34 @@ class TestEdsrConvertModel(TestTorchConvertModel):cleanup_dir(hf_hub_cache_dir)super().teardown_method()- @pytest.mark.parametrize("name,scale", [("edsr", 2)])+ @pytest.mark.parametrize("name", ["edsr"])@pytest.mark.precommit- def test_convert_model_precommit(self, name, scale, ie_device):- self.scale = scale+ def test_convert_model_precommit(self, name, ie_device):+ self.scale = random.randint(2, 4)self.run(name, None, ie_device)@pytest.mark.nightly- @pytest.mark.parametrize("name,scale", [- ("a2n", random.randint(2, 4)),- ("awsrn-bam", random.randint(2, 4)),- ("carn", random.randint(2, 4)),- ("carn-bam", random.randint(2, 4)),- ("drln", random.randint(2, 4)),- ("drln-bam", random.randint(2, 4)),- ("edsr", random.randint(2, 4)),- ("edsr-base", random.randint(2, 4)),- ("msrn", random.randint(2, 4)),- ("msrn-bam", random.randint(2, 4)),- ("mdsr", random.randint(2, 4)),- ("mdsr-bam", random.randint(2, 4)),- ("pan", random.randint(2, 4)),- ("pan-bam", random.randint(2, 4)),- ("han", 4),- ("rcan-bam", 4),+ @pytest.mark.parametrize("name", [+ "a2n",+ "awsrn-bam",+ "carn",+ "carn-bam",+ "drln",+ "drln-bam",+ "edsr",+ "edsr-base",+ "msrn",+ "msrn-bam",+ "mdsr",+ "mdsr-bam",+ "pan",+ "pan-bam",+ "han",+ "rcan-bam",])- def test_convert_model_all_models(self, name, scale, ie_device):- self.scale = scale+ def test_convert_model_all_models(self, name, ie_device):+ if name in ["han", "rcan-bam"]:+ self.scale = 4+ else:+ self.scale = random.randint(2, 4)self.run(name, None, ie_device)