Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ jobs:
steps:
- if: github.event_name == 'push'
uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: "3.11"
activate-environment: true
enable-cache: true
cache-dependency-glob: |
**/requirements-dev.txt
**/pyproject.toml
- run: |
pip install -r requirements-dev.txt
pre-commit run -a
Expand Down
73 changes: 51 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,28 @@ jobs:
permissions:
contents: write
if: (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release'
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 10
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.10"
version: "latest"
python-version: "${{ matrix.python-version }}"
activate-environment: true
enable-cache: true
cache-suffix: "${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}"
cache-dependency-glob: |
**/docs/requirements.txt
**/requirements-dev.txt
**/pyproject.toml

- run: sudo npm install katex -g
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}

- name: Install docs deps
run: bash .github/workflows/install_docs_deps.sh
Expand All @@ -47,18 +57,27 @@ jobs:

linkcheck:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
max-parallel: 10
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- uses: actions/cache@v4
- uses: astral-sh/setup-uv@v6
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}
version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: true
cache-suffix: "${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}"
cache-dependency-glob: |
**/docs/requirements.txt
**/requirements-dev.txt
**/pyproject.toml

- name: Install docs deps
run: bash .github/workflows/install_docs_deps.sh
Expand All @@ -69,18 +88,28 @@ jobs:

doctest:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 10
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.10"
version: "latest"
python-version: "${{ matrix.python-version }}"
activate-environment: true
enable-cache: true
cache-suffix: "${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}"
cache-dependency-glob: |
**/docs/requirements.txt
**/requirements-dev.txt
**/pyproject.toml

- run: sudo npm install katex -g
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}

- name: Install docs deps
run: bash .github/workflows/install_docs_deps.sh
Expand Down
33 changes: 14 additions & 19 deletions .github/workflows/hvd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,24 @@ jobs:
run: echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT
shell: bash -l {0}

- name: Get pip cache dir
id: pip-cache
run: |
python3 -m pip install -U pip
echo "pip_cache=$(python3 -m pip cache dir)" >> $GITHUB_OUTPUT
shell: bash -l {0}

- uses: actions/cache@v4
with:
path: |
~/conda_pkgs_dir
${{ steps.pip-cache.outputs.pip_cache }}
key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }}

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: true
cache-suffix: "${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}"
cache-dependency-glob: |
**/requirements-dev.txt
**/pyproject.toml

- name: Install dependencies
shell: bash -l {0}
run: |

#install other dependencies
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-dev.txt
# Install other dependencies
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install -r requirements-dev.txt

# 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
Expand All @@ -78,7 +71,9 @@ jobs:
python -c "import horovod.torch as hvd; hvd.mpi_ops.Sum"

# Install ignite
pip install .
uv pip install .

uv pip list

# Download MNIST: https://github.com/pytorch/ignite/issues/1737
# to "/tmp" for cpu tests
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/install_docs_deps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# remove pkg-resources as it causes failure when installing https://github.com/pytorch-ignite/sphinxcontrib-versioning
pip uninstall -y pkg-resources setuptools && pip install --upgrade setuptools pip wheel
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
pip install -r requirements-dev.txt
pip install -r docs/requirements.txt
pip install git+https://github.com/pytorch-ignite/sphinxcontrib-versioning.git
uv pip uninstall pkg-resources setuptools
uv pip install setuptools pip wheel
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install -r requirements-dev.txt
uv pip install -r docs/requirements.txt
uv pip install git+https://github.com/pytorch-ignite/sphinxcontrib-versioning.git
20 changes: 15 additions & 5 deletions .github/workflows/mps-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,43 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
shell: bash -l {0}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
pip install uv

- name: Install PyTorch
if: ${{ matrix.pytorch-channel == 'pytorch' }}
shell: bash -l {0}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
pip install -U torch torchvision
uv pip install torch torchvision

- name: Install PyTorch (nightly)
if: ${{ matrix.pytorch-channel == 'pytorch-nightly' }}
shell: bash -l {0}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
pip install --pre -U torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu

- name: Install dependencies
shell: bash -l {0}
working-directory: ${{ github.repository }}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
# TODO: We add set -xe to explicitly fail the CI if one of the commands is failing.
# Somehow the step is passing even if a subcommand failed
set -xe
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
echo "1 returned code: $?"
pip install -e .
uv pip install .
echo "2 returned code: $?"
pip list
uv pip list
echo "3 returned code: $?"

# Download MNIST: https://github.com/pytorch/ignite/issues/1737
Expand All @@ -115,6 +123,7 @@ jobs:
shell: bash -l {0}
working-directory: ${{ github.repository }}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh

Expand All @@ -129,5 +138,6 @@ jobs:
shell: bash -l {0}
working-directory: ${{ github.repository }}
run: |
conda shell.bash hook
conda activate $CONDA_ENV
python examples/mnist/mnist.py --epochs=1
39 changes: 17 additions & 22 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,44 +59,39 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Get year & week number
id: get-date
run: |
echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT

- name: Get pip cache dir
id: pip-cache
run: |
pip install -U pip || python -m pip install -U pip
echo "pip_cache=$(pip cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
- uses: astral-sh/setup-uv@v6
with:
path: |
${{ steps.pip-cache.outputs.pip_cache }}
key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-
version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: true
cache-suffix: "${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}"
cache-dependency-glob: |
**/requirements-dev.txt
**/pyproject.toml

- run: pip install pip wheel setuptools -Uqq
- name: Install dev tools
run: uv pip install wheel setuptools -Uqq

- name: Install PyTorch
if: ${{ matrix.pytorch-channel == 'pytorch' }}
run: pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
run: uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu

- name: Install PyTorch (nightly)
if: ${{ matrix.pytorch-channel == 'pytorch-nightly' }}
run: pip install torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu --pre
run: uv pip install torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu --pre

- name: Install dependencies
run: |
pip install -r requirements-dev.txt
pip install .
pip list
uv pip install -r requirements-dev.txt
uv pip install .
uv pip list

- name: Check code formatting
run: |
Expand Down Expand Up @@ -155,7 +150,7 @@ jobs:
# 3.1) mnist_with_tensorboard.py with tbX
python examples/mnist/mnist_with_tensorboard.py --epochs=1
# 3.2) mnist_with_tensorboard.py with native torch tb
pip uninstall -y tensorboardX
uv pip uninstall tensorboardX
python examples/mnist/mnist_with_tensorboard.py --epochs=1

- name: Run MNIST Example With Crash
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx<6
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
sphinxcontrib-katex
sphinx-copybutton==0.4.0
docutils<0.18
Expand Down
Loading