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

Fix OCPNeb trainer loading #995

Merged
merged 4 commits into from
Feb 7, 2025
Merged

Fix OCPNeb trainer loading #995

merged 4 commits into from
Feb 7, 2025

Conversation

misko
Copy link
Collaborator

@misko misko commented Feb 4, 2025

OCPNeb loading of fine tuned models is broken (#981)

This can be reproduced when training, or finetuning any new model and passing it to OCPNeb. The reason here is that our loader uses the 'trainer' field in config to query the registry.
However we populate the 'trainer' field with the task_name here and here
To fix this we normally load models using OCPCalculator and pass the explicit trainer name in as an argument overriding the one present in the checkpoint.
However OCPNeb does not have this option to pass in trainer specifically, and only uses the one present in the checkpoint, which has trainer='s2ef', however 's2ef' is not a valid trainer so this fails.

Additionally when OCPNeb calls the trainer initialization it does not pass through loss_functions, but loss_functions is used as a early return condition in update_config, which if not present will fail on updated configs as they try to get converted but cant.

This PR fixes (hopefully) both issues and unblocks #981

@misko misko added bug Something isn't working minor Minor version release labels Feb 4, 2025
Copy link
Collaborator

@mshuaibii mshuaibii left a comment

Choose a reason for hiding this comment

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

LGTM once we update the corresponding test!

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
...rc/fairchem/applications/cattsunami/core/ocpneb.py 87.21% <100.00%> (+0.19%) ⬆️

@misko misko added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit daa8acc Feb 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor Minor version release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants