Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
854a0465
Unverified
Commit
854a0465
authored
Jan 07, 2025
by
Dhruv Nair
Committed by
GitHub
Jan 07, 2025
Browse files
[CI] Add minimal testing for legacy Torch versions (#10479)
* update * update
parent
628f2c54
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
1 deletion
+169
-1
.github/workflows/build_docker_images.yml
.github/workflows/build_docker_images.yml
+2
-1
.github/workflows/nightly_tests.yml
.github/workflows/nightly_tests.yml
+57
-0
.github/workflows/release_tests_fast.yml
.github/workflows/release_tests_fast.yml
+57
-0
docker/diffusers-pytorch-minimum-cuda/Dockerfile
docker/diffusers-pytorch-minimum-cuda/Dockerfile
+53
-0
No files found.
.github/workflows/build_docker_images.yml
View file @
854a0465
...
@@ -34,7 +34,7 @@ jobs:
...
@@ -34,7 +34,7 @@ jobs:
id
:
file_changes
id
:
file_changes
uses
:
jitterbit/get-changed-files@v1
uses
:
jitterbit/get-changed-files@v1
with
:
with
:
format
:
'
space-delimited
'
format
:
"
space-delimited
"
token
:
${{ secrets.GITHUB_TOKEN }}
token
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Build Changed Docker Images
-
name
:
Build Changed Docker Images
...
@@ -67,6 +67,7 @@ jobs:
...
@@ -67,6 +67,7 @@ jobs:
-
diffusers-pytorch-cuda
-
diffusers-pytorch-cuda
-
diffusers-pytorch-compile-cuda
-
diffusers-pytorch-compile-cuda
-
diffusers-pytorch-xformers-cuda
-
diffusers-pytorch-xformers-cuda
-
diffusers-pytorch-minimum-cuda
-
diffusers-flax-cpu
-
diffusers-flax-cpu
-
diffusers-flax-tpu
-
diffusers-flax-tpu
-
diffusers-onnxruntime-cpu
-
diffusers-onnxruntime-cpu
...
...
.github/workflows/nightly_tests.yml
View file @
854a0465
...
@@ -235,7 +235,64 @@ jobs:
...
@@ -235,7 +235,64 @@ jobs:
run
:
|
run
:
|
pip install slack_sdk tabulate
pip install slack_sdk tabulate
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
torch_minimum_version_cuda_tests
:
name
:
Torch Minimum Version CUDA Tests
runs-on
:
group
:
aws-g4dn-2xlarge
container
:
image
:
diffusers/diffusers-pytorch-minimum-cuda
options
:
--shm-size "16gb" --ipc host --gpus
0
defaults
:
run
:
shell
:
bash
steps
:
-
name
:
Checkout diffusers
uses
:
actions/checkout@v3
with
:
fetch-depth
:
2
-
name
:
Install dependencies
run
:
|
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
python -m uv pip install -e [quality,test]
python -m uv pip install peft@git+https://github.com/huggingface/peft.git
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
-
name
:
Environment
run
:
|
python utils/print_env.py
-
name
:
Run PyTorch CUDA tests
env
:
HF_TOKEN
:
${{ secrets.HF_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG
:
:16:8
run
:
|
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-s -v -k "not Flax and not Onnx" \
--make-reports=tests_torch_minimum_version_cuda \
tests/models/test_modelling_common.py \
tests/pipelines/test_pipelines_common.py \
tests/pipelines/test_pipeline_utils.py \
tests/pipelines/test_pipelines.py \
tests/pipelines/test_pipelines_auto.py \
tests/schedulers/test_schedulers.py \
tests/others
-
name
:
Failure short reports
if
:
${{ failure() }}
run
:
|
cat reports/tests_torch_minimum_version_cuda_stats.txt
cat reports/tests_torch_minimum_version_cuda_failures_short.txt
-
name
:
Test suite reports artifacts
if
:
${{ always() }}
uses
:
actions/upload-artifact@v4
with
:
name
:
torch_minimum_version_cuda_test_reports
path
:
reports
run_flax_tpu_tests
:
run_flax_tpu_tests
:
name
:
Nightly Flax TPU Tests
name
:
Nightly Flax TPU Tests
runs-on
:
runs-on
:
...
...
.github/workflows/release_tests_fast.yml
View file @
854a0465
...
@@ -157,6 +157,63 @@ jobs:
...
@@ -157,6 +157,63 @@ jobs:
name
:
torch_cuda_${{ matrix.module }}_test_reports
name
:
torch_cuda_${{ matrix.module }}_test_reports
path
:
reports
path
:
reports
torch_minimum_version_cuda_tests
:
name
:
Torch Minimum Version CUDA Tests
runs-on
:
group
:
aws-g4dn-2xlarge
container
:
image
:
diffusers/diffusers-pytorch-minimum-cuda
options
:
--shm-size "16gb" --ipc host --gpus
0
defaults
:
run
:
shell
:
bash
steps
:
-
name
:
Checkout diffusers
uses
:
actions/checkout@v3
with
:
fetch-depth
:
2
-
name
:
Install dependencies
run
:
|
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
python -m uv pip install -e [quality,test]
python -m uv pip install peft@git+https://github.com/huggingface/peft.git
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
-
name
:
Environment
run
:
|
python utils/print_env.py
-
name
:
Run PyTorch CUDA tests
env
:
HF_TOKEN
:
${{ secrets.HF_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG
:
:16:8
run
:
|
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-s -v -k "not Flax and not Onnx" \
--make-reports=tests_torch_minimum_cuda \
tests/models/test_modelling_common.py \
tests/pipelines/test_pipelines_common.py \
tests/pipelines/test_pipeline_utils.py \
tests/pipelines/test_pipelines.py \
tests/pipelines/test_pipelines_auto.py \
tests/schedulers/test_schedulers.py \
tests/others
-
name
:
Failure short reports
if
:
${{ failure() }}
run
:
|
cat reports/tests_torch_minimum_version_cuda_stats.txt
cat reports/tests_torch_minimum_version_cuda_failures_short.txt
-
name
:
Test suite reports artifacts
if
:
${{ always() }}
uses
:
actions/upload-artifact@v4
with
:
name
:
torch_minimum_version_cuda_test_reports
path
:
reports
flax_tpu_tests
:
flax_tpu_tests
:
name
:
Flax TPU Tests
name
:
Flax TPU Tests
runs-on
:
docker-tpu
runs-on
:
docker-tpu
...
...
docker/diffusers-pytorch-minimum-cuda/Dockerfile
0 → 100644
View file @
854a0465
FROM
nvidia/cuda:12.1.0-runtime-ubuntu20.04
LABEL
maintainer="Hugging Face"
LABEL
repository="diffusers"
ENV
DEBIAN_FRONTEND=noninteractive
ENV
MINIMUM_SUPPORTED_TORCH_VERSION="2.1.0"
ENV
MINIMUM_SUPPORTED_TORCHVISION_VERSION="0.16.0"
ENV
MINIMUM_SUPPORTED_TORCHAUDIO_VERSION="2.1.0"
RUN
apt-get
-y
update
\
&&
apt-get
install
-y
software-properties-common
\
&&
add-apt-repository ppa:deadsnakes/ppa
RUN
apt
install
-y
bash
\
build-essential
\
git
\
git-lfs
\
curl
\
ca-certificates
\
libsndfile1-dev
\
libgl1
\
python3.10
\
python3.10-dev
\
python3-pip
\
python3.10-venv
&&
\
rm
-rf
/var/lib/apt/lists
# make sure to use venv
RUN
python3.10
-m
venv /opt/venv
ENV
PATH="/opt/venv/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN
python3.10
-m
pip
install
--no-cache-dir
--upgrade
pip
uv
==
0.1.11
&&
\
python3.10
-m
uv pip
install
--no-cache-dir
\
torch
==
$MINIMUM_SUPPORTED_TORCH_VERSION
\
torchvision
==
$MINIMUM_SUPPORTED_TORCHVISION_VERSION
\
torchaudio
==
$MINIMUM_SUPPORTED_TORCHAUDIO_VERSION
\
invisible_watermark
&&
\
python3.10
-m
pip
install
--no-cache-dir
\
accelerate
\
datasets
\
hf-doc-builder
\
huggingface-hub
\
hf_transfer
\
Jinja2
\
librosa
\
numpy
==
1.26.4
\
scipy
\
tensorboard
\
transformers
\
hf_transfer
CMD
["/bin/bash"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment