|
| 1 | +# prototype-tests.yml adapted for self-hosted with gpu |
| 2 | +name: tests-gpu |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + prototype: |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + |
| 12 | + runs-on: [self-hosted, linux.4xlarge.nvidia.gpu] |
| 13 | + container: |
| 14 | + image: pytorch/conda-builder:cuda116 |
| 15 | + options: --gpus all |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Run nvidia-smi |
| 19 | + run: nvidia-smi |
| 20 | + |
| 21 | + - name: Upgrade system packages |
| 22 | + run: python -m pip install --upgrade pip setuptools wheel |
| 23 | + |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: Install PyTorch nightly builds |
| 28 | + run: pip install --progress-bar=off --pre torch torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cu116/ |
| 29 | + |
| 30 | + - name: Install torchvision |
| 31 | + run: pip install --progress-bar=off --no-build-isolation --editable . |
| 32 | + |
| 33 | + - name: Install other prototype dependencies |
| 34 | + run: pip install --progress-bar=off scipy pycocotools h5py iopath |
| 35 | + |
| 36 | + - name: Install test requirements |
| 37 | + run: pip install --progress-bar=off pytest pytest-mock pytest-cov |
| 38 | + |
| 39 | + - name: Mark setup as complete |
| 40 | + id: setup |
| 41 | + run: python -c "import torch; exit(not torch.cuda.is_available())" |
| 42 | + |
| 43 | + - name: Run prototype features tests |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + pytest \ |
| 47 | + --durations=20 \ |
| 48 | + --cov=torchvision/prototype/features \ |
| 49 | + --cov-report=term-missing \ |
| 50 | + test/test_prototype_features*.py |
| 51 | +
|
| 52 | + - name: Run prototype datasets tests |
| 53 | + if: success() || ( failure() && steps.setup.conclusion == 'success' ) |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + pytest \ |
| 57 | + --durations=20 \ |
| 58 | + --cov=torchvision/prototype/datasets \ |
| 59 | + --cov-report=term-missing \ |
| 60 | + test/test_prototype_datasets*.py |
| 61 | +
|
| 62 | + - name: Run prototype transforms tests |
| 63 | + if: success() || ( failure() && steps.setup.conclusion == 'success' ) |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + pytest \ |
| 67 | + --durations=20 \ |
| 68 | + --cov=torchvision/prototype/transforms \ |
| 69 | + --cov-report=term-missing \ |
| 70 | + test/test_prototype_transforms*.py |
| 71 | +
|
| 72 | + - name: Run prototype models tests |
| 73 | + if: success() || ( failure() && steps.setup.conclusion == 'success' ) |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + pytest \ |
| 77 | + --durations=20 \ |
| 78 | + --cov=torchvision/prototype/models \ |
| 79 | + --cov-report=term-missing \ |
| 80 | + test/test_prototype_models*.py |
0 commit comments