Skip to content

Commit 104a360

Browse files
authored
6166 drop py37 and torch 1.8 (#6227)
Fixes #6166 ### Description - reviewed the package metadata - keep testing and code logic ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <[email protected]>
1 parent 4f8bc59 commit 104a360

17 files changed

+25
-86
lines changed

.github/workflows/cron.yml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
environment:
16-
- "PT182+CUDA102"
1716
- "PT191+CUDA113"
1817
- "PT110+CUDA113"
1918
- "PT112+CUDA113"
2019
- "PTLATEST+CUDA118"
2120
include:
2221
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
23-
- environment: PT182+CUDA102
24-
pytorch: "torch==1.8.2 torchvision==0.9.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu102"
25-
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
2622
- environment: PT191+CUDA113
2723
pytorch: "torch==1.9.1 torchvision==0.10.1 --extra-index-url https://download.pytorch.org/whl/cu113"
2824
base: "nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
@@ -44,46 +40,8 @@ jobs:
4440
- name: apt install
4541
run: |
4642
# FIXME: workaround for https://github.com/Project-MONAI/MONAI/issues/4200
47-
apt-key del 7fa2af80 && rm -rf /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/cuda.list
4843
apt-get update
4944
apt-get install -y wget
50-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
51-
dpkg -i cuda-keyring_1.0-1_all.deb
52-
53-
if [ ${{ matrix.environment }} = "PT182+CUDA102" ]
54-
then
55-
PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
56-
apt-get update && apt-get install -y --no-install-recommends \
57-
curl \
58-
pkg-config \
59-
python$PYVER \
60-
python$PYVER-dev \
61-
python$PYSFX-pip \
62-
$DISTUTILS \
63-
rsync \
64-
swig \
65-
unzip \
66-
zip \
67-
zlib1g-dev \
68-
libboost-locale-dev \
69-
libboost-program-options-dev \
70-
libboost-system-dev \
71-
libboost-thread-dev \
72-
libboost-test-dev \
73-
libgoogle-glog-dev \
74-
libjsoncpp-dev \
75-
cmake \
76-
git && \
77-
rm -rf /var/lib/apt/lists/* && \
78-
export PYTHONIOENCODING=utf-8 LC_ALL=C.UTF-8 && \
79-
rm -f /usr/bin/python && \
80-
rm -f /usr/bin/python`echo $PYVER | cut -c1-1` && \
81-
ln -s /usr/bin/python$PYVER /usr/bin/python && \
82-
ln -s /usr/bin/python$PYVER /usr/bin/python`echo $PYVER | cut -c1-1` &&
83-
curl -O https://bootstrap.pypa.io/get-pip.py && \
84-
python get-pip.py && \
85-
rm get-pip.py;
86-
fi
8745
- name: Install the dependencies
8846
run: |
8947
which python
@@ -164,7 +122,7 @@ jobs:
164122
if: github.repository == 'Project-MONAI/MONAI'
165123
strategy:
166124
matrix:
167-
container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.12"] # 21.02, 21.10 for backward comp.
125+
container: ["pytorch:22.09", "pytorch:22.11", "pytorch:22.12"]
168126
container:
169127
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
170128
options: "--gpus all"

.github/workflows/pythonapp-gpu.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,12 @@ jobs:
2121
strategy:
2222
matrix:
2323
environment:
24-
- "PT18+CUDA102"
2524
- "PT19+CUDA114DOCKER"
2625
- "PT110+CUDA111"
2726
- "PT112+CUDA118DOCKER"
2827
- "PT113+CUDA116"
2928
include:
3029
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
31-
- environment: PT18+CUDA102
32-
# pytorch 1.8.2 LTS
33-
pytorch: "torch==1.8.2 torchvision==0.9.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu102"
34-
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
3530
- environment: PT19+CUDA114DOCKER
3631
# 21.10: 1.10.0a0+0aef44c
3732
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
@@ -55,18 +50,13 @@ jobs:
5550
- name: apt install
5651
if: github.event.pull_request.merged != true
5752
run: |
58-
# FIXME: workaround for https://github.com/Project-MONAI/MONAI/issues/4200
59-
apt-key del 7fa2af80 && rm -rf /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/cuda.list
6053
apt-get update
6154
apt-get install -y wget
62-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
63-
dpkg -i cuda-keyring_1.0-1_all.deb
6455
65-
if [ ${{ matrix.environment }} = "PT18+CUDA102" ] || \
66-
[ ${{ matrix.environment }} = "PT110+CUDA111" ] || \
56+
if [ ${{ matrix.environment }} = "PT110+CUDA111" ] || \
6757
[ ${{ matrix.environment }} = "PT113+CUDA116" ]
6858
then
69-
PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
59+
PYVER=3.8 PYSFX=3 DISTUTILS=python3-distutils && \
7060
apt-get update && apt-get install -y --no-install-recommends \
7161
curl \
7262
pkg-config \
@@ -134,7 +124,7 @@ jobs:
134124
# build for the current self-hosted CI Tesla V100
135125
BUILD_MONAI=1 TORCH_CUDA_ARCH_LIST="7.0" ./runtests.sh --build --disttests
136126
./runtests.sh --quick --unittests
137-
if [ ${{ matrix.environment }} = "PT18+CUDA102" ]; then
127+
if [ ${{ matrix.environment }} = "PT113+CUDA116" ]; then
138128
# test the clang-format tool downloading once
139129
coverage run -m tests.clang_format_utils
140130
fi

.github/workflows/pythonapp-min.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
78+
python-version: ['3.8', '3.9', '3.10', '3.11']
7979
timeout-minutes: 40
8080
steps:
8181
- uses: actions/checkout@v3
@@ -120,7 +120,7 @@ jobs:
120120
strategy:
121121
fail-fast: false
122122
matrix:
123-
pytorch-version: ['1.8.2', '1.9.1', '1.10.2', '1.11.0', '1.12.1', 'latest']
123+
pytorch-version: ['1.9.1', '1.10.2', '1.11.0', '1.12.1', '1.13', 'latest']
124124
timeout-minutes: 40
125125
steps:
126126
- uses: actions/checkout@v3
@@ -149,16 +149,8 @@ jobs:
149149
# min. requirements
150150
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
151151
python -m pip install torch
152-
elif [ ${{ matrix.pytorch-version }} == "1.8.2" ]; then
153-
python -m pip install torch==1.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cpu
154-
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
155-
python -m pip install torch==1.9.1
156-
elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then
157-
python -m pip install torch==1.10.2
158-
elif [ ${{ matrix.pytorch-version }} == "1.11.0" ]; then
159-
python -m pip install torch==1.11.0
160-
elif [ ${{ matrix.pytorch-version }} == "1.12.1" ]; then
161-
python -m pip install torch==1.12.1
152+
else
153+
python -m pip install torch==${{ matrix.pytorch-version }}
162154
fi
163155
python -m pip install -r requirements-min.txt
164156
python -m pip list

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
# install the latest pytorch for testing
150150
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
151151
# fresh torch installation according to pyproject.toml
152-
python -m pip install torch>=1.8 torchvision
152+
python -m pip install torch>=1.9 torchvision
153153
- name: Check packages
154154
run: |
155155
pip uninstall monai

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
16+
python-version: ['3.9', '3.10', '3.11']
1717
steps:
1818
- uses: actions/checkout@v3
1919
with:
@@ -82,7 +82,7 @@ jobs:
8282
uses: pypa/gh-action-pypi-publish@release/v1
8383
with:
8484
password: ${{ secrets.TEST_PYPI }}
85-
repository_url: https://test.pypi.org/legacy/
85+
repository-url: https://test.pypi.org/legacy/
8686

8787
versioning:
8888
# compute versioning file from python setup.py

.github/workflows/setupapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: ubuntu-latest
7777
strategy:
7878
matrix:
79-
python-version: ['3.7', '3.8', '3.9', '3.10']
79+
python-version: ['3.9', '3.10']
8080
steps:
8181
- uses: actions/checkout@v3
8282
with:

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sphinx:
1818

1919
# Optionally set the version of Python and requirements required to build your docs
2020
python:
21-
version: 3.7
21+
version: 3.8
2222
install:
2323
- requirements: docs/requirements.txt
2424
# system_packages: true

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ or (for new features that would not break existing functionality):
117117
```
118118

119119
It is recommended that the new test `test_[module_name].py` is constructed by using only
120-
python 3.7+ build-in functions, `torch`, `numpy`, `coverage` (for reporting code coverages) and `parameterized` (for organising test cases) packages.
120+
python 3.8+ build-in functions, `torch`, `numpy`, `coverage` (for reporting code coverages) and `parameterized` (for organising test cases) packages.
121121
If it requires any other external packages, please make sure:
122122
- the packages are listed in [`requirements-dev.txt`](requirements-dev.txt)
123123
- the new test `test_[module_name].py` is added to the `exclude_cases` in [`./tests/min_tests.py`](./tests/min_tests.py) so that

docs/images/python.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-f https://download.pytorch.org/whl/cpu/torch-1.12.1%2Bcpu-cp37-cp37m-linux_x86_64.whl
2-
torch>=1.8
2+
torch>=1.9
33
pytorch-ignite==0.4.11
44
numpy>=1.20
55
itk>=5.2

docs/source/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
---
2121

22-
MONAI's core functionality is written in Python 3 (>= 3.7) and only requires [Numpy](https://numpy.org/) and [Pytorch](https://pytorch.org/).
22+
MONAI's core functionality is written in Python 3 (>= 3.8) and only requires [Numpy](https://numpy.org/) and [Pytorch](https://pytorch.org/).
2323

2424
The package is currently distributed via Github as the primary source code repository,
2525
and the Python package index (PyPI). The pre-built Docker images are made available on DockerHub.

environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
- conda-forge
77
dependencies:
88
- numpy>=1.20
9-
- pytorch>=1.8
9+
- pytorch>=1.9
1010
- torchvision
1111
- pytorch-cuda=11.6
1212
- pip

monai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from ._version import get_versions
1818

1919
PY_REQUIRED_MAJOR = 3
20-
PY_REQUIRED_MINOR = 7
20+
PY_REQUIRED_MINOR = 8
2121

2222
version_dict = get_versions()
2323
__version__: str = version_dict.get("version", "0+unknown")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
requires = [
33
"wheel",
44
"setuptools",
5-
"torch>=1.8",
5+
"torch>=1.9",
66
"ninja",
77
]
88

99
[tool.black]
1010
line-length = 120
11-
target-version = ['py37', 'py38', 'py39', 'py310']
11+
target-version = ['py38', 'py39', 'py310']
1212
include = '\.pyi?$'
1313
exclude = '''
1414
(

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
torch>=1.8
1+
torch>=1.9
22
numpy>=1.20

setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ classifiers =
2121
Intended Audience :: Healthcare Industry
2222
Programming Language :: C++
2323
Programming Language :: Python :: 3
24-
Programming Language :: Python :: 3.7
2524
Programming Language :: Python :: 3.8
2625
Programming Language :: Python :: 3.9
2726
Programming Language :: Python :: 3.10
@@ -34,15 +33,15 @@ classifiers =
3433
Typing :: Typed
3534

3635
[options]
37-
python_requires = >= 3.7
36+
python_requires = >= 3.8
3837
# for compiling and develop setup only
3938
# no need to specify the versions so that we could
4039
# compile for multiple targeted versions.
4140
setup_requires =
4241
torch
4342
ninja
4443
install_requires =
45-
torch>=1.8
44+
torch>=1.9
4645
numpy>=1.20
4746

4847
[options.extras_require]

tests/testing_data/integration_answers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
],
222222
},
223223
},
224-
{ # test answers for PyTorch 1.8
224+
{ # test answers for cuda 10.x
225225
"integration_classification_2d": {
226226
"losses": [0.777176220515731, 0.16019743723664315, 0.07480076164197011, 0.045643698364780966],
227227
"best_metric": 0.9999418774120775,

0 commit comments

Comments
 (0)