Deep Learning components for extending PyTorch Lightning
Installation • Latest Docs • Stable Docs • About • Community • Website • License
Getting Started
Pip / Conda
pip install lightning-bolts
Other installations
Install bleeding-edge (no guarantees)
pip install https://github.com/Lightning-Universe/lightning-bolts/archive/refs/heads/master.zip
To install all optional dependencies
pip install lightning-bolts["extra"]
What is Bolts?
Bolts package provides a variety of components to extend PyTorch Lightning, such as callbacks & datasets, for applied research and production.
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 specific 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.
Metadata
Release files for lightning-bolts 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lightning-bolts-0.7.0.tar.gz | 210.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lightning_bolts-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 511.4 kB
Release files / lightning-bolts-0.7.0.tar.gz
| Download URL | lightning-bolts-0.7.0.tar.gz |
|---|---|
| Size | 210.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6071cda7721087890ba01523d6580fe72b03b842766fd5018a8eb9caa99fe75c
|
|
BLAKE2b-256 checksum How to use checksums |
ca2cf8d083ff1b3f0aeb8abec43524496b32328fb339d21e0320d7f9d544b41e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / lightning_bolts-0.7.0-py3-none-any.whl
| Download URL | lightning_bolts-0.7.0-py3-none-any.whl |
|---|---|
| Size | 300.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
231c91584ffd610499fb5be80b9f5a22cfa42c3377d16223a37984e59d0118bd
|
|
BLAKE2b-256 checksum How to use checksums |
b161ce12f8b50807a5d2e20c8e6d281434595a3d525992dbd53face6a404a302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for lightning-bolts 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.