Skip to content

Commit

Permalink
Merge branch 'master' into update-pth-version
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 authored Mar 24, 2024
2 parents cf26025 + df819ca commit f0aef7f
Show file tree
Hide file tree
Showing 105 changed files with 6,041 additions and 5,135 deletions.
34 changes: 23 additions & 11 deletions .github/pr-labeler-config.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@
# Add 'docker' to any changes within 'docker' folder or any subfolders
docker:
- docker/**/*
- changed-files:
- any-glob-to-any-file: docker/**

# Add 'docs' to any changes within 'docs' folder
docs:
- docs/**/*
- changed-files:
- any-glob-to-any-file: docs/**

# Add 'ci' to any changes in '.github' folder
ci:
- .github/**/*
- changed-files:
- any-glob-to-any-file: .github/**

# Add 'examples' to any changes within 'examples' folder
examples:
- examples/**/*
- changed-files:
- any-glob-to-any-file: examples/**

# Add 'base' to any changes within 'base' folder
"module: base":
- ignite/base/**/*
- changed-files:
- any-glob-to-any-file: ignite/base/**/*

# Add 'contrib' to any changes within 'contrib' folder
"module: contrib":
- ignite/contrib/**/*
- changed-files:
- any-glob-to-any-file: ignite/contrib/**/*

# Add 'distributed' to any changes within 'distributed' folder
"module: distributed":
- ignite/distributed/**/*
- changed-files:
- any-glob-to-any-file: ignite/distributed/**/*

# Add 'engine' to any changes within 'engine' folder
"module: engine":
- ignite/engine/**/*
- changed-files:
- any-glob-to-any-file: ignite/engine/**/*

# Add 'handlers' to any changes within 'handlers' folder
"module: handlers":
- ignite/handlers/**/*
- changed-files:
- any-glob-to-any-file: ignite/handlers/**/*

# Add 'metrics' to any changes within 'metrics' folder
"module: metrics":
- ignite/metrics/**/*
- changed-files:
- any-glob-to-any-file: ignite/metrics/**/*

-
# Add 'utils' to any changes within 'utils' module
"module: utils":
- ignite/utils.py
- changed-files:
- any-glob-to-any-file: ignite/utils.py
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:

jobs:
build-deploy:
permissions:
contents: write
if: (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ name: Triage

on:
pull_request_target:
types: [opened]
# types: [opened]
# issues:
# types: [opened]

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pull Request Labeler
# if: github.event_name == 'pull_request_target'
uses: actions/labeler@v5
with:
configuration-path: .github/pr-labeler-config.yml
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ repos:
exclude_types: ["python", "jupyter", "shell", "gitignore"]

- repo: https://github.com/omnilib/ufmt
rev: v2.2.0
rev: v2.5.1
hooks:
- id: ufmt
additional_dependencies:
- black == 23.9.1
- usort == 1.0.7
- black == 24.3.0
- usort == 1.0.8.post1

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
args: ["--config", "setup.cfg"]
2 changes: 1 addition & 1 deletion assets/tldr/teaser.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"\n",
"import ignite.distributed as idist\n",
"from ignite.contrib.engines import common\n",
"from ignite.contrib.handlers import ProgressBar\n",
"from ignite.handlers import ProgressBar\n",
"from ignite.engine import Engine, Events, create_supervised_evaluator\n",
"from ignite.metrics import Accuracy\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion assets/tldr/teaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import ignite.distributed as idist
from ignite.contrib.engines import common
from ignite.contrib.handlers import ProgressBar
from ignite.handlers import ProgressBar
from ignite.engine import Engine, Events, create_supervised_evaluator
from ignite.metrics import Accuracy

Expand Down
40 changes: 4 additions & 36 deletions docs/source/contrib/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,8 @@ Time profilers [deprecated]
Use :class:`~ignite.handlers.time_profilers.BasicTimeProfiler` instead, will be removed in version 0.6.0.
Use :class:`~ignite.handlers.time_profilers.HandlersTimeProfiler` instead, will be removed in version 0.6.0.

Loggers
-------
Loggers [deprecated]
--------------------

.. currentmodule:: ignite.contrib.handlers

.. autosummary::
:nosignatures:
:toctree: ../generated
:recursive:

base_logger
clearml_logger
mlflow_logger
neptune_logger
polyaxon_logger
tensorboard_logger
tqdm_logger

visdom_logger
wandb_logger

.. seealso::

Below are a comprehensive list of examples of various loggers.

* See `tensorboardX mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tensorboard_logger.py>`_
and `CycleGAN and EfficientNet notebooks <https://github.com/pytorch/ignite/tree/master/examples/notebooks>`_ for detailed usage.

* See `visdom mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_visdom_logger.py>`_ for detailed usage.

* See `neptune mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_neptune_logger.py>`_ for detailed usage.

* See `tqdm mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tqdm_logger.py>`_ for detailed usage.

* See `wandb mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_wandb_logger.py>`_ for detailed usage.

* See `clearml mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_clearml_logger.py>`_ for detailed usage.
.. deprecated:: 0.4.14
Loggers moved to :ref:`Loggers`.
46 changes: 43 additions & 3 deletions docs/source/handlers.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ignite.handlers
===============

Complete list of handlers
-------------------------
Complete list of generic handlers
----------------------------------

.. currentmodule:: ignite.handlers

Expand Down Expand Up @@ -33,6 +33,46 @@ Complete list of handlers
param_scheduler.ParamScheduler
state_param_scheduler.StateParamScheduler


Loggers
--------

.. currentmodule:: ignite.handlers

.. autosummary::
:nosignatures:
:toctree: generated
:recursive:

base_logger
clearml_logger
mlflow_logger
neptune_logger
polyaxon_logger
tensorboard_logger
tqdm_logger

visdom_logger
wandb_logger

.. seealso::

Below are a comprehensive list of examples of various loggers.

* See `tensorboardX mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tensorboard_logger.py>`_
and `CycleGAN and EfficientNet notebooks <https://github.com/pytorch/ignite/tree/master/examples/notebooks>`_ for detailed usage.

* See `visdom mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_visdom_logger.py>`_ for detailed usage.

* See `neptune mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_neptune_logger.py>`_ for detailed usage.

* See `tqdm mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tqdm_logger.py>`_ for detailed usage.

* See `wandb mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_wandb_logger.py>`_ for detailed usage.

* See `clearml mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_clearml_logger.py>`_ for detailed usage.


.. _param-scheduler-label:

Parameter scheduler
Expand Down Expand Up @@ -396,7 +436,7 @@ Example with :class:`ignite.handlers.param_scheduler.ReduceLROnPlateauScheduler`
init_lr = 0.1
lr_values = np.array(ReduceLROnPlateauScheduler.simulate_values(
num_events, metric_values, init_lr,
num_events, metric_values, init_lr,
factor=0.5, patience=1, mode='max', threshold=0.01, threshold_mode='abs'
)
)
Expand Down
2 changes: 2 additions & 0 deletions docs/source/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ Complete list of metrics
RougeN
InceptionScore
FID
CosineSimilarity
Entropy

Helpers for customizing metrics
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/cifar10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Run the example on a single GPU:
python main.py run
```

For details on accepted arguments:
For more details on accepted arguments:

```bash
python main.py run -- --help
Expand Down
5 changes: 2 additions & 3 deletions examples/cifar10/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
import ignite
import ignite.distributed as idist
from ignite.contrib.engines import common
from ignite.contrib.handlers import PiecewiseLinear
from ignite.engine import Engine, Events
from ignite.handlers import Checkpoint, DiskSaver, global_step_from_engine
from ignite.handlers import Checkpoint, DiskSaver, global_step_from_engine, PiecewiseLinear
from ignite.metrics import Accuracy, Loss
from ignite.utils import manual_seed, setup_logger

Expand Down Expand Up @@ -370,7 +369,7 @@ def evaluate_step(engine: Engine, batch):

def get_save_handler(config):
if config["with_clearml"]:
from ignite.contrib.handlers.clearml_logger import ClearMLSaver
from ignite.handlers.clearml_logger import ClearMLSaver

return ClearMLSaver(dirname=config["output_path"])

Expand Down
4 changes: 2 additions & 2 deletions examples/cifar100_amp_benchmark/benchmark_fp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from torchvision.models import wide_resnet50_2
from utils import get_train_eval_loaders

from ignite.contrib.handlers import ProgressBar
from ignite.engine import convert_tensor, create_supervised_evaluator, Engine, Events
from ignite.handlers import Timer

from ignite.handlers import ProgressBar, Timer
from ignite.metrics import Accuracy, Loss


Expand Down
4 changes: 2 additions & 2 deletions examples/cifar100_amp_benchmark/benchmark_nvidia_apex.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from torchvision.models import wide_resnet50_2
from utils import get_train_eval_loaders

from ignite.contrib.handlers import ProgressBar
from ignite.engine import convert_tensor, create_supervised_evaluator, Engine, Events
from ignite.handlers import Timer

from ignite.handlers import ProgressBar, Timer
from ignite.metrics import Accuracy, Loss


Expand Down
4 changes: 2 additions & 2 deletions examples/cifar100_amp_benchmark/benchmark_torch_cuda_amp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from torchvision.models import wide_resnet50_2
from utils import get_train_eval_loaders

from ignite.contrib.handlers import ProgressBar
from ignite.engine import convert_tensor, create_supervised_evaluator, Engine, Events
from ignite.handlers import Timer

from ignite.handlers import ProgressBar, Timer
from ignite.metrics import Accuracy, Loss


Expand Down
5 changes: 2 additions & 3 deletions examples/cifar10_qat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
import ignite
import ignite.distributed as idist
from ignite.contrib.engines import common
from ignite.contrib.handlers import PiecewiseLinear
from ignite.engine import create_supervised_evaluator, Engine, Events
from ignite.handlers import Checkpoint, DiskSaver, global_step_from_engine
from ignite.handlers import Checkpoint, DiskSaver, global_step_from_engine, PiecewiseLinear
from ignite.metrics import Accuracy, Loss
from ignite.utils import manual_seed, setup_logger

Expand Down Expand Up @@ -330,7 +329,7 @@ def train_step(engine, batch):

def get_save_handler(config):
if config["with_clearml"]:
from ignite.contrib.handlers.clearml_logger import ClearMLSaver
from ignite.handlers.clearml_logger import ClearMLSaver

return ClearMLSaver(dirname=config["output_path"])

Expand Down
6 changes: 3 additions & 3 deletions examples/gan/dcgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import torch.optim as optim
import torch.utils.data as data

from ignite.contrib.handlers import ProgressBar
from ignite.engine import Engine, Events
from ignite.handlers import ModelCheckpoint, Timer

from ignite.handlers import ModelCheckpoint, ProgressBar, Timer
from ignite.metrics import RunningAverage

try:
Expand Down Expand Up @@ -85,7 +85,7 @@ def __init__(self, z_dim, nf, nc):
nn.ReLU(inplace=True),
# state size. (nf) x 32 x 32
nn.ConvTranspose2d(in_channels=nf, out_channels=nc, kernel_size=4, stride=2, padding=1, bias=False),
nn.Tanh()
nn.Tanh(),
# state size. (nc) x 64 x 64
)

Expand Down
8 changes: 5 additions & 3 deletions examples/mnist/mnist_with_clearml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
python mnist_with_clearml_logger.py
```
"""

from argparse import ArgumentParser

import torch
Expand All @@ -21,7 +22,10 @@
from torchvision.datasets import MNIST
from torchvision.transforms import Compose, Normalize, ToTensor

from ignite.contrib.handlers.clearml_logger import (
from ignite.engine import create_supervised_evaluator, create_supervised_trainer, Events
from ignite.handlers import Checkpoint

from ignite.handlers.clearml_logger import (
ClearMLLogger,
ClearMLSaver,
global_step_from_engine,
Expand All @@ -30,8 +34,6 @@
WeightsHistHandler,
WeightsScalarHandler,
)
from ignite.engine import create_supervised_evaluator, create_supervised_trainer, Events
from ignite.handlers import Checkpoint
from ignite.metrics import Accuracy, Loss
from ignite.utils import setup_logger

Expand Down
Loading

0 comments on commit f0aef7f

Please sign in to comment.