diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 454cdff5649a..ba2e8d04cbb4 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,6 +20,7 @@ jobs: torch_models_cuda_benchmark_tests: permissions: contents: read + id-token: write env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_BENCHMARK }} name: Torch Core Models CUDA Benchmarking Tests @@ -50,7 +51,7 @@ jobs: diffusers-cli env - name: Diffusers Benchmarking env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | cd benchmarks && python run_all.py diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index 5a6cf75a952d..79c825514231 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -62,6 +62,7 @@ jobs: run_nightly_tests_for_torch_pipelines: permissions: contents: read + id-token: write name: Nightly Torch Pipelines CUDA Tests needs: setup_torch_cuda_pipeline_matrix strategy: @@ -93,7 +94,7 @@ jobs: diffusers-cli env - name: Pipeline CUDA Test env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -116,6 +117,7 @@ jobs: run_nightly_tests_for_other_torch_modules: permissions: contents: read + id-token: write name: Nightly Torch CUDA Tests runs-on: group: aws-g4dn-2xlarge @@ -150,7 +152,7 @@ jobs: - name: Run nightly PyTorch CUDA tests for non-pipeline modules if: ${{ matrix.module != 'examples'}} env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -163,7 +165,7 @@ jobs: - name: Run nightly example tests with Torch if: ${{ matrix.module == 'examples' }} env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -188,6 +190,7 @@ jobs: run_torch_compile_tests: permissions: contents: read + id-token: write name: PyTorch Compile CUDA tests runs-on: @@ -216,7 +219,7 @@ jobs: diffusers-cli env - name: Run torch compile tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | pytest -n 1 --max-worker-restart=0 --dist=loadfile -m compile --make-reports=tests_torch_compile_cuda tests/ - name: Failure short reports @@ -233,6 +236,7 @@ jobs: run_big_gpu_torch_tests: permissions: contents: read + id-token: write name: Torch tests on big GPU strategy: fail-fast: false @@ -262,7 +266,7 @@ jobs: diffusers-cli env - name: Selected Torch CUDA Test on big GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 BIG_GPU_MEMORY: 40 @@ -287,6 +291,7 @@ jobs: torch_minimum_version_cuda_tests: permissions: contents: read + id-token: write name: Torch Minimum Version CUDA Tests runs-on: group: aws-g4dn-2xlarge @@ -316,7 +321,7 @@ jobs: - name: Run PyTorch CUDA tests env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -345,6 +350,7 @@ jobs: run_nightly_quantization_tests: permissions: contents: read + id-token: write name: Torch quantization nightly tests strategy: fail-fast: false @@ -390,7 +396,7 @@ jobs: diffusers-cli env - name: ${{ matrix.config.backend }} quantization tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 BIG_GPU_MEMORY: 40 @@ -417,6 +423,7 @@ jobs: run_nightly_pipeline_level_quantization_tests: permissions: contents: read + id-token: write name: Torch quantization nightly tests strategy: fail-fast: false @@ -445,7 +452,7 @@ jobs: diffusers-cli env - name: Pipeline-level quantization tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 BIG_GPU_MEMORY: 40 diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 9fe6ac29cd08..d395b4b97b0b 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -88,6 +88,7 @@ jobs: run_fast_tests: permissions: contents: read + id-token: write needs: [check_code_quality, check_repository_consistency] strategy: fail-fast: false @@ -122,7 +123,7 @@ jobs: shell: bash env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }} steps: - name: Checkout diffusers @@ -240,6 +241,7 @@ jobs: run_lora_tests: permissions: contents: read + id-token: write needs: [check_code_quality, check_repository_consistency] name: LoRA tests with PEFT main @@ -256,7 +258,7 @@ jobs: shell: bash env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }} steps: - name: Checkout diffusers diff --git a/.github/workflows/pr_tests_gpu.yml b/.github/workflows/pr_tests_gpu.yml index 1e9c2d0effc4..c169a3fa9282 100644 --- a/.github/workflows/pr_tests_gpu.yml +++ b/.github/workflows/pr_tests_gpu.yml @@ -126,6 +126,7 @@ jobs: torch_pipelines_cuda_tests: permissions: contents: read + id-token: write name: Torch Pipelines CUDA Tests needs: setup_torch_cuda_pipeline_matrix strategy: @@ -166,7 +167,7 @@ jobs: - name: PyTorch CUDA checkpoint tests on Ubuntu env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }} # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -197,6 +198,7 @@ jobs: torch_cuda_tests: permissions: contents: read + id-token: write name: Torch CUDA Tests needs: [check_code_quality, check_repository_consistency] runs-on: @@ -239,7 +241,7 @@ jobs: - name: Run PyTorch CUDA tests env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }} # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -268,6 +270,7 @@ jobs: run_examples_tests: permissions: contents: read + id-token: write name: Examples PyTorch CUDA tests on Ubuntu needs: [check_code_quality, check_repository_consistency] runs-on: @@ -297,7 +300,7 @@ jobs: - name: Run example tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }} run: | uv pip install ".[training]" pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/ diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 875ce4e410c2..e2b4478cbcfb 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -65,6 +65,7 @@ jobs: torch_pipelines_cuda_tests: permissions: contents: read + id-token: write name: Torch Pipelines CUDA Tests needs: setup_torch_cuda_pipeline_matrix strategy: @@ -96,7 +97,7 @@ jobs: diffusers-cli env - name: PyTorch CUDA checkpoint tests on Ubuntu env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -118,6 +119,7 @@ jobs: torch_cuda_tests: permissions: contents: read + id-token: write name: Torch CUDA Tests runs-on: group: aws-g4dn-2xlarge @@ -152,7 +154,7 @@ jobs: - name: Run PyTorch CUDA tests env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -177,6 +179,7 @@ jobs: run_torch_compile_tests: permissions: contents: read + id-token: write name: PyTorch Compile CUDA tests runs-on: @@ -205,7 +208,7 @@ jobs: diffusers-cli env - name: Run torch compile tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | pytest -n 1 --max-worker-restart=0 --dist=loadfile -m compile --make-reports=tests_torch_compile_cuda tests/ - name: Failure short reports @@ -222,6 +225,7 @@ jobs: run_examples_tests: permissions: contents: read + id-token: write name: Examples PyTorch CUDA tests on Ubuntu runs-on: @@ -250,7 +254,7 @@ jobs: - name: Run example tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | uv pip install ".[training]" pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/ diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index 42666034a8f8..2f73652c2de7 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -29,6 +29,7 @@ jobs: run_fast_tests: permissions: contents: read + id-token: write strategy: fail-fast: false matrix: @@ -58,7 +59,7 @@ jobs: shell: bash env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot steps: - name: Checkout diffusers diff --git a/.github/workflows/push_tests_mps.yml b/.github/workflows/push_tests_mps.yml index a0e9d7f13d7b..0ae3380f91fa 100644 --- a/.github/workflows/push_tests_mps.yml +++ b/.github/workflows/push_tests_mps.yml @@ -23,6 +23,7 @@ jobs: run_fast_tests_apple_m1: permissions: contents: read + id-token: write name: Fast PyTorch MPS tests on MacOS runs-on: macos-13-xlarge @@ -60,7 +61,7 @@ jobs: shell: arch -arch arm64 bash {0} env: HF_HOME: /System/Volumes/Data/mnt/cache - HF_TOKEN: ${{ secrets.HF_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | ${CONDA_RUN} python -m pytest -n 0 --make-reports=tests_torch_mps tests/ diff --git a/.github/workflows/release_tests_fast.yml b/.github/workflows/release_tests_fast.yml index 3fb34c52663e..9adc29260cc7 100644 --- a/.github/workflows/release_tests_fast.yml +++ b/.github/workflows/release_tests_fast.yml @@ -65,6 +65,7 @@ jobs: torch_pipelines_cuda_tests: permissions: contents: read + id-token: write name: Torch Pipelines CUDA Tests needs: setup_torch_cuda_pipeline_matrix strategy: @@ -96,7 +97,7 @@ jobs: diffusers-cli env - name: Slow PyTorch CUDA checkpoint tests on Ubuntu env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -118,6 +119,7 @@ jobs: torch_cuda_tests: permissions: contents: read + id-token: write name: Torch CUDA Tests runs-on: group: aws-g4dn-2xlarge @@ -152,7 +154,7 @@ jobs: - name: Run PyTorch CUDA tests env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -177,6 +179,7 @@ jobs: torch_minimum_version_cuda_tests: permissions: contents: read + id-token: write name: Torch Minimum Version CUDA Tests runs-on: group: aws-g4dn-2xlarge @@ -206,7 +209,7 @@ jobs: - name: Run PyTorch CUDA tests env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot # https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms CUBLAS_WORKSPACE_CONFIG: :16:8 run: | @@ -235,6 +238,7 @@ jobs: run_torch_compile_tests: permissions: contents: read + id-token: write name: PyTorch Compile CUDA tests runs-on: @@ -263,7 +267,7 @@ jobs: diffusers-cli env - name: Run torch compile tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | pytest -n 1 --max-worker-restart=0 --dist=loadfile -m compile --make-reports=tests_torch_compile_cuda tests/ - name: Failure short reports @@ -280,6 +284,7 @@ jobs: run_examples_tests: permissions: contents: read + id-token: write name: Examples PyTorch CUDA tests on Ubuntu runs-on: @@ -311,7 +316,7 @@ jobs: - name: Run example tests on GPU env: - HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }} + HF_OIDC_RESOURCE: Diffusers-CI-Bot run: | uv pip install ".[training]" pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/