Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for multiple learning rate schedulers in the
OptimizerLightningModuleandOptimizerConfigclasses, allowing users to configure and combine different learning rate schedules (e.g., step-wise warmup and epoch-wise plateau) in PyTorch Lightning workflows. The update adds a newLRSchedulerConfigclass, deprecates the old single-scheduler interface, and updates documentation and examples to reflect these changes.Core API Enhancements:
LRSchedulerConfigdataclass to encapsulate configuration for individual learning rate schedulers, including generator, interval, monitor, frequency, and other options. (aiaccel/torch/lightning/opt_lightning_module.py)OptimizerConfigto accept a list ofLRSchedulerConfiginstances via the newschedulersargument, supporting multiple schedulers per optimizer. The oldscheduler_generator/scheduler_interval/scheduler_monitorfields are now deprecated in favor of this new approach, and validation ensures only one method is used. (aiaccel/torch/lightning/opt_lightning_module.py) [1] [2]OptimizerLightningModule.configure_optimizers()to return optimizer and scheduler(s) in the format expected by Lightning, supporting multiple schedulers if provided. (aiaccel/torch/lightning/opt_lightning_module.py)__init__.pyexports to includeLRSchedulerConfigin the public API. (aiaccel/torch/lightning/__init__.py)Documentation and Example Updates:
docs/source/user_guide/torch.rst,docs/source/api_reference/torch.rst) [1] [2]schedulersfield with two schedulers:LinearLR(step) andCosineAnnealingLR(epoch). (examples/torch/image_classification/recipes/resnet50.cifar10/config.yaml)