Skip to main content

A Python package for using PyTorch Lightning with custom callbacks and model wrappers.

Project description

PyPI version

PyTorch Lightning Trainer Utilities

Installation

pip install lightning-trainer-utils

ML Model Assumptions

forward

  • The model wrapper uses the forward function as follows:
    output = self.model(**x, **self.forward_kwargs)
    return ModelOuput(**output)

It expects batch as dict and returns a dict with keys [loss, report, output].

return

  • ML model should return a dict with the following keys:
    • loss
    • report
    • output [optional]

Trainer

Global Step

batch_step = num_samples / (batch_size * num_devices) trainer_global_step = num_samples / (batch_size * num_devices * grad_accumulation) SaveCheckpoint also use trainer_global_step.

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_trainer_utils-2025.5.26.8.34.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file lightning_trainer_utils-2025.5.26.8.34.tar.gz.

File metadata

File hashes

Hashes for lightning_trainer_utils-2025.5.26.8.34.tar.gz
Algorithm Hash digest
SHA256 bab4a39da88bd0c37afeef71a12415fa9cae75f0e20bd96a1d6f545018ff9465
MD5 f381b66a492baf04ff03aeff38864758
BLAKE2b-256 907aa87ed451c6ba499ce1b7a540f51f858b5d90fae959fda2b4456a214be961

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_trainer_utils-2025.5.26.8.34.tar.gz:

Publisher: workflow.yaml on manavmahan/lightning-trainer-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lightning_trainer_utils-2025.5.26.8.34-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_trainer_utils-2025.5.26.8.34-py3-none-any.whl
Algorithm Hash digest
SHA256 fb6120dfda6fa2d6b5821168b08a480f3b88472c96493fdb315c2d5819bb1a22
MD5 99506677bc7b4744040371c6918477d8
BLAKE2b-256 ef689e7e8f74f926f69f7e021fdac88b6aa33f2068bbd8a2d492ef7ed9d91e52

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_trainer_utils-2025.5.26.8.34-py3-none-any.whl:

Publisher: workflow.yaml on manavmahan/lightning-trainer-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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