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

Always read files in double precision #294

Merged
merged 10 commits into from
Jul 15, 2024
Merged

Always read files in double precision #294

merged 10 commits into from
Jul 15, 2024

Conversation

PicoCentauri
Copy link
Contributor

@PicoCentauri PicoCentauri commented Jul 12, 2024

As discussed with @frostedoyster it seems to be good idea to read all information from files in double precision and let the model decide when to convert them to the user requested precision. This is in particular useful when subtracting composition energies. Usually, composition energies are very large and one may end up with round-off errors when not doing these operations in the highest precision.

I also extended the mypy linter to all to be linted files and I also enabled all features of the sphinx-linter

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • [ ] Issue referenced (for PRs that solve an issue)?

📚 Documentation preview 📚: https://metatrain--294.org.readthedocs.build/en/294/

Copy link
Collaborator

@frostedoyster frostedoyster left a comment

Choose a reason for hiding this comment

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

Not sure why the regression tests are failing for the alchemical model. It looks to me that we didn't change anything

devices: List[torch.device],
train_datasets: List[Union[Dataset, torch.utils.data.Subset]],
val_datasets: List[Union[Dataset, torch.utils.data.Subset]],
checkpoint_dir: str,
):
dtype = train_datasets[0][0]["system"].positions.dtype
assert dtype in AlchemicalModel.__supported_dtypes__
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can go outside of the trainers, in our infrastructure code rather than in the model code (same for the other architectures)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already do this outside. I just added this is in case one wants to debug the model without going through the whole metatrain infrastructure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, fair

@PicoCentauri
Copy link
Contributor Author

Not sure why the regression tests are failing for the alchemical model. It looks to me that we didn't change anything

Yes, for me it is also weird. The only reason I see is that it may not work in 64 bit....

@frostedoyster
Copy link
Collaborator

The alchemical tests made no sense in the first place... Not sure why we were parametrizing both float32 and float64 when we wanted to check exact reproducibility with the same result. I'm fixing them

@frostedoyster frostedoyster marked this pull request as ready for review July 15, 2024 16:58
@frostedoyster frostedoyster merged commit 3c76486 into main Jul 15, 2024
10 of 11 checks passed
@frostedoyster frostedoyster deleted the reader-64bit branch July 15, 2024 16:59
@frostedoyster frostedoyster mentioned this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants