diff --git a/docker/diffusers-doc-builder/Dockerfile b/docker/diffusers-doc-builder/Dockerfile index 0826901e907e..e75e11783767 100644 --- a/docker/diffusers-doc-builder/Dockerfile +++ b/docker/diffusers-doc-builder/Dockerfile @@ -22,9 +22,9 @@ ENV UV_PYTHON=/usr/local/bin/python # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN pip install uv RUN uv pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.10.0 \ + torchvision==0.25.0 \ + torchaudio==2.10.0 \ --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]" diff --git a/docker/diffusers-onnxruntime-cpu/Dockerfile b/docker/diffusers-onnxruntime-cpu/Dockerfile index 7bcc6fb9f5ce..25bbb347cf0b 100644 --- a/docker/diffusers-onnxruntime-cpu/Dockerfile +++ b/docker/diffusers-onnxruntime-cpu/Dockerfile @@ -28,9 +28,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 uv==0.1.11 && \ python3 -m uv pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio\ + torch==2.10.0 \ + torchvision==0.25.0 \ + torchaudio==2.10.0 \ onnxruntime \ --extra-index-url https://download.pytorch.org/whl/cpu && \ python3 -m uv pip install --no-cache-dir \ diff --git a/docker/diffusers-pytorch-cpu/Dockerfile b/docker/diffusers-pytorch-cpu/Dockerfile index 2db4ece8e2d7..0d2ca75940ec 100644 --- a/docker/diffusers-pytorch-cpu/Dockerfile +++ b/docker/diffusers-pytorch-cpu/Dockerfile @@ -20,9 +20,9 @@ ENV UV_PYTHON=/usr/local/bin/python # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) RUN pip install uv RUN uv pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.10.0 \ + torchvision==0.25.0 \ + torchaudio==2.10.0 \ --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]" diff --git a/docker/diffusers-pytorch-cuda/Dockerfile b/docker/diffusers-pytorch-cuda/Dockerfile index b11d8a491168..b6eedaad50ba 100644 --- a/docker/diffusers-pytorch-cuda/Dockerfile +++ b/docker/diffusers-pytorch-cuda/Dockerfile @@ -32,11 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV} ENV PATH="$VIRTUAL_ENV/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) -# Install torch, torchvision, and torchaudio together to ensure compatibility +# Pin torch, torchvision, and torchaudio to a matching set so the torchvision C++ +# extension's ABI lines up with torch (otherwise torchvision::nms fails to register). RUN uv pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.10.0 \ + torchvision==0.25.0 \ + torchaudio==2.10.0 \ --index-url https://download.pytorch.org/whl/cu129 # Install compatible versions of numba/llvmlite for Python 3.10+ diff --git a/docker/diffusers-pytorch-xformers-cuda/Dockerfile b/docker/diffusers-pytorch-xformers-cuda/Dockerfile index 33cae319b93c..9f8d93fb8d32 100644 --- a/docker/diffusers-pytorch-xformers-cuda/Dockerfile +++ b/docker/diffusers-pytorch-xformers-cuda/Dockerfile @@ -32,11 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV} ENV PATH="$VIRTUAL_ENV/bin:$PATH" # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) -# Install torch, torchvision, and torchaudio together to ensure compatibility +# Pin torch, torchvision, and torchaudio to a matching set so the torchvision C++ +# extension's ABI lines up with torch (otherwise torchvision::nms fails to register). RUN uv pip install --no-cache-dir \ - torch \ - torchvision \ - torchaudio \ + torch==2.10.0 \ + torchvision==0.25.0 \ + torchaudio==2.10.0 \ --index-url https://download.pytorch.org/whl/cu129 # Install compatible versions of numba/llvmlite for Python 3.10+