diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 939cce9ffb00..dc3aa102be78 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -7,7 +7,7 @@ on: env: DIFFUSERS_IS_CI: yes - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 HF_HOME: /mnt/cache OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 diff --git a/.github/workflows/build_docker_images.yml b/.github/workflows/build_docker_images.yml index 1d7be0d6bce0..b1af44736730 100644 --- a/.github/workflows/build_docker_images.yml +++ b/.github/workflows/build_docker_images.yml @@ -42,18 +42,39 @@ jobs: CHANGED_FILES: ${{ steps.file_changes.outputs.all }} run: | echo "$CHANGED_FILES" - for FILE in $CHANGED_FILES; do + ALLOWED_IMAGES=( + diffusers-pytorch-cpu + diffusers-pytorch-cuda + diffusers-pytorch-xformers-cuda + diffusers-pytorch-minimum-cuda + diffusers-doc-builder + ) + + declare -A IMAGES_TO_BUILD=() + + for FILE in $CHANGED_FILES; do # skip anything that isn't still on disk - if [[ ! -f "$FILE" ]]; then + if [[ ! -e "$FILE" ]]; then echo "Skipping removed file $FILE" continue - fi - if [[ "$FILE" == docker/*Dockerfile ]]; then - DOCKER_PATH="${FILE%/Dockerfile}" - DOCKER_TAG=$(basename "$DOCKER_PATH") - echo "Building Docker image for $DOCKER_TAG" - docker build -t "$DOCKER_TAG" "$DOCKER_PATH" fi + + for IMAGE in "${ALLOWED_IMAGES[@]}"; do + if [[ "$FILE" == docker/${IMAGE}/* ]]; then + IMAGES_TO_BUILD["$IMAGE"]=1 + fi + done + done + + if [[ ${#IMAGES_TO_BUILD[@]} -eq 0 ]]; then + echo "No relevant Docker changes detected." + exit 0 + fi + + for IMAGE in "${!IMAGES_TO_BUILD[@]}"; do + DOCKER_PATH="docker/${IMAGE}" + echo "Building Docker image for $IMAGE" + docker build -t "$IMAGE" "$DOCKER_PATH" done if: steps.file_changes.outputs.all != '' diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index c8fa3a7ad93a..1738efd63bb7 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -7,7 +7,7 @@ on: env: DIFFUSERS_IS_CI: yes - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 PYTEST_TIMEOUT: 600 diff --git a/.github/workflows/pr_modular_tests.yml b/.github/workflows/pr_modular_tests.yml index 83c84fbab219..7081ee518d55 100644 --- a/.github/workflows/pr_modular_tests.yml +++ b/.github/workflows/pr_modular_tests.yml @@ -26,7 +26,7 @@ concurrency: env: DIFFUSERS_IS_CI: yes - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 OMP_NUM_THREADS: 4 MKL_NUM_THREADS: 4 PYTEST_TIMEOUT: 60 diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 03205fcec6ef..3306ebe43ef7 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -22,7 +22,7 @@ concurrency: env: DIFFUSERS_IS_CI: yes - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 OMP_NUM_THREADS: 4 MKL_NUM_THREADS: 4 PYTEST_TIMEOUT: 60 diff --git a/.github/workflows/pr_tests_gpu.yml b/.github/workflows/pr_tests_gpu.yml index 900a53da9484..6c208ad7cac7 100644 --- a/.github/workflows/pr_tests_gpu.yml +++ b/.github/workflows/pr_tests_gpu.yml @@ -24,7 +24,7 @@ env: DIFFUSERS_IS_CI: yes OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 PYTEST_TIMEOUT: 600 PIPELINE_USAGE_CUTOFF: 1000000000 # set high cutoff so that only always-test pipelines run diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index a1f5e121537d..a10dfcaf4e4d 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -14,7 +14,7 @@ env: DIFFUSERS_IS_CI: yes OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 PYTEST_TIMEOUT: 600 PIPELINE_USAGE_CUTOFF: 50000 diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index 6b1dd0b2d006..ae619d481c48 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -18,7 +18,7 @@ env: HF_HOME: /mnt/cache OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 PYTEST_TIMEOUT: 600 RUN_SLOW: no diff --git a/.github/workflows/push_tests_mps.yml b/.github/workflows/push_tests_mps.yml index eb6c0da22541..484c7a8eeb49 100644 --- a/.github/workflows/push_tests_mps.yml +++ b/.github/workflows/push_tests_mps.yml @@ -8,7 +8,7 @@ env: HF_HOME: /mnt/cache OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 - HF_HUB_ENABLE_HF_TRANSFER: 1 + HF_XET_HIGH_PERFORMANCE: 1 PYTEST_TIMEOUT: 600 RUN_SLOW: no diff --git a/docker/diffusers-doc-builder/Dockerfile b/docker/diffusers-doc-builder/Dockerfile index 8453ef4e6c9c..0826901e907e 100644 --- a/docker/diffusers-doc-builder/Dockerfile +++ b/docker/diffusers-doc-builder/Dockerfile @@ -33,7 +33,7 @@ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers. RUN uv pip install --no-cache-dir \ accelerate \ numpy==1.26.4 \ - hf_transfer \ + hf_xet \ setuptools==69.5.1 \ bitsandbytes \ torchao \ diff --git a/docker/diffusers-onnxruntime-cpu/Dockerfile b/docker/diffusers-onnxruntime-cpu/Dockerfile index 20197937cbbe..7bcc6fb9f5ce 100644 --- a/docker/diffusers-onnxruntime-cpu/Dockerfile +++ b/docker/diffusers-onnxruntime-cpu/Dockerfile @@ -44,6 +44,6 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ scipy \ tensorboard \ transformers \ - hf_transfer + hf_xet CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/diffusers-onnxruntime-cuda/Dockerfile b/docker/diffusers-onnxruntime-cuda/Dockerfile index bd1d871033c9..fd425d82c371 100644 --- a/docker/diffusers-onnxruntime-cuda/Dockerfile +++ b/docker/diffusers-onnxruntime-cuda/Dockerfile @@ -38,13 +38,12 @@ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ datasets \ hf-doc-builder \ huggingface-hub \ - hf_transfer \ + hf_xet \ Jinja2 \ librosa \ numpy==1.26.4 \ scipy \ tensorboard \ - transformers \ - hf_transfer + transformers CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/diffusers-pytorch-cpu/Dockerfile b/docker/diffusers-pytorch-cpu/Dockerfile index dc5d0fc71cc7..2db4ece8e2d7 100644 --- a/docker/diffusers-pytorch-cpu/Dockerfile +++ b/docker/diffusers-pytorch-cpu/Dockerfile @@ -31,7 +31,7 @@ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers. RUN uv pip install --no-cache-dir \ accelerate \ numpy==1.26.4 \ - hf_transfer + hf_xet RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean diff --git a/docker/diffusers-pytorch-cuda/Dockerfile b/docker/diffusers-pytorch-cuda/Dockerfile index 2bdfd409b4b4..a700d1db72bc 100644 --- a/docker/diffusers-pytorch-cuda/Dockerfile +++ b/docker/diffusers-pytorch-cuda/Dockerfile @@ -44,6 +44,6 @@ RUN uv pip install --no-cache-dir \ accelerate \ numpy==1.26.4 \ pytorch-lightning \ - hf_transfer + hf_xet CMD ["/bin/bash"] diff --git a/docker/diffusers-pytorch-minimum-cuda/Dockerfile b/docker/diffusers-pytorch-minimum-cuda/Dockerfile index a2ce193f6858..00d077c5da60 100644 --- a/docker/diffusers-pytorch-minimum-cuda/Dockerfile +++ b/docker/diffusers-pytorch-minimum-cuda/Dockerfile @@ -47,6 +47,6 @@ RUN uv pip install --no-cache-dir \ accelerate \ numpy==1.26.4 \ pytorch-lightning \ - hf_transfer + hf_xet CMD ["/bin/bash"] diff --git a/docker/diffusers-pytorch-xformers-cuda/Dockerfile b/docker/diffusers-pytorch-xformers-cuda/Dockerfile index 1ea258bdb710..eae7eaf4faf1 100644 --- a/docker/diffusers-pytorch-xformers-cuda/Dockerfile +++ b/docker/diffusers-pytorch-xformers-cuda/Dockerfile @@ -44,7 +44,7 @@ RUN uv pip install --no-cache-dir \ accelerate \ numpy==1.26.4 \ pytorch-lightning \ - hf_transfer \ + hf_xet \ xformers CMD ["/bin/bash"] diff --git a/tests/quantization/torchao/README.md b/tests/quantization/torchao/README.md index fadc529e12fc..373593091ac0 100644 --- a/tests/quantization/torchao/README.md +++ b/tests/quantization/torchao/README.md @@ -29,7 +29,7 @@ The benchmark results for Flux and CogVideoX can be found in [this](https://gith The tests, and the expected slices, were obtained from the `aws-g6e-xlarge-plus` GPU test runners. To run the slow tests, use the following command or an equivalent: ```bash -HF_HUB_ENABLE_HF_TRANSFER=1 RUN_SLOW=1 pytest -s tests/quantization/torchao/test_torchao.py::SlowTorchAoTests +HF_XET_HIGH_PERFORMANCE=1 RUN_SLOW=1 pytest -s tests/quantization/torchao/test_torchao.py::SlowTorchAoTests ``` `diffusers-cli`: