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

Add tests for hydra gemnet OC scaling factor generation and loading; Raise error on fail to load scaling factors #831

Merged
merged 11 commits into from
Oct 1, 2024

Conversation

misko
Copy link
Collaborator

@misko misko commented Sep 5, 2024

Currently gemnet OC has a test to generate scaling factors and load them.

This adds additional tests for gemnet OC hydra configuration and also by default throws a value error if scaling factors are specified through 'scale_file' but are actually missing for some layers. This way we wont accidentally silently fail to load scaling factors.

Throwing a value error on failure to load can be suppressed by passing 'raise_on_scale_load_error=False' in the model config.

@misko misko requested a review from wood-b September 5, 2024 01:54
@misko misko added bug Something isn't working patch Patch version release labels Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/fairchem/core/modules/scaling/compat.py 66.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/fairchem/core/modules/scaling/fit.py 73.80% <100.00%> (+1.08%) ⬆️
src/fairchem/core/modules/scaling/compat.py 91.48% <66.66%> (-1.70%) ⬇️

... and 1 file with indirect coverage changes

@misko misko requested a review from rayg1234 September 9, 2024 15:53
Copy link
Collaborator

@wood-b wood-b left a comment

Choose a reason for hiding this comment

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

My main concern that the change to fit.py would break scaling factors for non-hydra models

src/fairchem/core/models/gemnet_oc/gemnet_oc.py Outdated Show resolved Hide resolved
src/fairchem/core/modules/scaling/fit.py Outdated Show resolved Hide resolved
wood-b
wood-b previously approved these changes Sep 16, 2024
Copy link
Collaborator

@wood-b wood-b left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks Misko!!

Copy link
Collaborator

@wood-b wood-b left a comment

Choose a reason for hiding this comment

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

LGTM!

@misko misko added this pull request to the merge queue Oct 1, 2024
Merged via the queue into main with commit 3012925 Oct 1, 2024
8 checks passed
@misko misko deleted the add_gemnet_scaling_factors_support_for_hydra branch October 1, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch Patch version release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants