Skip to main content

Lightning Bolts is a community contribution for ML researchers.

Project description

Deep Learning components for extending PyTorch Lightning


InstallationLatest DocsStable DocsAboutCommunityWebsiteLicense

PyPI Status PyPI Status Build Status codecov

Documentation Status Slack license DOI


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightning-bolts-0.7.0rc0.tar.gz (210.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightning_bolts-0.7.0rc0-py3-none-any.whl (300.8 kB view details)

Uploaded Python 3

File details

Details for the file lightning-bolts-0.7.0rc0.tar.gz.

File metadata

  • Download URL: lightning-bolts-0.7.0rc0.tar.gz
  • Upload date:
  • Size: 210.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for lightning-bolts-0.7.0rc0.tar.gz
Algorithm Hash digest
SHA256 01eb7056b676ffdee0306c48e7fabda719dcf9d15135d3661cc4f56c9c25de2a
MD5 e3eaaa36eb4b66aa775815f022817461
BLAKE2b-256 b6db43eb16fd0ea5227e9169630bfb089dfb84b17f4f19bbd2776512cd353c64

See more details on using hashes here.

File details

Details for the file lightning_bolts-0.7.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_bolts-0.7.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 6478f03b449cc520e21ccd42af06acf72455308c776484e4cc88f7d3456aae38
MD5 393642d1a1671348827a00120ec5090c
BLAKE2b-256 6d319947290edbf244424b8a15f215ae89bc02115fe1401b761faa6bd6030790

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page