Skip to content

Replace deprecated on_init_end callback in PL App Template #14872

@awaelchli

Description

@awaelchli

Proposed refactor

Replace the deprecated usage with an alternative to collect init args.

Motivation

The PL App Template is using deprecated API that will be removed in 1.8 (#14867) and the new version of Trainer will not be compatible with the template. To be compatible with the newest version of Trainer, the code needs to be updated.

https://github.com/Lightning-AI/lightning/blob/047d7088f4366e68516d017f6e2b81f61bdef13a/src/lightning_app/cli/pl-app-template/core/callbacks.py#L251-L259

Pitch

Options

A) Inject a function through the Tracer to inspect the args
B) Patch the Trainer init with a wrapper

In both approaches we would insert the existing logic for collecting the local argument values.

Additional context

Raised in #14867


If you enjoy Lightning, check out our other projects! ⚡

  • Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

  • Lite: enables pure PyTorch users to scale their existing code on any kind of device while retaining full control over their own loops and optimization logic.

  • Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, fine-tuning, and solving problems with deep learning.

  • Bolts: Pretrained SOTA Deep Learning models, callbacks, and more for research and production with PyTorch Lightning and PyTorch.

  • Lightning Transformers: Flexible interface for high-performance research using SOTA Transformers leveraging PyTorch Lightning, Transformers, and Hydra.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions