-
Notifications
You must be signed in to change notification settings - Fork 1
enh(metatomic): Vesin first pass #1
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
Open
HaoZeke
wants to merge
42
commits into
main
Choose a base branch
from
useVesin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
43e0fe7
Intitial scaffolding of metatensor interface
Luthaf a3fc5c9
[MAINT] Fix merge cruft
HaoZeke 9fbf93f
chore(metatensor): orchestrate vesin design
HaoZeke 8932089
chore(build): try to find metatensor
HaoZeke 11f4ff2
chore(metatomic): trace nnpot through the code
HaoZeke 2f9b51d
chore(metatomic): register as an energy output
HaoZeke 1ac6b17
chore(metatomic): rename for the new ecosystem
HaoZeke e0d7995
chore(metatomic): regex rename for metatomic
HaoZeke 8d58263
chore(metatomic): add topology processing
HaoZeke f6837a5
maint(metatomic): docstring update and formatting
HaoZeke 799454d
maint(params): use the right variables
HaoZeke 18a2a95
doc(metatomic): add a note wrt tpr
HaoZeke 0138afc
chore(metatomic): rework cmake dependencies
HaoZeke 3d964d5
chore(metatomic): try to use more git and fallback
HaoZeke bbbff69
chore(metatomic): kang from LAMMPS
HaoZeke 6a69669
chore(openmp): fix for cuda compilers
HaoZeke c23f94a
chore(metatomic): resolve more compilation errors
HaoZeke 58bea16
chore(metatomic): try to fix compilers
HaoZeke 9212e26
chore(metatomic): grab vesin through cmake
HaoZeke b6e3d9e
chore(metatomic): remove caffe2 mkl workaround
HaoZeke e24d9a0
chore(metatomic): easier imports
HaoZeke d0bc34c
chore(metatomic): Forgotten include
HaoZeke a1fbc30
chore(metatomic): forgotten cmake
HaoZeke 5fe4b03
feat(mta): rework a ton for compilation
HaoZeke 4906acc
feat(mta): update vesin to 0.4.1
HaoZeke 67b5fac
feat(mta): compile without errors
HaoZeke 25ee141
feat(mta): compile AND link correctly
HaoZeke 4ee2d02
chore(mtaopt): rework in the style of nnpot
HaoZeke 899126d
chore(mdmta): register everywhere
HaoZeke 1744fa6
tst(mtaopt): add reference tests for options
HaoZeke 15438cd
bug(mtaforce): ensure compatible extensions
HaoZeke ecb1b31
bug(mtaforce): fix vesin calling conventions
HaoZeke 51c945e
chore(mtaforce): use the model dtype
HaoZeke 4c71a0d
chore(mtaforce): cleanup debugging
HaoZeke 5d78bf3
chore(mtapot): update for mpi usage and efficiency
HaoZeke 71a85e6
chore(mtaforce): defensively handle dtypes
HaoZeke 26583ee
feat(mtapot): use more internal helpers
HaoZeke dbe5379
chore(mtapot): cleanup a bit
HaoZeke 82c786d
chore(typo): fixup
HaoZeke fcd9e5f
chore(cmake): rework for older versions and clean
HaoZeke f4b0bb7
chore(cpp): more cleanup
HaoZeke c619614
Update src/gromacs/applied_forces/metatomic/metatomic_forceprovider.h
HaoZeke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,6 +198,7 @@ enum | |
| F_DENSITYFITTING, | ||
| F_EQM, | ||
| F_ENNPOT, | ||
| F_EMETATOMICPOT, | ||
| F_EPOT, | ||
| F_EKIN, | ||
| F_ETOT, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| # | ||
| # This file is part of the GROMACS molecular simulation package. | ||
| # | ||
| # Copyright 2024- The GROMACS Authors | ||
| # and the project initiators Erik Lindahl, Berk Hess and David van der Spoel. | ||
| # Consult the AUTHORS/COPYING files and https://www.gromacs.org for details. | ||
| # | ||
| # GROMACS is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public License | ||
| # as published by the Free Software Foundation; either version 2.1 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # GROMACS is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with GROMACS; if not, see | ||
| # https://www.gnu.org/licenses, or write to the Free Software Foundation, | ||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| # | ||
| # If you want to redistribute modifications to GROMACS, please | ||
| # consider that scientific software is very special. Version | ||
| # control is crucial - bugs must be traceable. We will be happy to | ||
| # consider code for inclusion in the official distribution, but | ||
| # derived work must not be called official GROMACS. Details are found | ||
| # in the README & COPYING files - if they are missing, get the | ||
| # official version at https://www.gromacs.org. | ||
| # | ||
| # To help us fund GROMACS development, we humbly ask that you cite | ||
| # the research papers on the package. Check out https://www.gromacs.org. | ||
|
|
||
|
|
||
| option(GMX_METATOMIC "Enable interface to metatomic atomistic models" OFF) | ||
|
|
||
| # if(TORCH_ALREADY_SEARCHED) | ||
| # set(FIND_TORCH_QUIETLY ON) | ||
| # endif() | ||
|
|
||
| if(GMX_METATOMIC) | ||
| # Bring the `torch` target in scope to allow evaluation | ||
| # of cmake generator expression from `metatensor_torch` | ||
| find_package(Torch REQUIRED) | ||
|
|
||
| ################ definition of metatensor and metatomic targets ################ | ||
|
|
||
| set(METATENSOR_CORE_VERSION "0.1.17") | ||
| set(METATENSOR_CORE_SHA256 "42119e11908239915ccc187d7ca65449b461f1d4b5af4d6df1fb613d687da76a") | ||
|
|
||
| set(METATENSOR_TORCH_VERSION "0.8.0") | ||
| set(METATENSOR_TORCH_SHA256 "61d383ce958deafe0e3916088185527680c9118588722b17ec5c39cfbaa6da55") | ||
|
|
||
| set(METATOMIC_TORCH_VERSION "0.1.4") | ||
| set(METATOMIC_TORCH_SHA256 "385ec8b8515d674b6a9f093f724792b2469e7ea2365ca596f574b64e38494f94") | ||
|
|
||
| set(VESIN_VERSION "0.4.1") | ||
| set(VESIN_GIT_TAG "87dcad999fec47b29ab21be9662ef283edc7530b") | ||
|
|
||
| set(DOWNLOAD_VESIN_DEFAULT ON) | ||
| find_package(vesin ${VESIN_VERSION} QUIET) | ||
| if (vesin_FOUND) | ||
| set(DOWNLOAD_VESIN_DEFAULT OFF) | ||
| endif() | ||
|
|
||
| set(DOWNLOAD_METATENSOR_DEFAULT ON) | ||
| find_package(metatensor_torch ${METATENSOR_TORCH_VERSION} QUIET) | ||
| if (metatensor_torch_FOUND) | ||
| set(DOWNLOAD_METATENSOR_DEFAULT OFF) | ||
| endif() | ||
|
|
||
| set(DOWNLOAD_METATOMIC_DEFAULT ON) | ||
| find_package(metatomic_torch ${METATOMIC_TORCH_VERSION} QUIET) | ||
| if (metatomic_torch_FOUND) | ||
| set(DOWNLOAD_METATOMIC_DEFAULT OFF) | ||
| endif() | ||
|
|
||
|
|
||
| option(DOWNLOAD_METATENSOR "Download metatensor package instead of using an already installed one" ${DOWNLOAD_METATENSOR_DEFAULT}) | ||
| option(DOWNLOAD_METATOMIC "Download metatomic package instead of using an already installed one" ${DOWNLOAD_METATOMIC_DEFAULT}) | ||
|
|
||
| if (DOWNLOAD_METATENSOR) | ||
| include(FetchContent) | ||
|
|
||
| set(URL_BASE "https://github.com/metatensor/metatensor/releases/download") | ||
| FetchContent_Declare(metatensor | ||
| URL ${URL_BASE}/metatensor-core-v${METATENSOR_CORE_VERSION}/metatensor-core-cxx-${METATENSOR_CORE_VERSION}.tar.gz | ||
| URL_HASH SHA256=${METATENSOR_CORE_SHA256} | ||
| ) | ||
|
|
||
| message(STATUS "Fetching metatensor v${METATENSOR_CORE_VERSION} from github") | ||
| FetchContent_MakeAvailable(metatensor) | ||
|
|
||
| FetchContent_Declare(metatensor-torch | ||
| URL ${URL_BASE}/metatensor-torch-v${METATENSOR_TORCH_VERSION}/metatensor-torch-cxx-${METATENSOR_TORCH_VERSION}.tar.gz | ||
| URL_HASH SHA256=${METATENSOR_TORCH_SHA256} | ||
| ) | ||
|
|
||
| message(STATUS "Fetching metatensor-torch v${METATENSOR_TORCH_VERSION} from github") | ||
| FetchContent_MakeAvailable(metatensor-torch) | ||
| else() | ||
| # make sure to fail the configuration if cmake can not find metatensor-torch | ||
| find_package(metatensor_torch REQUIRED ${METATENSOR_TORCH_VERSION}) | ||
| endif() | ||
|
|
||
| if (DOWNLOAD_METATOMIC) | ||
| include(FetchContent) | ||
|
|
||
| set(URL_BASE "https://github.com/metatensor/metatomic/releases/download") | ||
| FetchContent_Declare(metatomic-torch | ||
| URL ${URL_BASE}/metatomic-torch-v${METATOMIC_TORCH_VERSION}/metatomic-torch-cxx-${METATOMIC_TORCH_VERSION}.tar.gz | ||
| URL_HASH SHA256=${METATOMIC_TORCH_SHA256} | ||
| ) | ||
|
|
||
| message(STATUS "Fetching metatomic-torch v${METATOMIC_TORCH_VERSION} from github") | ||
| FetchContent_MakeAvailable(metatomic-torch) | ||
| else() | ||
| # make sure to fail the configuration if cmake can not find metatomic-torch | ||
| find_package(metatomic_torch REQUIRED ${METATOMIC_TORCH_VERSION}) | ||
| endif() | ||
|
|
||
| if (DOWNLOAD_VESIN) | ||
| include(FetchContent) | ||
|
|
||
| FetchContent_Declare( | ||
| vesin | ||
| GIT_REPOSITORY https://github.com/Luthaf/vesin.git | ||
| GIT_TAG ${VESIN_GIT_TAG} | ||
| ) | ||
|
|
||
| FetchContent_MakeAvailable(vesin) | ||
| else() | ||
| # make sure to fail the configuration if cmake can not find vesin | ||
| find_package(vesin REQUIRED ${VESIN_VERSION}) | ||
| endif() | ||
|
|
||
| list(APPEND GMX_COMMON_LIBRARIES | ||
| vesin | ||
| metatensor | ||
| metatomic_torch | ||
| metatensor_torch | ||
| ) | ||
|
|
||
| endif() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # | ||
| # This file is part of the GROMACS molecular simulation package. | ||
| # | ||
| # Copyright 2024- The GROMACS Authors | ||
| # and the project initiators Erik Lindahl, Berk Hess and David van der Spoel. | ||
| # Consult the AUTHORS/COPYING files and https://www.gromacs.org for details. | ||
| # | ||
| # GROMACS is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public License | ||
| # as published by the Free Software Foundation; either version 2.1 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # GROMACS is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with GROMACS; if not, see | ||
| # https://www.gnu.org/licenses, or write to the Free Software Foundation, | ||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| # | ||
| # If you want to redistribute modifications to GROMACS, please | ||
| # consider that scientific software is very special. Version | ||
| # control is crucial - bugs must be traceable. We will be happy to | ||
| # consider code for inclusion in the official distribution, but | ||
| # derived work must not be called official GROMACS. Details are found | ||
| # in the README & COPYING files - if they are missing, get the | ||
| # official version at https://www.gromacs.org. | ||
| # | ||
| # To help us fund GROMACS development, we humbly ask that you cite | ||
| # the research papers on the package. Check out https://www.gromacs.org. | ||
|
|
||
| gmx_add_libgromacs_sources( | ||
| metatomic_options.cpp | ||
| metatomic_mdmodule.cpp | ||
| metatomic_topologypreprocessor.cpp | ||
| ) | ||
|
|
||
| if (GMX_METATOMIC) | ||
| gmx_add_libgromacs_sources( | ||
| metatomic_forceprovider.cpp | ||
| ) | ||
| else() | ||
| gmx_add_libgromacs_sources( | ||
| metatomic_forceprovider_stub.cpp | ||
| ) | ||
| endif() | ||
|
|
||
| if (BUILD_TESTING) | ||
| add_subdirectory(tests) | ||
| endif() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.