Skip to content

Commit 537b7fc

Browse files
sayakpaulyiyixuxu
andauthored
Pin torchvision, torch, and torchaudio versions (#13757)
up Co-authored-by: YiYi Xu <yixu310@gmail.com>
1 parent 33becab commit 537b7fc

5 files changed

Lines changed: 19 additions & 17 deletions

File tree

docker/diffusers-doc-builder/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ ENV UV_PYTHON=/usr/local/bin/python
2222
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2323
RUN pip install uv
2424
RUN uv pip install --no-cache-dir \
25-
torch \
26-
torchvision \
27-
torchaudio \
25+
torch==2.10.0 \
26+
torchvision==0.25.0 \
27+
torchaudio==2.10.0 \
2828
--extra-index-url https://download.pytorch.org/whl/cpu
2929

3030
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"

docker/diffusers-onnxruntime-cpu/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ ENV PATH="/opt/venv/bin:$PATH"
2828
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2929
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
3030
python3 -m uv pip install --no-cache-dir \
31-
torch \
32-
torchvision \
33-
torchaudio\
31+
torch==2.10.0 \
32+
torchvision==0.25.0 \
33+
torchaudio==2.10.0 \
3434
onnxruntime \
3535
--extra-index-url https://download.pytorch.org/whl/cpu && \
3636
python3 -m uv pip install --no-cache-dir \

docker/diffusers-pytorch-cpu/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ ENV UV_PYTHON=/usr/local/bin/python
2020
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2121
RUN pip install uv
2222
RUN uv pip install --no-cache-dir \
23-
torch \
24-
torchvision \
25-
torchaudio \
23+
torch==2.10.0 \
24+
torchvision==0.25.0 \
25+
torchaudio==2.10.0 \
2626
--extra-index-url https://download.pytorch.org/whl/cpu
2727

2828
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"

docker/diffusers-pytorch-cuda/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
3232
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3333

3434
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
35-
# Install torch, torchvision, and torchaudio together to ensure compatibility
35+
# Pin torch, torchvision, and torchaudio to a matching set so the torchvision C++
36+
# extension's ABI lines up with torch (otherwise torchvision::nms fails to register).
3637
RUN uv pip install --no-cache-dir \
37-
torch \
38-
torchvision \
39-
torchaudio \
38+
torch==2.10.0 \
39+
torchvision==0.25.0 \
40+
torchaudio==2.10.0 \
4041
--index-url https://download.pytorch.org/whl/cu129
4142

4243
# Install compatible versions of numba/llvmlite for Python 3.10+

docker/diffusers-pytorch-xformers-cuda/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
3232
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3333

3434
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
35-
# Install torch, torchvision, and torchaudio together to ensure compatibility
35+
# Pin torch, torchvision, and torchaudio to a matching set so the torchvision C++
36+
# extension's ABI lines up with torch (otherwise torchvision::nms fails to register).
3637
RUN uv pip install --no-cache-dir \
37-
torch \
38-
torchvision \
39-
torchaudio \
38+
torch==2.10.0 \
39+
torchvision==0.25.0 \
40+
torchaudio==2.10.0 \
4041
--index-url https://download.pytorch.org/whl/cu129
4142

4243
# Install compatible versions of numba/llvmlite for Python 3.10+

0 commit comments

Comments
 (0)