Skip to content

Commit

Permalink
Switch CI to pytorch 1.13
Browse files Browse the repository at this point in the history
ghstack-source-id: 2bf496b1630f09fc2ef55428b57a65bc508c4289
Pull Request resolved: #521
  • Loading branch information
danthe3rd committed Nov 11, 2022
1 parent 8367685 commit e1eef33
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
34 changes: 20 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ install_dep: &install_dep
conda install ninja
echo "Ninja version $(ninja --version)"
conda install pytorch=1.12.1 "torchvision>=0.13" torchaudio cudatoolkit=11.3 -c pytorch -q
conda install pytorch=1.13 torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia -q
$CONDA_PYTHON -m pip install -r requirements-benchmark.txt --progress-bar off
# Mark install as complete
Expand All @@ -109,7 +109,7 @@ install_dep_exp: &install_dep_exp
if [ -f /home/circleci/venv/check_version.py ]; then $CONDA_PYTHON /home/circleci/venv/check_version.py torch gt 1.11 && exit 0; fi
# start installing
source activate /home/circleci/venv
conda install pytorch=1.12.1 "torchvision>=0.13" torchaudio cudatoolkit=11.3 -c pytorch -q
conda install pytorch=1.13 torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia -q
$CONDA_PYTHON -m pip install -r experimental/requirements.txt --progress-bar off
install_repo: &install_repo
Expand Down Expand Up @@ -375,6 +375,8 @@ jobs:
parameters:
dockerimage:
type: string
pytorch_version:
type: string
cu_version:
type: string

Expand All @@ -396,8 +398,8 @@ jobs:
no_output_timeout: 20m
command: |
git submodule update --init --recursive
python packaging/conda/build_conda.py --cuda << parameters.cu_version >> --python 3.9 --pytorch 1.12.1 --upload-dev
python packaging/conda/build_conda.py --cuda << parameters.cu_version >> --python 3.10 --pytorch 1.12.1 --upload-dev
python packaging/conda/build_conda.py --cuda << parameters.cu_version >> --python 3.9 --pytorch << parameters.pytorch_version >>
python packaging/conda/build_conda.py --cuda << parameters.cu_version >> --python 3.10 --pytorch << parameters.pytorch_version >>
gpu_tests_cu114_sm75:
<<: *gpu_cu114
Expand Down Expand Up @@ -542,21 +544,25 @@ workflows:
- gh-pages

- build_conda:
name: conda_build_cu113
name: conda_build_cu113_1.12.1
dockerimage: pytorch/conda-builder:cuda113
cu_version: "11.3"
filters:
branches:
only:
- main
pytorch_version: "1.12.1"
- build_conda:
name: conda_build_cu116
name: conda_build_cu116_1.12.1
dockerimage: pytorch/conda-builder:cuda116
cu_version: "11.6"
filters:
branches:
only:
- main
pytorch_version: "1.12.1"
- build_conda:
name: conda_build_cu116_1.13
dockerimage: pytorch/conda-builder:cuda116
cu_version: "11.6"
pytorch_version: "1.13"
- build_conda:
name: conda_build_cu117_1.13
dockerimage: pytorch/conda-builder:cuda117
cu_version: "11.7"
pytorch_version: "1.13"
- binary_linux_wheel:
python_version: "3.7"
name: binary_linux_wheel_py37_cu102
Expand Down
12 changes: 9 additions & 3 deletions packaging/conda/build_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"1.11.0": ["10.2", "11.1", "11.3", "11.5"],
"1.12.0": ["10.2", "11.3", "11.6"],
"1.12.1": ["10.2", "11.3", "11.6"],
"1.13": ["11.6", "11.7"],
}


Expand All @@ -33,6 +34,8 @@ def conda_docker_image_for_cuda(cuda_version):
return "pytorch/conda-builder:cuda115"
if cuda_version == "11.6":
return "pytorch/conda-builder:cuda116"
if cuda_version == "11.7":
return "pytorch/conda-builder:cuda117"
raise ValueError(f"Unknown cuda version {cuda_version}")


Expand Down Expand Up @@ -94,9 +97,12 @@ def _set_env_for_build(self):
os.environ["PYTORCH_VERSION"] = self.pytorch_version
os.environ["CU_VERSION"] = self.cuda_version
os.environ["SOURCE_ROOT_DIR"] = str(SOURCE_ROOT_DIR)
os.environ["CONDA_CUDATOOLKIT_CONSTRAINT"] = version_constraint(
self.cuda_version
)
cuda_constraint = version_constraint(self.cuda_version)
pytorch_version_tuple = tuple(int(v) for v in self.pytorch_version.split('.'))
if pytorch_version_tuple < (1, 13):
os.environ["CONDA_CUDA_CONSTRAINT"] = f"cudatoolkit{cuda_constraint}"
else:
os.environ["CONDA_CUDA_CONSTRAINT"] = f"pytorch-cuda{cuda_constraint}"
os.environ["FORCE_CUDA"] = "1"

if self.conda_always_copy:
Expand Down
4 changes: 2 additions & 2 deletions packaging/conda/xformers/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ requirements:
# - numpy >=1.11
- python
- pytorch=={{ environ.get('PYTORCH_VERSION') }}
- cudatoolkit{{ environ['CONDA_CUDATOOLKIT_CONSTRAINT'] }}
- {{environ['CONDA_CUDA_CONSTRAINT']}}

run:
# - numpy >=1.11
- python
- pytorch=={{ environ.get('PYTORCH_VERSION') }}
- cudatoolkit{{ environ['CONDA_CUDATOOLKIT_CONSTRAINT'] }}
- {{environ['CONDA_CUDA_CONSTRAINT']}}

build:
string: py{{py}}_cu{{ environ['CU_VERSION'] }}_pyt{{ environ['PYTORCH_VERSION']}}
Expand Down
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ click == 8.0.4
protobuf==3.20.1

# Tools for unit tests & coverage.
pytest == 5.4.1
pytest == 7.2.0
pytest-cov == 2.10.0
pytest-mpi == 0.4
pytest-timeout == 1.4.2
Expand All @@ -27,4 +27,4 @@ hydra-core >= 1.1
fairscale >= 0.4.5

# Dependency for fused layers, optional
triton == 2.0.0.dev20220701
triton == 2.0.0.dev20221105

0 comments on commit e1eef33

Please sign in to comment.