Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelCheckpoint must be defined in the config dict, not during the parsing. #454

Merged
merged 6 commits into from
Mar 7, 2025

Conversation

Joao-L-S-Almeida
Copy link
Member

@Joao-L-S-Almeida Joao-L-S-Almeida commented Feb 24, 2025

It should avoid the issue:

    raise MisconfigurationException(
lightning.fabric.utilities.exceptions.MisconfigurationException: Trainer was configured with `enable_checkpointing=False` but found `ModelCheckpoint` in callbacks list.

@Joao-L-S-Almeida Joao-L-S-Almeida self-assigned this Feb 24, 2025
@Joao-L-S-Almeida Joao-L-S-Almeida linked an issue Feb 24, 2025 that may be closed by this pull request
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@Joao-L-S-Almeida Joao-L-S-Almeida added bug Something isn't working 0.99.9 labels Feb 24, 2025
@romeokienzler
Copy link
Collaborator

@Joao-L-S-Almeida given @blumenstiel 's feedback, do you want to close this PR or merge it as an interim fix (which we can do, if we create an issue for the proper refactoring which we can push to v1.1 for example)

@blumenstiel
Copy link
Collaborator

@romeokienzler @Joao-L-S-Almeida With this fix, the user cannot overwirte the default settings. So I don't think you should merge it with the current code. At least, check if the user defines a checkpoint and only add if it is missing.
Also you need to test if the code is working if ModelCheckpoint is provided in the config, I would assume that is mailing because the argument is missing.

@Joao-L-S-Almeida
Copy link
Member Author

Right. We can do it.

Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@Joao-L-S-Almeida
Copy link
Member Author

Joao-L-S-Almeida commented Feb 25, 2025

@blumenstiel @romeokienzler I added it as part of the callbacks defined in the yaml file. When no callback is provided, but enable_checkpointing=True, the default config is used.

@Joao-L-S-Almeida
Copy link
Member Author

The file tests/resources/configs/manufactured-finetune_prithvi_eo_v2_300.yaml was used for testing.

Signed-off-by: Joao Lucas de Sousa Almeida <[email protected]>
@blumenstiel
Copy link
Collaborator

Thanks @Joao-L-S-Almeida, looks good. @romeokienzler Can you have another look and test it?

Copy link
Collaborator

@romeokienzler romeokienzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@romeokienzler romeokienzler self-requested a review March 6, 2025 16:42
@romeokienzler
Copy link
Collaborator

@blumenstiel seems your approval is needed as well

Copy link
Collaborator

@romeokienzler romeokienzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@romeokienzler romeokienzler dismissed blumenstiel’s stale review March 7, 2025 08:09

Benedikt indicated in the comments that he is fine with the changes

@romeokienzler romeokienzler merged commit b860382 into main Mar 7, 2025
7 checks passed
@romeokienzler romeokienzler deleted the checkpoint/false branch March 7, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.99.9 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable_checkpointing=False not possible Remove duplicate addition of callbacks/make optional
3 participants