atomate2 icon indicating copy to clipboard operation
atomate2 copied to clipboard

Feat: Add DeepMD MLFF support

Open MoseyQAQ opened this issue 1 year ago • 13 comments

Summary

I have integrated atomate2 with the DeepMD MLFF, enabling efficient high-throughput calculations using this powerful tool.

Checklist

  • [x] Tests have been added for any new functionality or bug fixes.

MoseyQAQ avatar Sep 29 '24 19:09 MoseyQAQ

@MoseyQAQ Thanks for your contribution.

As you might have seen, we want to deprecate the concrete implementations of the force fields in the future and just provide a general interface. I am not sure if it makes sense to add this new implementation just now and directly deprecate it in a few months.

@utf @janosh Opinions?

JaGeo avatar Sep 29 '24 19:09 JaGeo

@JaGeo Hi, thanks for your comment! I opted for concrete implementations because the atomate2 workflow for calculating phonons tutorial uses concrete implementations. I aim to maintain consistency with the established practices in these resources to ensure a seamless user experience.

MoseyQAQ avatar Sep 30 '24 04:09 MoseyQAQ

@utf Opinions?

@MoseyQAQ Yes, sure, it does. However, we decided to change this in the future. You can even see this from the code that you implemented.

JaGeo avatar Sep 30 '24 06:09 JaGeo

Thanks for this @MoseyQAQ. I agree with @JaGeo, there doesn't seem much point adding something already with a deprecation notice. I would remove the concrete implementations but leave the rest of your code. DeepMD is great to have in atomate2.

In the future, we should think about convenience functions to create entire flows with a specific forcefield. E.g., something like:


from atomate2.forcefields.flows import ElasticMaker

maker = ElasticMaker.from_forcefield("DeepMD")

utf avatar Sep 30 '24 08:09 utf

@utf Thank you!

MoseyQAQ avatar Sep 30 '24 08:09 MoseyQAQ

@utf @JaGeo , Hi! I’m currently working on removing the old implementations as suggested and addressing the issue preventing the code from passing the unit tests (which might be related to the dependency version). I’ll update as I make progress.

MoseyQAQ avatar Oct 03 '24 19:10 MoseyQAQ

@utf @JaGeo Hi! This PR is ready for review and could be merged.

MoseyQAQ avatar Oct 05 '24 09:10 MoseyQAQ

@janosh Hi, I found that the test can't pass because MACE is unable to download the foundation model from tinyurl.com. In the latest release of MACE, the original tinyurl.com link has been replaced with GitHub. The previous tinyurl.com URL returns a 403 error, which prevents the model from being downloaded properly.

MoseyQAQ avatar Oct 05 '24 19:10 MoseyQAQ

thanks for letting me know. could you replace tinyurl.com with one of the checkpoints from here? maybe 2023-12-10-mace-128-L0_epoch-199.model

janosh avatar Oct 05 '24 19:10 janosh

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 4.36%. Comparing base (ec1b598) to head (b012a93). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/atomate2/forcefields/utils.py 0.00% 5 Missing :warning:
src/atomate2/forcefields/__init__.py 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #999       +/-   ##
==========================================
- Coverage   76.09%   4.36%   -71.74%     
==========================================
  Files         174     175        +1     
  Lines       12690   12742       +52     
  Branches     1892    1899        +7     
==========================================
- Hits         9657     556     -9101     
- Misses       2494   12152     +9658     
+ Partials      539      34      -505     
Files with missing lines Coverage Δ
src/atomate2/forcefields/jobs.py 0.00% <ø> (-96.38%) :arrow_down:
src/atomate2/forcefields/schemas.py 0.00% <ø> (-97.23%) :arrow_down:
src/atomate2/forcefields/__init__.py 0.00% <0.00%> (-100.00%) :arrow_down:
src/atomate2/forcefields/utils.py 0.00% <0.00%> (-90.00%) :arrow_down:

... and 153 files with indirect coverage changes

codecov[bot] avatar Oct 05 '24 21:10 codecov[bot]

@utf : I added that kind of convenience function for the forcefield EOS flows but didn't for more complex ones - happy to do that in a separate PR

esoteric-ephemera avatar Oct 14 '24 18:10 esoteric-ephemera

Thanks @esoteric-ephemera and @MoseyQAQ. Is this ready for final review?

utf avatar Oct 15 '24 10:10 utf

@utf Yes. @esoteric-ephemera Thank you!

MoseyQAQ avatar Oct 15 '24 14:10 MoseyQAQ