|
4 | 4 | pull_request:
|
5 | 5 |
|
6 | 6 | jobs:
|
7 |
| - tests: |
| 7 | + unittests-prototype: |
8 | 8 | strategy:
|
9 | 9 | matrix:
|
10 | 10 | python-version:
|
11 | 11 | - "3.8"
|
12 | 12 | - "3.9"
|
13 | 13 | - "3.10"
|
| 14 | + - "3.11" |
| 15 | + runner: ["linux.12xlarge"] |
14 | 16 | gpu-arch-type: ["cpu"]
|
15 |
| - gpu-arch-version: [""] |
16 |
| - runner: ["linux.2xlarge"] |
17 | 17 | include:
|
18 | 18 | - python-version: "3.8"
|
| 19 | + runner: linux.g5.4xlarge.nvidia.gpu |
19 | 20 | gpu-arch-type: cuda
|
20 | 21 | gpu-arch-version: "11.7"
|
21 |
| - runner: linux.4xlarge.nvidia.gpu |
22 | 22 | fail-fast: false
|
23 | 23 | uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
|
24 | 24 | with:
|
25 |
| - job-name: Python ${{ matrix.python-version }}, ${{ matrix.gpu-arch-type }} |
26 | 25 | repository: pytorch/vision
|
| 26 | + runner: ${{ matrix.runner }} |
27 | 27 | gpu-arch-type: ${{ matrix.gpu-arch-type }}
|
28 | 28 | gpu-arch-version: ${{ matrix.gpu-arch-version }}
|
29 |
| - runner: ${{ matrix.runner }} |
30 |
| - timeout: 45 |
| 29 | + timeout: 120 |
31 | 30 | script: |
|
32 |
| - # Mark Build Directory Safe |
33 |
| -
|
34 |
| - echo '::group::Set PyTorch conda channel' |
35 |
| - if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then |
36 |
| - POSTFIX=test |
37 |
| - else |
38 |
| - POSTFIX=nightly |
39 |
| - fi |
40 |
| - PYTORCH_CHANNEL=pytorch-"${POSTFIX}" |
41 |
| - echo "${PYTORCH_CHANNEL}" |
42 |
| - echo '::endgroup::' |
43 |
| -
|
44 |
| - echo '::group::Set PyTorch conda mutex' |
45 |
| - if [[ ${{ matrix.gpu-arch-type }} = 'cuda' ]]; then |
46 |
| - PYTORCH_MUTEX="pytorch-cuda=${{ matrix.gpu-arch-version }}" |
47 |
| - else |
48 |
| - PYTORCH_MUTEX=cpuonly |
49 |
| - fi |
50 |
| - echo "${PYTORCH_MUTEX}" |
51 |
| - echo '::endgroup::' |
52 |
| -
|
53 |
| - echo '::group::Create conda environment' |
54 |
| - conda create --prefix $PWD/ci \ |
55 |
| - --quiet --yes \ |
56 |
| - python=${{ matrix.python-version }} \ |
57 |
| - numpy libpng jpeg scipy |
58 |
| - conda activate $PWD/ci |
59 |
| - echo '::endgroup::' |
60 |
| -
|
61 |
| - echo '::group::Install PyTorch' |
62 |
| - conda install \ |
63 |
| - --quiet --yes \ |
64 |
| - -c "${PYTORCH_CHANNEL}" \ |
65 |
| - -c nvidia \ |
66 |
| - pytorch \ |
67 |
| - "${PYTORCH_MUTEX}" |
68 |
| - if [[ ${{ matrix.gpu-arch-type }} = 'cuda' ]]; then |
69 |
| - python3 -c "import torch; exit(not torch.cuda.is_available())" |
70 |
| - fi |
71 |
| - echo '::endgroup::' |
72 |
| -
|
73 |
| - echo '::group::Install TorchVision' |
74 |
| - python setup.py develop |
75 |
| - echo '::endgroup::' |
76 |
| -
|
77 |
| - echo '::group::Collect PyTorch environment information' |
78 |
| - python -m torch.utils.collect_env |
79 |
| - echo '::endgroup::' |
| 31 | + set -euo pipefail |
| 32 | +
|
| 33 | + export PYTHON_VERSION=${{ matrix.python-version }} |
| 34 | + export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }} |
| 35 | + export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} |
| 36 | + ./.github/scripts/setup-env.sh |
| 37 | + |
| 38 | + # Prepare conda |
| 39 | + CONDA_PATH=$(which conda) |
| 40 | + eval "$(${CONDA_PATH} shell.bash hook)" |
| 41 | + conda activate ci |
80 | 42 |
|
81 | 43 | echo '::group::Install testing utilities'
|
82 | 44 | pip install --progress-bar=off pytest pytest-mock pytest-cov
|
83 | 45 | echo '::endgroup::'
|
84 | 46 |
|
85 |
| - echo '::group::Run prototype tests' |
86 | 47 | # We don't want to run the prototype datasets tests. Since the positional glob into `pytest`, i.e.
|
87 | 48 | # `test/test_prototype*.py` takes the highest priority, neither `--ignore` nor `--ignore-glob` can help us here.
|
88 | 49 | rm test/test_prototype_datasets*.py
|
89 | 50 | pytest \
|
90 |
| - --durations=25 \ |
91 |
| - --cov=torchvision/prototype \ |
92 |
| - --cov-report=term-missing \ |
93 |
| - test/test_prototype*.py |
94 |
| - echo '::endgroup::' |
| 51 | + -v --durations=25 \ |
| 52 | + --cov=torchvision/prototype --cov-report=term-missing \ |
| 53 | + --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" \ |
| 54 | + test/test_prototype_*.py |
0 commit comments