Skip to content

Commit

Permalink
Drop python 3.8 in the CI (#3288)
Browse files Browse the repository at this point in the history
* Drop python 3.8 in the CI

* Try horovod CPU CI on python 3.10

* Fix 3.10 -> "3.10"

* Update hvd-tests.yml

* Build horovod from source

* debug with tmate

* debug 2

* Fixed horovod build

* Fix mypy on neptune import in neptune logger
  • Loading branch information
vfdev-5 authored Oct 2, 2024
1 parent 8e53b76 commit 6a1ef07
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- run: |
bash ./tests/run_code_style.sh install
bash ./tests/run_code_style.sh fmt
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/hvd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8]
python-version: ["3.11"]
pytorch-channel: [pytorch]

steps:
Expand Down Expand Up @@ -64,7 +64,20 @@ jobs:
#install other dependencies
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-dev.txt
pip install horovod
# Install Horovod from source and apply a patch to build with recent pytorch
# We can't use pip install <whatever> as build-env can't find pytorch and
# `--no-build-isolation` does not work with horovod setup.py
git clone --recursive https://github.com/horovod/horovod.git /tmp/horovod
cd /tmp/horovod
sed -i "s/CMAKE_CXX_STANDARD 14/CMAKE_CXX_STANDARD 17/g" CMakeLists.txt
sed -i "s/CMAKE_CXX_STANDARD 14/CMAKE_CXX_STANDARD 17/g" horovod/torch/CMakeLists.txt
HOROVOD_WITH_PYTORCH=1 python setup.py install
cd -
# test the installation:
python -c "import horovod.torch as hvd; hvd.mpi_ops.Sum"
# Install ignite
python setup.py install
# Download MNIST: https://github.com/pytorch/ignite/issues/1737
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mps-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
mps-tests:
strategy:
matrix:
python-version: [3.8]
python-version: [3.11]
pytorch-channel: ["pytorch"]
skip-distrib-tests: [1]
fail-fast: false
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pytorch-version-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
max-parallel: 5
fail-fast: false
matrix:
# Here we keep python 3.8 tests until the end of the 2024 and
# will drop python version and related pytorch versions
python-version: [3.8, 3.9, "3.10"]
pytorch-version:
[2.3.1, 2.2.2, 2.1.2, 2.0.1, 1.13.1, 1.12.1, 1.10.0, 1.8.1, 1.5.1]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
pytorch-channel: [pytorch, pytorch-nightly]
include:
# includes a single build on windows
- os: windows-latest
pytorch-channel: pytorch
python-version: 3.9
python-version: 3.11
skip-distrib-tests: 1
# includes a single build on macosx
- os: macos-latest
pytorch-channel: pytorch
python-version: 3.9
python-version: 3.11
skip-distrib-tests: 1

steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ into the following categories:
- Create an isolated conda environment for pytorch-ignite:

```bash
conda create -n pytorch-ignite-dev python=3.8
conda create -n pytorch-ignite-dev python=3.11
```

- Activate the newly created environment:
Expand Down
10 changes: 1 addition & 9 deletions ignite/handlers/neptune_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,7 @@ def __setitem__(self, key: str, val: Any) -> Any:

def __init__(self, api_token: Optional[str] = None, project: Optional[str] = None, **kwargs: Any) -> None:
try:
try:
# neptune-client<1.0.0 package structure
with warnings.catch_warnings():
# ignore the deprecation warnings
warnings.simplefilter("ignore")
import neptune.new as neptune
except ImportError:
# neptune>=1.0.0 package structure
import neptune
import neptune
except ImportError:
raise ModuleNotFoundError(
"This contrib module requires the Neptune client library to be installed. "
Expand Down

0 comments on commit 6a1ef07

Please sign in to comment.