[CI] Install vision without pep517 (#81074)
If installed with pep517 support, `torchvision` will be build againstreleased version of PyTorch rather than against the one currently installed on the system
Also update `torchvision` hash to https://github.com/pytorch/vision/commit/8a45147f9df23b12981f1e80554bbae251f594ea and:
- Added `maskrcnn_resnet50_fpn_v2`, `maskrcnn_resnet50_fpn_v2`, `retinanet_resnet50_fpn_v2`, `ssd300_vgg16`, `fcos_resnet50_fpn` and `ssdlite320_mobilenet_v3_large` to the list of untraceable models
- Set default input size to (1, 3, 16, 224, 224) for `mvit_v1_b` model
- Skipped `test_roi_aligned`,`test_batched_nms`, `test_roi_pooled` and `test_roi_align_aligned` ONNX test (tracked in https://github.com/pytorch/pytorch/issues/81121 )
- Skipped TorchVision integration tests in `test_package` (tracked in https://github.com/pytorch/pytorch/issues/81115 )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81074
Approved by: https://github.com/kit1980
diff --git a/.github/ci_commit_pins/vision.txt b/.github/ci_commit_pins/vision.txt
index c5251d9..92f6b0a 100644
--- a/.github/ci_commit_pins/vision.txt
+++ b/.github/ci_commit_pins/vision.txt
@@ -1 +1 @@
-8a2dc6f22ac4389ccba8859aa1e1cb14f1ee53db
+8a45147f9df23b12981f1e80554bbae251f594ea
diff --git a/.jenkins/caffe2/test.sh b/.jenkins/caffe2/test.sh
index e605f19..6016911 100755
--- a/.jenkins/caffe2/test.sh
+++ b/.jenkins/caffe2/test.sh
@@ -172,7 +172,7 @@
# ONNX tests #
##############
if [[ "$BUILD_ENVIRONMENT" == *onnx* ]]; then
- pip install -q --user "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)"
+ pip install -q --user --no-use-pep517 "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)"
pip install -q --user ninja flatbuffers==2.0 numpy==1.21.5 onnxruntime==1.11.0
# numba requires numpy <= 1.20, onnxruntime requires numpy >= 1.21.
# We don't actually need it for our tests, but it's imported if it's present, so uninstall.
diff --git a/.jenkins/pytorch/common_utils.sh b/.jenkins/pytorch/common_utils.sh
index c02739f..16781e6 100644
--- a/.jenkins/pytorch/common_utils.sh
+++ b/.jenkins/pytorch/common_utils.sh
@@ -98,7 +98,7 @@
function install_torchvision() {
local commit
commit=$(get_pinned_commit vision)
- pip_install --user "git+https://github.com/pytorch/vision.git@${commit}"
+ pip_install --no-use-pep517 --user "git+https://github.com/pytorch/vision.git@${commit}"
}
function checkout_install_torchvision() {
diff --git a/test/onnx/test_pytorch_onnx_onnxruntime.py b/test/onnx/test_pytorch_onnx_onnxruntime.py
index 2382490..199bf0b 100644
--- a/test/onnx/test_pytorch_onnx_onnxruntime.py
+++ b/test/onnx/test_pytorch_onnx_onnxruntime.py
@@ -9948,6 +9948,9 @@
self.run_test(Module(), (boxes, scores))
+ @unittest.skip(
+ "Broken in recent TorchVision, see https://github.com/pytorch/pytorch/issues/81121"
+ )
@skipIfUnsupportedMinOpsetVersion(11)
# TODO: Fails with vision 0.13. See #77671
def test_batched_nms(self):
@@ -9985,6 +9988,9 @@
additional_test_inputs=[(boxes, size), (boxes, size_2)],
)
+ @unittest.skip(
+ "Broken in recent TorchVision, see https://github.com/pytorch/pytorch/issues/81121"
+ )
@skipIfUnsupportedMaxOpsetVersion(15) # TODO: Opset 16 RoiAlign result mismatch
@skipIfUnsupportedMinOpsetVersion(11)
def test_roi_align(self):
@@ -9993,6 +9999,9 @@
model = ops.RoIAlign((5, 5), 1.0, 2)
self.run_test(model, (x, single_roi))
+ @unittest.skip(
+ "Broken in recent TorchVision, see https://github.com/pytorch/pytorch/issues/81121"
+ )
@skipIfUnsupportedMaxOpsetVersion(15) # TODO: Opset 16 RoiAlign result mismatch
@skipIfUnsupportedMinOpsetVersion(11)
def test_roi_align_aligned(self):
@@ -10016,6 +10025,9 @@
model4 = ops.RoIAlign((2, 2), 2.5, 0, aligned=True)
self.run_test(model4, (x, single_roi))
+ @unittest.skip(
+ "Broken in recent TorchVision, see https://github.com/pytorch/pytorch/issues/81121"
+ )
@skipIfUnsupportedMinOpsetVersion(11)
def test_roi_pool(self):
x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
diff --git a/test/package/test_directory_reader.py b/test/package/test_directory_reader.py
index 16d1b73..d4bf4ae 100644
--- a/test/package/test_directory_reader.py
+++ b/test/package/test_directory_reader.py
@@ -45,6 +45,7 @@
"""Tests use of DirectoryReader as accessor for opened packages."""
@skipIfNoTorchVision
+ @skipIf(True, "Does not work with latest TorchVision, see https://github.com/pytorch/pytorch/issues/81115")
def test_loading_pickle(self):
"""
Test basic saving and loading of modules and pickles from a DirectoryReader.
diff --git a/test/package/test_model.py b/test/package/test_model.py
index cc0c7d8..05da095 100644
--- a/test/package/test_model.py
+++ b/test/package/test_model.py
@@ -23,6 +23,7 @@
from common import PackageTestCase
+@skipIf(True, "Does not work with recent torchvision, see https://github.com/pytorch/pytorch/issues/81115")
@skipIfNoTorchVision
class ModelTest(PackageTestCase):
"""End-to-end tests packaging an entire model."""
diff --git a/test/test_fx.py b/test/test_fx.py
index 625614d..bdbc20d 100644
--- a/test/test_fx.py
+++ b/test/test_fx.py
@@ -4060,7 +4060,7 @@
@skipIfNoTorchVision
class TestVisionTracing(JitTestCase):
def setUp(self):
- # Checking for mutable operations whil tracing is feature flagged
+ # Checking for mutable operations while tracing is feature flagged
# Enable it in testing but not by default
self.orig_tracer_mutable_flag = torch.fx.proxy.TracerBase.check_mutable_operations
torch.fx.proxy.TracerBase.check_mutable_operations = True
@@ -4076,11 +4076,17 @@
UNTRACEABLE_MODELS = {
"fasterrcnn_resnet50_fpn": PROXY_ITERATED,
+ "fasterrcnn_resnet50_fpn_v2": PROXY_ITERATED,
"fasterrcnn_mobilenet_v3_large_320_fpn": PROXY_ITERATED,
"fasterrcnn_mobilenet_v3_large_fpn": PROXY_ITERATED,
"maskrcnn_resnet50_fpn": PROXY_ITERATED,
+ "maskrcnn_resnet50_fpn_v2": PROXY_ITERATED,
"keypointrcnn_resnet50_fpn": PROXY_ITERATED,
"retinanet_resnet50_fpn": PROXY_ITERATED,
+ "retinanet_resnet50_fpn_v2": PROXY_ITERATED,
+ "ssd300_vgg16": PROXY_ITERATED,
+ "fcos_resnet50_fpn": PROXY_ITERATED,
+ "ssdlite320_mobilenet_v3_large": PROXY_ITERATED,
}
UNSCRIPTABLE_MODELS = {
"googlenet": INCONSISTENT_TYPE,
@@ -4132,7 +4138,7 @@
@classmethod
def generate_classification_tests(cls):
for k, v in torchvision_models.__dict__.items():
- if callable(v) and k[0].lower() == k[0] and k[0] != "_":
+ if callable(v) and k[0].lower() == k[0] and k[0] != "_" and k != 'get_weight':
test_name = 'test_torchvision_models_' + k
x = torch.rand(1, 3, 299, 299) if k in ['inception_v3'] else torch.rand(1, 3, 224, 224)
kwargs = dict(num_classes=50)
@@ -4164,7 +4170,7 @@
for k, v in torchvision_models.video.__dict__.items():
if callable(v) and k[0].lower() == k[0] and k[0] != "_":
test_name = 'test_torchvision_models_video_' + k
- x = torch.rand(1, 3, 4, 112, 112)
+ x = torch.rand(1, 3, 4, 112, 112) if k != 'mvit_v1_b' else torch.rand(1, 3, 16, 224, 224)
kwargs = dict(num_classes=50)
model_test = cls.generate_test_fn(k, v, x, kwargs)
setattr(cls, test_name, model_test)