2022-08-26 09:34:58 -06:00
|
|
|
name: Run all tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
env:
|
|
|
|
HF_HOME: /mnt/cache
|
|
|
|
OMP_NUM_THREADS: 8
|
|
|
|
MKL_NUM_THREADS: 8
|
|
|
|
PYTEST_TIMEOUT: 1000
|
|
|
|
RUN_SLOW: yes
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run_tests_single_gpu:
|
|
|
|
name: Diffusers tests
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
machine_type: [ single-gpu ]
|
|
|
|
runs-on: [ self-hosted, docker-gpu, '${{ matrix.machine_type }}' ]
|
|
|
|
container:
|
|
|
|
image: nvcr.io/nvidia/pytorch:22.07-py3
|
|
|
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout diffusers
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: NVIDIA-SMI
|
|
|
|
run: |
|
|
|
|
nvidia-smi
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip uninstall -y torch torchvision torchtext
|
|
|
|
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
|
|
|
|
python -m pip install -e .[quality,test]
|
|
|
|
|
|
|
|
- name: Environment
|
|
|
|
run: |
|
|
|
|
python utils/print_env.py
|
|
|
|
|
|
|
|
- name: Run all (incl. slow) tests on GPU
|
2022-08-31 09:26:20 -06:00
|
|
|
env:
|
2022-08-31 09:57:46 -06:00
|
|
|
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
|
2022-08-26 09:34:58 -06:00
|
|
|
run: |
|
2022-09-19 09:08:29 -06:00
|
|
|
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=tests_torch_gpu tests/
|
|
|
|
|
|
|
|
- name: Failure short reports
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run: cat reports/tests_torch_gpu_failures_short.txt
|
|
|
|
|
|
|
|
- name: Test suite reports artifacts
|
|
|
|
if: ${{ always() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-09-21 05:36:59 -06:00
|
|
|
name: torch_test_reports
|
|
|
|
path: reports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_examples_single_gpu:
|
|
|
|
name: Examples tests
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
machine_type: [ single-gpu ]
|
|
|
|
runs-on: [ self-hosted, docker-gpu, '${{ matrix.machine_type }}' ]
|
|
|
|
container:
|
|
|
|
image: nvcr.io/nvidia/pytorch:22.07-py3
|
|
|
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout diffusers
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: NVIDIA-SMI
|
|
|
|
run: |
|
|
|
|
nvidia-smi
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip uninstall -y torch torchvision torchtext
|
|
|
|
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
|
|
|
|
python -m pip install -e .[quality,test,training]
|
|
|
|
|
|
|
|
- name: Environment
|
|
|
|
run: |
|
|
|
|
python utils/print_env.py
|
|
|
|
|
|
|
|
- name: Run example tests on GPU
|
|
|
|
env:
|
|
|
|
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=examples_torch_gpu examples/
|
|
|
|
|
|
|
|
- name: Failure short reports
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run: cat reports/examples_torch_gpu_failures_short.txt
|
|
|
|
|
|
|
|
- name: Test suite reports artifacts
|
|
|
|
if: ${{ always() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: examples_test_reports
|
2022-09-19 09:08:29 -06:00
|
|
|
path: reports
|