Lightning Bolts is a community contribution for ML researchers.
Project description
Deep Learning components for extending PyTorch Lightning
Installation • Latest Docs • Stable Docs • About • Community • Website • Grid AI • License
Getting Started
Pip / Conda
pip install lightning-bolts
Other installations
Install bleeding-edge (no guarantees)
pip install git+https://github.com/PytorchLightning/lightning-bolts.git@master --upgrade
To install all optional dependencies
pip install lightning-bolts["extra"]
What is Bolts
Bolts provides a variety of components to extend PyTorch Lightning such as callbacks & datasets, for applied research and production.
News
- Sept 22: Leverage Sparsity for Faster Inference with Lightning Flash and SparseML
- Aug 26: Fine-tune Transformers Faster with Lightning Flash and Torch ORT
Example 1: Accelerate Lightning Training with the Torch ORT Callback
Torch ORT converts your model into an optimized ONNX graph, speeding up training & inference when using NVIDIA or AMD GPUs. See the documentation for more details.
from pytorch_lightning import LightningModule, Trainer
import torchvision.models as models
from pl_bolts.callbacks import ORTCallback
class VisionModel(LightningModule):
def __init__(self):
super().__init__()
self.model = models.vgg19_bn(pretrained=True)
...
model = VisionModel()
trainer = Trainer(gpus=1, callbacks=ORTCallback())
trainer.fit(model)
Example 2: Introduce Sparsity with the SparseMLCallback to Accelerate Inference
We can introduce sparsity during fine-tuning with SparseML, which ultimately allows us to leverage the DeepSparse engine to see performance improvements at inference time.
from pytorch_lightning import LightningModule, Trainer
import torchvision.models as models
from pl_bolts.callbacks import SparseMLCallback
class VisionModel(LightningModule):
def __init__(self):
super().__init__()
self.model = models.vgg19_bn(pretrained=True)
...
model = VisionModel()
trainer = Trainer(gpus=1, callbacks=SparseMLCallback(recipe_path="recipe.yaml"))
trainer.fit(model)
Are specific research implementations supported?
We'd like to encourage users to contribute general components that will help a broad range of problems, however components that help specifics domains will also be welcomed!
For example a callback to help train SSL models would be a great contribution, however the next greatest SSL model from your latest paper would be a good contribution to Lightning Flash.
Use Lightning Flash to train, predict and serve state-of-the-art models for applied research. We suggest looking at our VISSL Flash integration for SSL based tasks.
Contribute!
Bolts is supported by the PyTorch Lightning team and the PyTorch Lightning community!
Join our Slack and/or read our CONTRIBUTING guidelines to get help becoming a contributor!
License
Please observe the Apache 2.0 license that is listed in this repository. In addition the Lightning framework is Patent Pending.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lightning-bolts-0.6.0.post1.tar.gz
.
File metadata
- Download URL: lightning-bolts-0.6.0.post1.tar.gz
- Upload date:
- Size: 190.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09330e0998c94922b2a1471b9175b2e2a4c2d42e3c4a4de07677369b4d41bc08 |
|
MD5 | b212e718c27c63567f2bb0ee644b5f1d |
|
BLAKE2b-256 | f0230e5e5b5cfc2202f56b48353dc52dc91d3c4b85b09cb6439d996481491d45 |
File details
Details for the file lightning_bolts-0.6.0.post1-py3-none-any.whl
.
File metadata
- Download URL: lightning_bolts-0.6.0.post1-py3-none-any.whl
- Upload date:
- Size: 330.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93496d9cdd57a48dcd2a88fffe71bb7ec1f46a43e1d29d6cd852a29663d8a49 |
|
MD5 | e0da51bfa1cac0d03dec5b322a3a63fd |
|
BLAKE2b-256 | b773b992893803a7d7ec8afe465f98d5b2808de22da11f3770d6094e08393aee |