Skip to content

Commit c3cc9ac

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] also surface failing tests in prototype jobs (#7416)
Reviewed By: vmoens Differential Revision: D44416625 fbshipit-source-id: b9802db2e084e889266afef0513c4edf5ad86d54
1 parent b7b6b5c commit c3cc9ac

File tree

1 file changed

+21
-61
lines changed

1 file changed

+21
-61
lines changed

.github/workflows/prototype-tests-linux-gpu.yml

Lines changed: 21 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,51 @@ on:
44
pull_request:
55

66
jobs:
7-
tests:
7+
unittests-prototype:
88
strategy:
99
matrix:
1010
python-version:
1111
- "3.8"
1212
- "3.9"
1313
- "3.10"
14+
- "3.11"
15+
runner: ["linux.12xlarge"]
1416
gpu-arch-type: ["cpu"]
15-
gpu-arch-version: [""]
16-
runner: ["linux.2xlarge"]
1717
include:
1818
- python-version: "3.8"
19+
runner: linux.g5.4xlarge.nvidia.gpu
1920
gpu-arch-type: cuda
2021
gpu-arch-version: "11.7"
21-
runner: linux.4xlarge.nvidia.gpu
2222
fail-fast: false
2323
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
2424
with:
25-
job-name: Python ${{ matrix.python-version }}, ${{ matrix.gpu-arch-type }}
2625
repository: pytorch/vision
26+
runner: ${{ matrix.runner }}
2727
gpu-arch-type: ${{ matrix.gpu-arch-type }}
2828
gpu-arch-version: ${{ matrix.gpu-arch-version }}
29-
runner: ${{ matrix.runner }}
30-
timeout: 45
29+
timeout: 120
3130
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
8042
8143
echo '::group::Install testing utilities'
8244
pip install --progress-bar=off pytest pytest-mock pytest-cov
8345
echo '::endgroup::'
8446
85-
echo '::group::Run prototype tests'
8647
# We don't want to run the prototype datasets tests. Since the positional glob into `pytest`, i.e.
8748
# `test/test_prototype*.py` takes the highest priority, neither `--ignore` nor `--ignore-glob` can help us here.
8849
rm test/test_prototype_datasets*.py
8950
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

Comments
 (0)