Introducing LightningCLI V2

The Lightning 1.5 release introduces CLI V2 with support for subcommands; shorthand notation; and registries for callbacks, optimizers, learning rate schedulers, LightningModules, and LightningDataModules.

LightningCLI, No Boilerplate For Reproducible AI

Running non-trivial experiments often requires configuring many different trainer and model arguments such as learning rates, batch sizes, number of epochs, data paths, data splits, number of GPUs, etc., that need to be exposed in a training script as most experiments are launched from command-line.

Support for Fit, Validate, Test, Predict, and Tune

Before 1.5, the LightningCLI only supported fitting, but we’ve added support for all other Trainer entry points! You can choose which one to run by specifying it as a subcommand:

Optimizer and Learning Rate Schedulers Swapping

Optimizers and learning rate schedulers are also configurable. The most common case is a model with a single optimizer and optionally a single learning rate scheduler.

You will not have to write this boilerplate ever again after adopting the LightningCLI

Instantiation-Only Mode

Perhaps you are interested in the parsing functionality of the LightningCLI but want to manage the Trainer calls yourself.

Registries

Lightning exposes several registries for you to store your Lightning components via a decorator mechanism. Here is how you could register your own components:

Next Steps

The Lightning Team is more than ever committed to providing the best experience possible to anyone doing optimization with PyTorch and the PyTorch Lightning API being already stable, breaking changes will be minimal.

https://cdn-images-1.medium.com/max/2400/0*BSvoUp30zZ8dkwpv.png

--

--

We are the core contributors team developing PyTorch Lightning — the deep learning research framework to run complex models without the boilerplate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
PyTorch Lightning team

We are the core contributors team developing PyTorch Lightning — the deep learning research framework to run complex models without the boilerplate