From 204995d6d366fd1a121b0643b9d4fcb3cc5e23e5 Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:10:14 +0100 Subject: [PATCH 1/3] Add a new workflow file for XPU nightly CI --- .github/workflows/nightly_tests_xpu.yml | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/nightly_tests_xpu.yml diff --git a/.github/workflows/nightly_tests_xpu.yml b/.github/workflows/nightly_tests_xpu.yml new file mode 100644 index 000000000000..97328e1e1319 --- /dev/null +++ b/.github/workflows/nightly_tests_xpu.yml @@ -0,0 +1,68 @@ +name: Nightly tests on Intel XPU + +on: + workflow_dispatch: + schedule: + - cron: "0 4 * * *" # every day at 4am (offset from the main CUDA nightly) + +env: + DIFFUSERS_IS_CI: yes + OMP_NUM_THREADS: 8 + MKL_NUM_THREADS: 8 + PYTEST_TIMEOUT: 600 + RUN_SLOW: yes + RUN_NIGHTLY: yes + SLACK_API_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} + +permissions: {} + +jobs: + run_nightly_tests_xpu: + permissions: + contents: read + name: Nightly PyTorch XPU tests + runs-on: + group: hfc-intel-b60 + container: + image: huggingface/xpu_ci + options: >- + --shm-size "8g" + --privileged + --network host + -v /dev/dri/by-path:/dev/dri/by-path + --device /dev/dri:/dev/dri + -v /mnt/cache/.cache/huggingface:/mnt/cache/ + + steps: + - name: Checkout diffusers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + + - name: Check XPU availability + run: | + python -c "import torch; assert torch.xpu.is_available(), 'XPU device not available'; print(torch.xpu.get_device_name(0))" + + - name: Run nightly PyTorch XPU tests + run: | + python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ + --make-reports=tests_torch_xpu \ + --report-log=tests_torch_xpu.log \ + tests/ + + - name: Failure short reports + if: ${{ failure() }} + run: cat reports/tests_torch_xpu_failures_short.txt + + - name: Test suite reports artifacts + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: torch_xpu_test_reports + path: reports + + - name: Generate Report and Notify Channel + if: ${{ always() }} + run: | + python -m pip install slack_sdk tabulate + python utils/log_reports.py --slack_channel_name intel-xpu-hf-ci From 7eccca9697ccedeab40beb69d3ff44ddfd72f68c Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:09:11 +0100 Subject: [PATCH 2/3] Use diffusers-cli env --- .github/workflows/nightly_tests_xpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly_tests_xpu.yml b/.github/workflows/nightly_tests_xpu.yml index 97328e1e1319..e004f61eb47f 100644 --- a/.github/workflows/nightly_tests_xpu.yml +++ b/.github/workflows/nightly_tests_xpu.yml @@ -39,9 +39,9 @@ jobs: with: fetch-depth: 2 - - name: Check XPU availability + - name: Check XPU environment run: | - python -c "import torch; assert torch.xpu.is_available(), 'XPU device not available'; print(torch.xpu.get_device_name(0))" + diffusers-cli env - name: Run nightly PyTorch XPU tests run: | From b70f262f4cb8669f2af9f30a7484cf3cab7731fb Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Wed, 2 Dec 2026 06:43:54 +0100 Subject: [PATCH 3/3] Similar jobs to regular nightly tests --- .github/workflows/nightly_tests_xpu.yml | 240 ++++++++++++++++++++++-- 1 file changed, 225 insertions(+), 15 deletions(-) diff --git a/.github/workflows/nightly_tests_xpu.yml b/.github/workflows/nightly_tests_xpu.yml index e004f61eb47f..fa1ea394e86d 100644 --- a/.github/workflows/nightly_tests_xpu.yml +++ b/.github/workflows/nightly_tests_xpu.yml @@ -7,20 +7,23 @@ on: env: DIFFUSERS_IS_CI: yes + HF_XET_HIGH_PERFORMANCE: 1 OMP_NUM_THREADS: 8 MKL_NUM_THREADS: 8 PYTEST_TIMEOUT: 600 RUN_SLOW: yes RUN_NIGHTLY: yes + PIPELINE_USAGE_CUTOFF: 0 SLACK_API_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} + CONSOLIDATED_REPORT_PATH: consolidated_test_report.md permissions: {} jobs: - run_nightly_tests_xpu: + setup_torch_xpu_pipeline_matrix: permissions: contents: read - name: Nightly PyTorch XPU tests + name: Setup Torch Pipelines XPU Slow Tests Matrix runs-on: group: hfc-intel-b60 container: @@ -32,37 +35,244 @@ jobs: -v /dev/dri/by-path:/dev/dri/by-path --device /dev/dri:/dev/dri -v /mnt/cache/.cache/huggingface:/mnt/cache/ + outputs: + pipeline_test_matrix: ${{ steps.fetch_pipeline_matrix.outputs.pipeline_test_matrix }} + steps: + - name: Checkout diffusers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + - name: Fetch Pipeline Matrix + id: fetch_pipeline_matrix + run: | + matrix=$(python utils/fetch_torch_cuda_pipeline_test_matrix.py) + echo $matrix + echo "pipeline_test_matrix=$matrix" >> $GITHUB_OUTPUT + - name: Pipeline Tests Artifacts + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: test-pipelines.json + path: reports + run_nightly_tests_for_torch_pipelines_xpu: + permissions: + contents: read + id-token: write + name: Nightly Torch Pipelines XPU Tests + needs: setup_torch_xpu_pipeline_matrix + strategy: + fail-fast: false + max-parallel: 3 + matrix: + module: ${{ fromJson(needs.setup_torch_xpu_pipeline_matrix.outputs.pipeline_test_matrix) }} + runs-on: + group: hfc-intel-b60 + container: + image: huggingface/xpu_ci + options: >- + --shm-size "8g" + --privileged + --network host + -v /dev/dri/by-path:/dev/dri/by-path + --device /dev/dri:/dev/dri + -v /mnt/cache/.cache/huggingface:/mnt/cache/ + steps: + - name: Checkout diffusers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + - name: Environment + run: | + diffusers-cli env + - name: Pipeline XPU Test + env: + HF_OIDC_RESOURCE: Diffusers-CI-Bot + run: | + pytest -n 1 --max-worker-restart=0 --dist=loadfile \ + --make-reports=tests_pipeline_${{ matrix.module }}_xpu \ + --report-log=tests_pipeline_${{ matrix.module }}_xpu.log \ + tests/pipelines/${{ matrix.module }} + - name: Failure short reports + if: ${{ failure() }} + run: | + cat reports/tests_pipeline_${{ matrix.module }}_xpu_stats.txt + cat reports/tests_pipeline_${{ matrix.module }}_xpu_failures_short.txt + - name: Test suite reports artifacts + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pipeline_${{ matrix.module }}_xpu_test_reports + path: reports + + run_nightly_tests_for_other_torch_modules_xpu: + permissions: + contents: read + id-token: write + name: Nightly Torch XPU Tests + runs-on: + group: hfc-intel-b60 + container: + image: huggingface/xpu_ci + options: >- + --shm-size "8g" + --privileged + --network host + -v /dev/dri/by-path:/dev/dri/by-path + --device /dev/dri:/dev/dri + -v /mnt/cache/.cache/huggingface:/mnt/cache/ + defaults: + run: + shell: bash + strategy: + fail-fast: false + max-parallel: 2 + matrix: + module: [models, schedulers, hooks, lora, others, single_file, examples] steps: - name: Checkout diffusers uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 2 - - name: Check XPU environment + - name: Environment + run: diffusers-cli env + + - name: Run nightly PyTorch XPU tests for non-pipeline modules + if: ${{ matrix.module != 'examples'}} + env: + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | - diffusers-cli env + pytest -n 1 --max-worker-restart=0 --dist=loadfile \ + -m "not compile" \ + --make-reports=tests_torch_${{ matrix.module }}_xpu \ + --report-log=tests_torch_${{ matrix.module }}_xpu.log \ + tests/${{ matrix.module }} - - name: Run nightly PyTorch XPU tests + - name: Run nightly example tests with Torch + if: ${{ matrix.module == 'examples' }} + env: + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | - python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ - --make-reports=tests_torch_xpu \ - --report-log=tests_torch_xpu.log \ - tests/ + pytest -n 1 --max-worker-restart=0 --dist=loadfile \ + --make-reports=examples_torch_xpu \ + --report-log=examples_torch_xpu.log \ + examples/ - name: Failure short reports if: ${{ failure() }} - run: cat reports/tests_torch_xpu_failures_short.txt + run: | + cat reports/tests_torch_${{ matrix.module }}_xpu_stats.txt + cat reports/tests_torch_${{ matrix.module }}_xpu_failures_short.txt - name: Test suite reports artifacts if: ${{ always() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: torch_xpu_test_reports + name: torch_${{ matrix.module }}_xpu_test_reports path: reports - - name: Generate Report and Notify Channel - if: ${{ always() }} + run_torch_compile_tests_xpu: + permissions: + contents: read + id-token: write + name: PyTorch Compile XPU tests + + runs-on: + group: hfc-intel-b60 + + container: + image: huggingface/xpu_ci + options: >- + --shm-size "8g" + --privileged + --network host + -v /dev/dri/by-path:/dev/dri/by-path + --device /dev/dri:/dev/dri + -v /mnt/cache/.cache/huggingface:/mnt/cache/ + + steps: + - name: Checkout diffusers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + + - name: Environment + run: | + diffusers-cli env + - name: Run torch compile tests on XPU + env: + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | - python -m pip install slack_sdk tabulate - python utils/log_reports.py --slack_channel_name intel-xpu-hf-ci + pytest -n 1 --max-worker-restart=0 --dist=loadfile -m compile --make-reports=tests_torch_compile_xpu tests/ + - name: Failure short reports + if: ${{ failure() }} + run: cat reports/tests_torch_compile_xpu_failures_short.txt + + - name: Test suite reports artifacts + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: torch_compile_xpu_test_reports + path: reports + + generate_consolidated_report_xpu: + permissions: + contents: read + name: Generate Consolidated Test Report + needs: [ + run_nightly_tests_for_torch_pipelines_xpu, + run_nightly_tests_for_other_torch_modules_xpu, + run_torch_compile_tests_xpu, + ] + if: always() + runs-on: + group: aws-general-8-plus + container: + image: huggingface/xpu_ci + options: >- + --shm-size "8g" + --privileged + --network host + -v /dev/dri/by-path:/dev/dri/by-path + --device /dev/dri:/dev/dri + -v /mnt/cache/.cache/huggingface:/mnt/cache/ + steps: + - name: Checkout diffusers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + + - name: Create reports directory + run: mkdir -p combined_reports + + - name: Download all test reports + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + path: artifacts + + - name: Prepare reports + run: | + # Move all report files to a single directory for processing + find artifacts -name "*.txt" -exec cp {} combined_reports/ \; + + - name: Install dependencies + run: | + pip install slack_sdk tabulate + + - name: Generate consolidated report + run: | + python utils/consolidated_test_report.py \ + --reports_dir combined_reports \ + --output_file $CONSOLIDATED_REPORT_PATH \ + --slack_channel_name intel-xpu-hf-ci + + - name: Show consolidated report + run: | + cat $CONSOLIDATED_REPORT_PATH >> $GITHUB_STEP_SUMMARY + + - name: Upload consolidated report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: consolidated_test_report + path: ${{ env.CONSOLIDATED_REPORT_PATH }}