Skip to content

Use the Callback state_key to disambiguate callbacks provided to trainer and from LightningModule #11138

@ananthsub

Description

@ananthsub

We still use the types of the callbacks here: https://github.com/PyTorchLightning/pytorch-lightning/blob/92d9fc2280091c300fe8848284b9f6dfcbd209eb/pytorch_lightning/trainer/connectors/callback_connector.py#L272-L283

This can lead to collisions, when perhaps we have multiple callback instances of the same type with different settings that we want to use together.

For checkpointing callback states, we have shifted to using the newly introduced callback state key here: https://github.com/PyTorchLightning/pytorch-lightning/blob/92d9fc2280091c300fe8848284b9f6dfcbd209eb/pytorch_lightning/trainer/callback_hook.py#L58

We can do the same thing in this callback connector

Originally posted by @ananthsub in #11060 (comment)

cc @justusschock @awaelchli @akihironitta @rohitgr7 @ananthsub @daniellepintz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions