|
1 | | -name: Nightly integration tests |
| 1 | +name: Nightly tests on main |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | schedule: |
|
9 | 9 | HF_HOME: /mnt/cache |
10 | 10 | OMP_NUM_THREADS: 8 |
11 | 11 | MKL_NUM_THREADS: 8 |
12 | | - PYTEST_TIMEOUT: 1000 |
| 12 | + PYTEST_TIMEOUT: 600 |
13 | 13 | RUN_SLOW: yes |
| 14 | + RUN_NIGHTLY: yes |
14 | 15 |
|
15 | 16 | jobs: |
16 | | - run_slow_tests_apple_m1: |
17 | | - name: Slow PyTorch MPS tests on MacOS |
| 17 | + run_nightly_tests: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + config: |
| 22 | + - name: Nightly PyTorch CUDA tests on Ubuntu |
| 23 | + framework: pytorch |
| 24 | + runner: docker-gpu |
| 25 | + image: diffusers/diffusers-pytorch-cuda |
| 26 | + report: torch_cuda |
| 27 | + - name: Nightly Flax TPU tests on Ubuntu |
| 28 | + framework: flax |
| 29 | + runner: docker-tpu |
| 30 | + image: diffusers/diffusers-flax-tpu |
| 31 | + report: flax_tpu |
| 32 | + - name: Nightly ONNXRuntime CUDA tests on Ubuntu |
| 33 | + framework: onnxruntime |
| 34 | + runner: docker-gpu |
| 35 | + image: diffusers/diffusers-onnxruntime-cuda |
| 36 | + report: onnx_cuda |
| 37 | + |
| 38 | + name: ${{ matrix.config.name }} |
| 39 | + |
| 40 | + runs-on: ${{ matrix.config.runner }} |
| 41 | + |
| 42 | + container: |
| 43 | + image: ${{ matrix.config.image }} |
| 44 | + options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/ ${{ matrix.config.runner == 'docker-tpu' && '--privileged' || '--gpus 0'}} |
| 45 | + |
| 46 | + defaults: |
| 47 | + run: |
| 48 | + shell: bash |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout diffusers |
| 52 | + uses: actions/checkout@v3 |
| 53 | + with: |
| 54 | + fetch-depth: 2 |
| 55 | + |
| 56 | + - name: NVIDIA-SMI |
| 57 | + if: ${{ matrix.config.runner == 'docker-gpu' }} |
| 58 | + run: | |
| 59 | + nvidia-smi |
| 60 | +
|
| 61 | + - name: Install dependencies |
| 62 | + run: | |
| 63 | + python -m pip install -e .[quality,test] |
| 64 | + python -m pip install git+https://github.com/huggingface/accelerate |
| 65 | + python -m pip install -U git+https://github.com/huggingface/transformers |
| 66 | +
|
| 67 | + - name: Environment |
| 68 | + run: | |
| 69 | + python utils/print_env.py |
| 70 | +
|
| 71 | + - name: Run nightly PyTorch CUDA tests |
| 72 | + if: ${{ matrix.config.framework == 'pytorch' }} |
| 73 | + env: |
| 74 | + HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} |
| 75 | + run: | |
| 76 | + python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ |
| 77 | + -s -v -k "not Flax and not Onnx" \ |
| 78 | + --make-reports=tests_${{ matrix.config.report }} \ |
| 79 | + tests/ |
| 80 | +
|
| 81 | + - name: Run nightly Flax TPU tests |
| 82 | + if: ${{ matrix.config.framework == 'flax' }} |
| 83 | + env: |
| 84 | + HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} |
| 85 | + run: | |
| 86 | + python -m pytest -n 0 \ |
| 87 | + -s -v -k "Flax" \ |
| 88 | + --make-reports=tests_${{ matrix.config.report }} \ |
| 89 | + tests/ |
| 90 | +
|
| 91 | + - name: Run nightly ONNXRuntime CUDA tests |
| 92 | + if: ${{ matrix.config.framework == 'onnxruntime' }} |
| 93 | + env: |
| 94 | + HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} |
| 95 | + run: | |
| 96 | + python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ |
| 97 | + -s -v -k "Onnx" \ |
| 98 | + --make-reports=tests_${{ matrix.config.report }} \ |
| 99 | + tests/ |
| 100 | +
|
| 101 | + - name: Failure short reports |
| 102 | + if: ${{ failure() }} |
| 103 | + run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt |
| 104 | + |
| 105 | + - name: Test suite reports artifacts |
| 106 | + if: ${{ always() }} |
| 107 | + uses: actions/upload-artifact@v2 |
| 108 | + with: |
| 109 | + name: ${{ matrix.config.report }}_test_reports |
| 110 | + path: reports |
| 111 | + |
| 112 | + run_nightly_tests_apple_m1: |
| 113 | + name: Nightly PyTorch MPS tests on MacOS |
18 | 114 | runs-on: [ self-hosted, apple-m1 ] |
19 | 115 |
|
20 | 116 | steps: |
|
46 | 142 | run: | |
47 | 143 | ${CONDA_RUN} python utils/print_env.py |
48 | 144 |
|
49 | | - - name: Run slow PyTorch tests on M1 (MPS) |
| 145 | + - name: Run nightly PyTorch tests on M1 (MPS) |
50 | 146 | shell: arch -arch arm64 bash {0} |
51 | 147 | env: |
52 | 148 | HF_HOME: /System/Volumes/Data/mnt/cache |
|
0 commit comments