From 47ffa19e0f773354aa5054c19cdf01e3b0daa189 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:06:21 +0100 Subject: [PATCH 1/4] Renaming file since we don't really do the CD part Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/{cicd_tests.yml => ci_tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cicd_tests.yml => ci_tests.yml} (100%) diff --git a/.github/workflows/cicd_tests.yml b/.github/workflows/ci_tests.yml similarity index 100% rename from .github/workflows/cicd_tests.yml rename to .github/workflows/ci_tests.yml From 987e122bb0628bd0cec788d6e457461cd3cc7d53 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 22 Oct 2026 16:51:12 +0100 Subject: [PATCH 2/4] Initial Update to remove Python 3.10 Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/build_docs.yml | 2 +- .github/workflows/ci_tests.yml | 54 +++++++++++++-------------- .github/workflows/conda.yml | 2 +- .github/workflows/cron-ngc-bundle.yml | 4 +- .github/workflows/docker.yml | 4 +- .github/workflows/pythonapp-gpu.yml | 2 +- .github/workflows/release.yml | 12 +++--- .github/workflows/setupapp.yml | 6 +-- .github/workflows/weekly-preview.yml | 4 +- docs/.readthedocs.yaml | 2 +- docs/source/installation.md | 4 +- docs/source/whatsnew_1_6.md | 2 +- environment-dev.yml | 2 +- monai/apps/auto3dseg/auto_runner.py | 2 +- monai/auto3dseg/utils.py | 2 +- pyproject.toml | 14 +++---- 16 files changed, 58 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 8d0d26d99af..74c9a15c4da 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest env: # minimum supported version of Python - PYTHON_VER1: '3.10' + PYTHON_VER1: '3.11' # force installation of CPU-only PyTorch PIP_EXTRA_INDEX_URL: 'https://download.pytorch.org/whl/cpu' steps: diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 28a420d8c8f..9bbbf1ae7c4 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -24,25 +24,26 @@ concurrency: # Supported versions of Python and PyTorch are listed here for use below and as documentation env: # supported versions of Python - PYTHON_VER1: '3.10' - PYTHON_VER2: '3.11' - PYTHON_VER3: '3.12' - PYTHON_VER4: '3.13' + PYTHON_VER1: '3.11' + PYTHON_VER2: '3.12' + PYTHON_VER3: '3.13' + PYTHON_VER4: '3.14' # PYTHON_VER5: '3.14' # TODO: not compatible with Torchscript, re-enable once Torchscript removed from MONAI # supported versions of PyTorch - PYTORCH_VER1: '2.8.0' - PYTORCH_VER2: '2.9.1' - PYTORCH_VER3: '2.10.0' - PYTORCH_VER4: '2.11.0' - TORCHVISION_VER1: '0.23.0' # used for testing with lowest PyTorch version (PYTORCH_VER1), update as needed + PYTORCH_VER1: '2.12.1' + PYTORCH_VER2: '2.13.0' + PYTORCH_VER3: '2.14.0' + PYTORCH_VER4: '2.14.1' + TORCHVISION_VER1: '0.27.1' # used for testing with lowest PyTorch version (PYTORCH_VER1), update as needed # versions of PyTorch/Torchvision to use for full-dep Windows tests, needed to get around a gloo bug - WIN_FULLDEP_VER: '2.11.0' - WIN_FULLDEP_VISION_VER: '0.26.0' + WIN_FULLDEP_VER: '2.12.1' + WIN_FULLDEP_VISION_VER: '0.27.1' + TQDM_DISABLE: 1 # squelch TQDM output to reduce log file size PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354 -# These jobs run the CICD tests, type checking, and testing packaging. These use the minimum supported versions of +# These jobs run the CI tests, type checking, and testing packaging. These use the minimum supported versions of # Python and PyTorch in many places using the above environment variables but also hard coded where necessary. # When support is dropped for a version it is important to update these as appropriate. @@ -133,33 +134,30 @@ jobs: # Base test cases are to test on all three OSes with the lowest versions of Python and PyTorch, other cases are # added below as special cases to cover other Python and PyTorch versions under Ubuntu os: [windows-latest, macOS-latest, ubuntu-latest] - python-version: ['3.10'] - pytorch-version: ['2.8.0'] + python-version: ['3.11'] + pytorch-version: ['2.12.1'] include: # Test Python versions under Ubuntu with lowest PyTorch version supported - os: ubuntu-latest - pytorch-version: '2.8.0' - python-version: '3.11' - - os: ubuntu-latest - pytorch-version: '2.8.0' + pytorch-version: '2.12.1' python-version: '3.12' - os: ubuntu-latest - pytorch-version: '2.8.0' + pytorch-version: '2.12.1' python-version: '3.13' - # - os: ubuntu-latest - # pytorch-version: '2.9.1' - # python-version: '3.14' + - os: ubuntu-latest + pytorch-version: '2.12.1' + python-version: '3.14' # Test PyTorch versions under Ubuntu with lowest Python version supported - os: ubuntu-latest - python-version: '3.10' - pytorch-version: '2.9.1' + python-version: '3.11' + pytorch-version: '2.13.1' - os: ubuntu-latest - python-version: '3.10' - pytorch-version: '2.10.0' + python-version: '3.11' + pytorch-version: '2.14.0' - os: ubuntu-latest - python-version: '3.10' - pytorch-version: '2.11.0' + python-version: '3.11' + pytorch-version: '2.14.1' timeout-minutes: 40 steps: diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 208a133d496..5ba43da3086 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11"] + python-version: ["3.11", "3.12"] runs-on: ${{ matrix.os }} timeout-minutes: 46 # equal to max + 3*std over the last 600 successful runs env: diff --git a/.github/workflows/cron-ngc-bundle.yml b/.github/workflows/cron-ngc-bundle.yml index 1421e1dfc12..360a88bb538 100644 --- a/.github/workflows/cron-ngc-bundle.yml +++ b/.github/workflows/cron-ngc-bundle.yml @@ -21,10 +21,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' cache: pip - name: Install CPU PyTorch run: | diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0813a20b3ee..993a032d0aa 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,10 +29,10 @@ jobs: with: ref: dev fetch-depth: 0 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - shell: bash run: | git describe diff --git a/.github/workflows/pythonapp-gpu.yml b/.github/workflows/pythonapp-gpu.yml index bc7c510713e..dfaf8d55de4 100644 --- a/.github/workflows/pythonapp-gpu.yml +++ b/.github/workflows/pythonapp-gpu.yml @@ -58,7 +58,7 @@ jobs: if [ ${{ matrix.environment }} = "PT230+CUDA124" ] then - PYVER=3.10 PYSFX=3 DISTUTILS=python3-distutils && \ + PYVER=3.11 PYSFX=3 DISTUTILS=python3-distutils && \ apt-get update && apt-get install -y --no-install-recommends \ curl \ pkg-config \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2df2079c7d6..308ba188a9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] steps: - uses: actions/checkout@v7 with: @@ -67,14 +67,14 @@ jobs: env: QUICKTEST: True - - if: matrix.python-version == '3.10' && startsWith(github.ref, 'refs/tags/') + - if: matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/') name: Upload artifacts uses: actions/upload-artifact@v7 with: name: dist path: dist/ - - if: matrix.python-version == '3.10' && startsWith(github.ref, 'refs/tags/') + - if: matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/') name: Check artifacts run: | ls -al dist/ @@ -82,7 +82,7 @@ jobs: ls -al dist/ # remove publishing to Test PyPI as it is moved to blossom - # - if: matrix.python-version == '3.10' && startsWith(github.ref, 'refs/tags/') + # - if: matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/') # name: Publish to Test PyPI # uses: pypa/gh-action-pypi-publish@release/v1 # with: @@ -100,10 +100,10 @@ jobs: # full history so that we can git describe with: fetch-depth: 0 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - shell: bash run: | find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index cb1dda6823a..4b317ae7b66 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -91,7 +91,7 @@ jobs: # runs-on: ubuntu-latest # strategy: # matrix: - # python-version: ['3.10', '3.11', '3.12'] + # python-version: ['3.11', '3.12'] # steps: # - uses: actions/checkout@v7 # with: @@ -136,10 +136,10 @@ jobs: install: # pip install from github url, the default branch is dev runs-on: ubuntu-latest steps: - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - name: Install CPU PyTorch run: | python -m pip install torch==2.8.0 torchvision --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 09ee4fd3ee0..6e5cedd842d 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -12,8 +12,8 @@ on: env: - PYTHON_VER: '3.10' - PYTORCH_VER: '2.8.0' + PYTHON_VER: '3.11' + PYTORCH_VER: '2.12.1' PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster jobs: diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml index 0212e806e8a..3d6e38989ce 100644 --- a/docs/.readthedocs.yaml +++ b/docs/.readthedocs.yaml @@ -6,7 +6,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.11" sphinx: configuration: docs/source/conf.py python: diff --git a/docs/source/installation.md b/docs/source/installation.md index 31c99a794c1..7f3aae33c4b 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -20,7 +20,7 @@ --- -MONAI's core functionality is written in Python 3 (>= 3.10) and only requires [Numpy](https://numpy.org/) and [PyTorch](https://pytorch.org/). +MONAI's core functionality is written in Python 3 (>= 3.11) and only requires [Numpy](https://numpy.org/) and [PyTorch](https://pytorch.org/). The package is currently distributed via Github as the primary source code repository, and the Python package index (PyPI). The pre-built Docker images are made available on DockerHub. @@ -343,6 +343,6 @@ this will install PyTorch as well as `pytorch-cuda`, please follow https://pytor ```bash git clone https://github.com/Project-MONAI/MONAI.git cd MONAI/ -conda create -n python= # eg 3.10 +conda create -n python= # eg 3.11 conda env update -n -f environment-dev.yml ``` diff --git a/docs/source/whatsnew_1_6.md b/docs/source/whatsnew_1_6.md index 0af1509372b..5edab845aa0 100644 --- a/docs/source/whatsnew_1_6.md +++ b/docs/source/whatsnew_1_6.md @@ -14,7 +14,7 @@ - `NumpyReader` has been updated with an `allow_pickle` boolean argument to enable/disable pickle loading from `.npy/.npz` files. This was previously hard-coded to be enabled, but is now defined by this argument and disabled by default. This addresses [GHSA-qxq5-qhx6-94qw](https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-qxq5-qhx6-94qw). -MONAI now tests for Python 3.10 onwards, having dropped version 3.9 which is now out of support. PyTorch 2.8 onwards is now supported only, older versions will likely continue to function. +MONAI now tests for Python 3.11 onwards, having dropped version 3.9 which is now out of support. PyTorch 2.12 onwards is now supported only, older versions will likely continue to function. ## Nested Dot-Notation Access in ConfigParser diff --git a/environment-dev.yml b/environment-dev.yml index 7d6d95a306e..b0f157b1226 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -2,7 +2,7 @@ name: monai channels: - defaults dependencies: - - python>=3.10 + - python>=3.11 - pip - pip: - -e .[all,testing] diff --git a/monai/apps/auto3dseg/auto_runner.py b/monai/apps/auto3dseg/auto_runner.py index c3b7dbe9792..4b7a8f201d6 100644 --- a/monai/apps/auto3dseg/auto_runner.py +++ b/monai/apps/auto3dseg/auto_runner.py @@ -572,7 +572,7 @@ def set_device_info( cmd_prefix: command line prefix for subprocess running in BundleAlgo and EnsembleRunner. Default using env "CMD_PREFIX" or None, examples are: - - single GPU/CPU or multinode bcprun: "python " or "/opt/conda/bin/python3.10", + - single GPU/CPU or multinode bcprun: "python " or "/opt/conda/bin/python3.11", - single node multi-GPU running "torchrun --nnodes=1 --nproc_per_node=2 " If user define this prefix, please make sure --nproc_per_node matches cuda_visible_device or diff --git a/monai/auto3dseg/utils.py b/monai/auto3dseg/utils.py index 9084396fc14..ad23017da86 100644 --- a/monai/auto3dseg/utils.py +++ b/monai/auto3dseg/utils.py @@ -602,7 +602,7 @@ def _prepare_cmd_default(cmd: str, cmd_prefix: str | None = None, **kwargs: Any) Args: cmd: the command or script to run in the distributed job. cmd_prefix: the command prefix to run the script, - e.g., "python", "python -m", "python3", "/opt/conda/bin/python3.10". + e.g., "python", "python -m", "python3", "/opt/conda/bin/python3.11". kwargs: the keyword arguments to be passed to the script. Returns: diff --git a/pyproject.toml b/pyproject.toml index aa434b364fa..b645247cb0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ "more-itertools>=8.0", "ninja", "packaging", - "torch>=2.8.0", + "torch>=2.21.1", "numpy>=1.24,<3.0", "backports.tarfile" # see https://github.com/Project-MONAI/MONAI/issues/8791 ] @@ -17,7 +17,7 @@ build-backend = "setuptools.build_meta" name = "monai" description = "AI Toolkit for Healthcare Imaging" readme = { file = "README.md", content-type = "text/markdown" } -requires-python = ">=3.10" +requires-python = ">=3.11" license = { text = "Apache License 2.0" } authors = [{ name = "MONAI Consortium", email = "monai.contact@gmail.com" }] classifiers = [ @@ -27,10 +27,11 @@ classifiers = [ "Intended Audience :: Healthcare Industry", "Programming Language :: C++", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Medical Science Apps.", @@ -40,7 +41,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "torch>=2.8.0", + "torch>=2.12.1", "numpy>=1.24,<3.0" ] dynamic = ["version"] @@ -78,7 +79,6 @@ all = [ "nvidia-ml-py", "onnx_graphsurgeon", "onnx>=1.13.0", - "onnxruntime; python_version <= '3.10'", "onnxscript", "openslide-bin", "openslide-python", @@ -141,7 +141,7 @@ nvimgcodec = [ "cupy-cuda13x[ctk]!=14.1.0; platform_system == 'Linux'", "nvidia-nvimgcodec-cu13[all]>=0.8.0; platform_system == 'Linux'" ] -onnx = ["onnx>=1.13.0", "onnxruntime; python_version <= '3.10'", "onnx_graphsurgeon", "onnxscript"] +onnx = ["onnx>=1.13.0", "onnx_graphsurgeon", "onnxscript"] openslide = ["openslide-python", "openslide-bin"] optuna = ["optuna"] pandas = ["pandas"] @@ -395,7 +395,7 @@ project-excludes = [ ] # Match CI environment -python-version = "3.10" +python-version = "3.11" python-platform = "linux" # "legacy" preset provides a smooth migration from previous type checkers From 7ea874e46d2f3aa3cbf81693c0d85e7751d70033 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sun, 25 Oct 2026 11:51:21 +0000 Subject: [PATCH 3/4] Version fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b645247cb0d..affd47df095 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ "more-itertools>=8.0", "ninja", "packaging", - "torch>=2.21.1", + "torch>=2.12.1", "numpy>=1.24,<3.0", "backports.tarfile" # see https://github.com/Project-MONAI/MONAI/issues/8791 ] From f1e3a02eb94737bfe36021a86dd723010f79db50 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 10 Nov 2026 11:06:39 +0000 Subject: [PATCH 4/4] Apply batched suggestions from code review Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/ci_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 9bbbf1ae7c4..3b010a0b9e7 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -151,7 +151,7 @@ jobs: # Test PyTorch versions under Ubuntu with lowest Python version supported - os: ubuntu-latest python-version: '3.11' - pytorch-version: '2.13.1' + pytorch-version: '2.13.0' - os: ubuntu-latest python-version: '3.11' pytorch-version: '2.14.0' @@ -322,7 +322,7 @@ jobs: python -m pip install --upgrade pip wheel tomli pytest # need a specific version of torch for nvsubquadratic python monai/config/print_dependencies.py build-system | \ - xargs -d '\n' pip install --no-build-isolation torch==2.10.0 torchvision==0.25.0 + xargs -d '\n' pip install --no-build-isolation # # nvsubquadratic runtime imports need only torch + einops + omegaconf; install # # the package itself without its core dependency tree (see job comment above). python -m pip install --no-build-isolation omegaconf