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 functionality to support the deep potential #827

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Kick-H
Copy link
Contributor

@Kick-H Kick-H commented Dec 15, 2024

Summary

I wrote a preliminary version and tested it with water system. After comparison, there was no problem with the force and energy. Here is the detailed installation and testing process.

The most complicated and time-consuming part of this version is probably the establishment of the neighbor list. I used the easiest method here, which requires completely mirroring the central cell to obtain the information of the 27 mirror boxes around it (boundary conditions p p p), and then completing the solution of the information of the atoms in the central box (the real box atoms).

This version was initially tested for speed and was several times slower than lammps, but it supports a larger simulation system size.

Modification

Added two files, force/deepmd.cu and force/deepmd.cuh, and added an example in examples/14_DP_water_msd, and the installation tutorial is also here (examples/14_DP_water_msd/Readme.md).

Others

Refer to the DP-lammps interface file pair_deepmd.cpp, which contains the dp.compute command, which can complete the solution of force and energy through coordinates and atomic types by calling dp's dependencies.

@@ -548,8 +620,14 @@ void initialize_position(
}

std::vector<std::string> atom_symbols;
auto filename_potential = get_filename_potential();
auto filename_potential = get_out_potential();
Copy link
Owner

Choose a reason for hiding this comment

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

This line should be separately writen in the #ifdef and #else parts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line should be separately writen in the #ifdef and #else parts

OK, I've fixed it and it compiles.

@brucefan1983
Copy link
Owner

brucefan1983 commented Dec 15, 2024

Have you also tested virial stress and heat current?

Make output concise
@Dankomaister
Copy link

Nice work @Kick-H !
I curious why does deepmd need its own neighbour list implementation instead of just using the one thats already in GPUMD?

@Kick-H
Copy link
Contributor Author

Kick-H commented Dec 16, 2024

Nice work @Kick-H ! I curious why does deepmd need its own neighbour list implementation instead of just using the one thats already in GPUMD?

This is related to the C++ interface of DP. If you are interested, welcome to check the source code.

@Kick-H
Copy link
Contributor Author

Kick-H commented Dec 16, 2024

Have you also tested virial stress and heat current?

I have tested stress. The heat flux test has not been done yet, but it is definitely worth doing.

Keep documents streamlined by removing unnecessary information
@brucefan1983 brucefan1983 changed the title Add functionality to support Deepkit potential Add functionality to support the deep potential Dec 16, 2024
@Dankomaister
Copy link

Maybe worth replacing the cuda* specific calls with the macros we have (src/utilities/gpu_macro.cuh) ? Then this should work on AMD GPUs as well (assuming one has tensorflow and the deepmd lib)

@Kick-H
Copy link
Contributor Author

Kick-H commented Dec 17, 2024

Maybe worth replacing the cuda* specific calls with the macros we have (src/utilities/gpu_macro.cuh) ? Then this should work on AMD GPUs as well (assuming one has tensorflow and the deepmd lib)

OK, thank you very much for your suggestion.

replae the cuda* specific calls with the macros
@brucefan1983
Copy link
Owner

General comments:

  • Do not modify read_xyz.cu, try to make a driver input file for DeePMD which reads:
deepmd 2 H O
your_deepmd.pb
  • Move the special neighbor list code to deepmd.cu.

  • Use a separate makefile for deepmd. Do not touch the existing makefiles.

  • In summary, keep the other parts untouched.

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.

3 participants