Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.11 Linux CPU Unittesting #7155

Closed
wants to merge 12 commits into from
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