From f4d3f913f40713cb41485a7f8aab3a31b59e86e6 Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Wed, 31 Jan 2024 13:41:18 +0530 Subject: [PATCH] Pin torch < 2.2.0 in test runners (#6780) * update * update --------- Co-authored-by: Sayak Paul --- docker/diffusers-onnxruntime-cpu/Dockerfile | 6 +++--- docker/diffusers-onnxruntime-cuda/Dockerfile | 6 +++--- docker/diffusers-pytorch-compile-cuda/Dockerfile | 10 +++++----- docker/diffusers-pytorch-cpu/Dockerfile | 6 +++--- docker/diffusers-pytorch-cuda/Dockerfile | 6 +++--- docker/diffusers-pytorch-xformers-cuda/Dockerfile | 6 +++--- setup.py | 4 ++-- src/diffusers/dependency_versions_table.py | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docker/diffusers-onnxruntime-cpu/Dockerfile b/docker/diffusers-onnxruntime-cpu/Dockerfile index 75f45be87a..ef8205e282 100644 --- a/docker/diffusers-onnxruntime-cpu/Dockerfile +++ b/docker/diffusers-onnxruntime-cpu/Dockerfile @@ -24,9 +24,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ onnxruntime \ --extra-index-url https://download.pytorch.org/whl/cpu && \ python3 -m pip install --no-cache-dir \ diff --git a/docker/diffusers-onnxruntime-cuda/Dockerfile b/docker/diffusers-onnxruntime-cuda/Dockerfile index 2129dbcaf6..76db288f59 100644 --- a/docker/diffusers-onnxruntime-cuda/Dockerfile +++ b/docker/diffusers-onnxruntime-cuda/Dockerfile @@ -24,9 +24,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ "onnxruntime-gpu>=1.13.1" \ --extra-index-url https://download.pytorch.org/whl/cu117 && \ python3 -m pip install --no-cache-dir \ diff --git a/docker/diffusers-pytorch-compile-cuda/Dockerfile b/docker/diffusers-pytorch-compile-cuda/Dockerfile index e1e63758a4..5e6be6831e 100644 --- a/docker/diffusers-pytorch-compile-cuda/Dockerfile +++ b/docker/diffusers-pytorch-compile-cuda/Dockerfile @@ -26,9 +26,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3.9 -m pip install --no-cache-dir --upgrade pip && \ python3.9 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ invisible_watermark && \ python3.9 -m pip install --no-cache-dir \ accelerate \ @@ -40,6 +40,6 @@ RUN python3.9 -m pip install --no-cache-dir --upgrade pip && \ numpy \ scipy \ tensorboard \ - transformers - + transformers + CMD ["/bin/bash"] diff --git a/docker/diffusers-pytorch-cpu/Dockerfile b/docker/diffusers-pytorch-cpu/Dockerfile index 127c61a719..66412d7502 100644 --- a/docker/diffusers-pytorch-cpu/Dockerfile +++ b/docker/diffusers-pytorch-cpu/Dockerfile @@ -25,9 +25,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ invisible_watermark \ --extra-index-url https://download.pytorch.org/whl/cpu && \ python3 -m pip install --no-cache-dir \ diff --git a/docker/diffusers-pytorch-cuda/Dockerfile b/docker/diffusers-pytorch-cuda/Dockerfile index 7fc3d8ced9..efc995e26b 100644 --- a/docker/diffusers-pytorch-cuda/Dockerfile +++ b/docker/diffusers-pytorch-cuda/Dockerfile @@ -25,9 +25,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ invisible_watermark && \ python3 -m pip install --no-cache-dir \ accelerate \ diff --git a/docker/diffusers-pytorch-xformers-cuda/Dockerfile b/docker/diffusers-pytorch-xformers-cuda/Dockerfile index 8f2619c623..56a46ab865 100644 --- a/docker/diffusers-pytorch-xformers-cuda/Dockerfile +++ b/docker/diffusers-pytorch-xformers-cuda/Dockerfile @@ -25,9 +25,9 @@ ENV PATH="/opt/venv/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.1.2 \ + torchvision==0.16.2 \ + torchaudio==2.1.2 \ invisible_watermark && \ python3 -m pip install --no-cache-dir \ accelerate \ diff --git a/setup.py b/setup.py index bb0f378170..d63ea8519d 100644 --- a/setup.py +++ b/setup.py @@ -126,8 +126,8 @@ _deps = [ "regex!=2019.12.17", "requests", "tensorboard", - "torch>=1.4", - "torchvision", + "torch>=1.4,<2.2.0", + "torchvision<0.17", "transformers>=4.25.1", "urllib3<=2.0.0", ] diff --git a/src/diffusers/dependency_versions_table.py b/src/diffusers/dependency_versions_table.py index e92a486bff..618cac807c 100644 --- a/src/diffusers/dependency_versions_table.py +++ b/src/diffusers/dependency_versions_table.py @@ -38,8 +38,8 @@ deps = { "regex": "regex!=2019.12.17", "requests": "requests", "tensorboard": "tensorboard", - "torch": "torch>=1.4", - "torchvision": "torchvision", + "torch": "torch>=1.4,<2.2.0", + "torchvision": "torchvision<0.17", "transformers": "transformers>=4.25.1", "urllib3": "urllib3<=2.0.0", }