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

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.19.11.54.tar.gz (8.5 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.19.11.54.tar.gz.

File metadata

File hashes

Hashes for lightning_trainer_utils-2025.5.19.11.54.tar.gz
Algorithm Hash digest
SHA256 f7169f85c18bcd7be79b9d05ff7f4dd771257150367f0b0330fe4765bc20eb52
MD5 730145f559ff64fba4a55eb757ba08dd
BLAKE2b-256 3e16f08e514165954bf07cf4054b410217443c89bfc3f236e630a9d419cf7b75

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_trainer_utils-2025.5.19.11.54.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.19.11.54-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_trainer_utils-2025.5.19.11.54-py3-none-any.whl
Algorithm Hash digest
SHA256 74197a999712b9d6df65bb28ab0f40db8c7aee11da1e109ad5c0d98ab75745ef
MD5 f8924f90541d3ec637d723be8df3803b
BLAKE2b-256 2cc2fc4f208cbf7bd7ccb1d5e7c4b35d8ce3971af497d1d8137be34e407f3331

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_trainer_utils-2025.5.19.11.54-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