[PT FE] Update torch to 2.1 in GHA tests (#21391)

* [PT FE] Update torch to 2.1 in GHA tests

* Adjust requirements for natten

* Add upper bound

* Use sys.executable
This commit is contained in:
Maxim Vafin 2023-11-30 18:48:40 +01:00 committed by GitHub
parent 74bf3d4e38
commit fa7a4f44b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 16 deletions

View File

@ -23,4 +23,4 @@ pytest-html==4.1.1
pytest-timeout==2.1.0
jax<=0.4.14
jaxlib<=0.4.14
torch>=1.13
torch>=1.13,<2.2

View File

@ -1,19 +1,21 @@
-c ../../constraints.txt
--extra-index-url https://download.pytorch.org/whl/cpu
av
basicsr
datasets
facexlib
numpy
pandas
protobuf
pyctcdecode
pytest
pytest-html
torch<2.1
torchvision
av
transformers
timm
sacremoses
sentencepiece
datasets
pyctcdecode
protobuf
soundfile
pandas
super-image
basicsr
facexlib
timm
torch
torchvision
transformers
wheel

View File

@ -1,5 +1,3 @@
-c ../../constraints.txt
# This file contains requirements dependednt from modules in requirements.txt
# get immutable commit to be able to use pip cache
git+https://github.com/facebookresearch/detectron2.git@1a4df4d954089534daebbd7a0a45f08ece87056e
natten
natten -f https://shi-labs.com/natten/wheels/cpu/torch2.0.0/index.html

View File

@ -2,7 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import subprocess
import pytest
import torch
from models_hub_common.utils import get_models_list, compare_two_tensors
@ -19,6 +20,9 @@ class TestDetectron2ConvertModel(TestTorchConvertModel):
self.image = Image.open(requests.get(url, stream=True).raw)
self.image = self.image.resize([640, 480])
subprocess.run([sys.executable, "-m", "pip", "install",
"git+https://github.com/facebookresearch/detectron2.git@017abbfa5f2c2a2afa045200c2af9ccf2fc6227f"])
def load_model(self, model_name, model_link):
from detectron2 import model_zoo, export
from detectron2.modeling import build_model, PanopticFPN
@ -82,6 +86,10 @@ class TestDetectron2ConvertModel(TestTorchConvertModel):
is_ok = compare_two_tensors(cur_ov_res[:l], cur_fw_res[:l], fw_eps)
assert is_ok, "Accuracy validation failed"
def teardown_class(self):
subprocess.run(
[sys.executable, "-m", "pip", "uninstall", "-y", "detectron2"])
@pytest.mark.parametrize("name,type,mark,reason",
get_models_list(os.path.join(os.path.dirname(__file__), "detectron2_precommit")))
@pytest.mark.precommit