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

Updating floating point precision for OC22/total_energy predictions and enabling OC22 challenge submission file generation #421

Merged
merged 19 commits into from
Jan 24, 2023

Conversation

wood-b
Copy link
Collaborator

@wood-b wood-b commented Oct 7, 2022

This PR does the following:

  1. Predictions (energy and forces) for total energy models are written in float32. Ultimately, this only changes the forces_trainer, the energy_trainer was already writing predictions in float32
  2. The method used to convert the energy predictions tensor was updated to keep the dtype intact
  3. The make_submission_file.py script was updated to include OC22 challenge submissions
  4. An assert was added to the make_submission_file.py script ensuring OC22 submission are written in >= float32, this was added because if the total_energy=True flag is not set in the dataset config for an OC22 S2EF model the model will train but predictions will be written in float16 the OC20 default
  5. All OC22 base.yml configs were updated to include total_energy=True

I tested OC22 predictions written in both float32 and float16, and the updates work as expected.

@mshuaibii
Copy link
Collaborator

Tested make_submission_file.py for OC22. We should go back and try this for OC20 as well.

scripts/make_submission_file.py Outdated Show resolved Hide resolved
ocpmodels/trainers/forces_trainer.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #421 (2d21fd9) into main (cba9fb6) will decrease coverage by 0.01%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
- Coverage   45.22%   45.21%   -0.02%     
==========================================
  Files          88       88              
  Lines        8278     8281       +3     
==========================================
  Hits         3744     3744              
- Misses       4534     4537       +3     
Impacted Files Coverage Δ
ocpmodels/trainers/energy_trainer.py 15.65% <0.00%> (ø)
ocpmodels/trainers/forces_trainer.py 9.57% <16.66%> (-0.10%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@wood-b
Copy link
Collaborator Author

wood-b commented Dec 13, 2022

A few updates:

  • I ran a number of test predictions with this branch to compare with previous predictions, one model from each of the following tasks: OC20 S2EF, OC20 IS2RE, OC22 S2EF, OC22 IS2RE — sharing those results offline as it is a bit much to add here.
  • Documentation for the prediction_dtype has been added to the S2EF example.yml
  • Documentation on making an OC22 EvalAI submission file has been added to TRAIN.MD

@abhshkdz @mshuaibii Take another look and let me know if I missed anything.

TRAIN.md Show resolved Hide resolved
TRAIN.md Outdated Show resolved Hide resolved
configs/oc22/is2re/base.yml Show resolved Hide resolved
configs/oc22/is2re/base.yml Show resolved Hide resolved
configs/oc22/s2ef/base.yml Show resolved Hide resolved
scripts/make_submission_file.py Show resolved Hide resolved
abhshkdz
abhshkdz previously approved these changes Jan 23, 2023
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 - thanks!

@abhshkdz abhshkdz merged commit 5a95b3d into main Jan 24, 2023
@abhshkdz abhshkdz deleted the predict_fp branch January 24, 2023 22:39
levineds pushed a commit that referenced this pull request Jul 11, 2024
…redictions (#421)

* write tot_e predicts in float32

* adding total_energy=True to base OC22 configs

* assert oc22 predictions are fp32

* update to method for writing predictions to keep track of precision

* submission file to support oc22

* move energy values to cpu before writing predicts and updated make_submission script

* minor fix

* minor fix

* update to include prediction_dtype flag and remove check in make_submission_file.py

* added documentation for the prediction_type flag and oc22 evalai

* updated oc22 docs in TRAIN.md and minor changes to make_submission_file.py

* add joint training documentation

Co-authored-by: Muhammed Shuaibi <mshuaibi@andrew.cmu.edu>
Co-authored-by: Muhammed Shuaibi <45150244+mshuaibii@users.noreply.github.com>
Co-authored-by: Abhishek Das <das.abhshk@gmail.com>
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.

4 participants