Skip to content
35 changes: 26 additions & 9 deletions .github/workflows/test-linux-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ jobs:
tests:
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10"]
python_version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.12xlarge
repository: pytorch/vision
script: |
# Mark Build Directory Safe
set -euxo pipefail
git config --global --add safe.directory /__w/vision/vision

# Set up Environment Variables
Expand All @@ -39,18 +40,34 @@ jobs:
fi

# Create Conda Env
conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg scipy
if [[ "${PYTHON_VERSION}" = "3.11" ]]; then
conda create -yp ci_env -c conda-forge python="${PYTHON_VERSION}" libpng jpeg
# conda install -c pytorch-nightly numpy
python3 -m pip install numpy
else
conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg
fi

conda activate /work/ci_env

# Install PyTorch, Torchvision, and testing libraries
set -ex
conda install \
--yes \
-c "pytorch-${CHANNEL}" \
-c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \
"${CUDATOOLKIT}"
if [[ "${PYTHON_VERSION}" = "3.11" ]]; then
conda install \
--yes \
-c "pytorch-${CHANNEL}" \
-c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \
"${CUDATOOLKIT}"
else
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
fi

python3 setup.py develop
python3 -m pip install pytest pytest-mock 'av<10'
if [[ "${PYTHON_VERSION}" = "3.11" ]]; then
# Looks like the av libraries are not available for 3.11
python3 -m pip install pytest pytest-mock
else
python3 -m pip install pytest pytest-mock 'av<10'
fi

# Run Tests
python3 -m torch.utils.collect_env
Expand Down