53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
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
|
|
env:
|
|
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
|
|
run: |
|
|
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s tests/
|