Skip to content

Commit 9d0275f

Browse files
authored
breaking(gmx): remove in-tree GROMACS patch integration (#5377)
Problem - The in-tree GROMACS patch has been unmaintained for years and is being deprecated in issue #5360. - The repository still ships the `source/gmx` integration, install guides, and examples that make the removed workflow look officially supported. Change - Delete the in-tree GROMACS patch implementation and remove the related CMake / labeler / example references. - Replace the old GROMACS install and usage docs with deprecation notices that point users to LAMMPS or the third-party implementation referenced from issue #5360. - Clean up remaining mentions in README, troubleshooting docs, notebook text, and API comments. Notes - Validation was limited to repository-wide reference cleanup, `git diff --check`, and JSON validation of `doc/getting-started/quick_start.ipynb`. - This PR intentionally removes the bundled GROMACS examples because they are no longer usable without the deleted in-tree patch. Authored by OpenClaw (model: gpt-5.4) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * In-tree GROMACS plugin support deprecated and removed from the main codebase * All in-repo GROMACS examples and example inputs removed * Repository labeling/configuration entries referencing GROMACS removed * **Documentation** * GROMACS install/use pages converted to deprecation notices and pointers to LAMMPS, i-PI, and third‑party integrations * Tutorials and README entries updated to remove in-tree GROMACS references * Added guidance documenting third‑party GROMACS interfaces and historical context <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 4880f21 commit 9d0275f

38 files changed

Lines changed: 50 additions & 2352 deletions

.github/labeler.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ C:
3030
LAMMPS:
3131
- changed-files:
3232
- any-glob-to-any-file: source/lmp/**/*
33-
Gromacs:
34-
- changed-files:
35-
- any-glob-to-any-file: source/gmx/**/*
3633
i-PI:
3734
- changed-files:
3835
- any-glob-to-any-file: source/ipi/**/*

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DeePMD-kit
22

3-
DeePMD-kit is a deep learning package for many-body potential energy representation and molecular dynamics. It supports multiple backends (TensorFlow, PyTorch, JAX, Paddle) and integrates with MD packages like LAMMPS, GROMACS, and i-PI.
3+
DeePMD-kit is a deep learning package for many-body potential energy representation and molecular dynamics. It supports multiple backends (TensorFlow, PyTorch, JAX, Paddle) and integrates with MD packages like LAMMPS and i-PI.
44

55
**Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
66

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ The code is organized as follows:
110110
- `source/nodejs`: source code of the Node.js API.
111111
- `source/ipi`: source code of i-PI client.
112112
- `source/lmp`: source code of LAMMPS module.
113-
- `source/gmx`: source code of Gromacs plugin.
114113

115114
# Contributing
116115

doc/getting-started/quick_start.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"\n",
8484
"In this tutorial, we will take the gaseous methane molecule as an example to provide a detailed introduction to the training and application of the Deep Potential (DP) model.\n",
8585
"\n",
86-
"DeePMD-kit is a software tool that employs neural networks to fit potential energy models based on first-principles data for molecular dynamics simulations. Without manual intervention, it can end-to-end transform the data provided by users into a deep potential model in a matter of hours. This model can seamlessly integrate with common molecular dynamics simulation software (like LAMMPS, OpenMM, and GROMACS).\n",
86+
"DeePMD-kit is a software tool that employs neural networks to fit potential energy models based on first-principles data for molecular dynamics simulations. Without manual intervention, it can end-to-end transform the data provided by users into a deep potential model in a matter of hours. This model can seamlessly integrate with common molecular dynamics simulation software (like LAMMPS and OpenMM).\n",
8787
"\n",
8888
"DeePMD-kit significantly elevates the limits of molecular dynamics through high-performance computing and machine learning, achieving system scales of up to hundreds of millions of atoms while still maintaining the high accuracy of \"ab initio\" calculations. The simulation time scale is improved by at least 1000 times compared to traditional methods. Its achievements earned the 2020 ACM Gordon Bell Prize, one of the highest honors in the field of high-performance computing, and it has been used by over a thousand research groups in physics, chemistry, materials science, biology, and other fields globally.\n",
8989
"\n",

doc/install/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Installation
99
install-from-c-library
1010
install-lammps
1111
install-ipi
12-
install-gromacs
1312
build-conda
1413
install-nodejs
1514
easy-install-dev

doc/install/install-from-c-library.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Supported backends**: TensorFlow {{ tensorflow_icon }}, JAX {{ jax_icon }}
55
:::
66

7-
DeePMD-kit provides pre-compiled C library package (`libdeepmd_c.tar.gz`) in each [release](https://github.com/deepmodeling/deepmd-kit/releases). It can be used to build the [LAMMPS plugin](./install-lammps.md) and [GROMACS patch](./install-gromacs.md), as well as many [third-party software packages](../third-party/out-of-deepmd-kit.md), without building TensorFlow and DeePMD-kit on one's own.
7+
DeePMD-kit provides pre-compiled C library package (`libdeepmd_c.tar.gz`) in each [release](https://github.com/deepmodeling/deepmd-kit/releases). It can be used to build the [LAMMPS plugin](./install-lammps.md) and the [i-PI driver](./install-ipi.md), as well as many [third-party software packages](../third-party/out-of-deepmd-kit.md), without building TensorFlow and DeePMD-kit on one's own.
88
It can be downloaded via the shell command:
99

1010
```sh
@@ -14,7 +14,7 @@ tar xzf libdeepmd_c.tar.gz
1414

1515
The library is built in Linux (GLIBC 2.17) with CUDA 12.2 (`libdeepmd_c.tar.gz`). It's noted that this package does not contain CUDA Toolkit and cuDNN, so one needs to download them from the NVIDIA website.
1616

17-
## Use Pre-compiled C Library to build the LAMMPS plugin, i-PI driver, and GROMACS patch
17+
## Use Pre-compiled C Library to build the LAMMPS plugin and i-PI driver
1818

1919
When one [installs DeePMD-kit's C++ interface](./install-from-source.md#install-deepmd-kits-c-interface), one can use the CMake argument {cmake:variable}`DEEPMD_C_ROOT` to the path `libdeepmd_c`.
2020

@@ -28,7 +28,7 @@ make install
2828
```
2929

3030
Then the i-PI driver `dp_ipi` will be built and installed.
31-
One can also follow the manual [Install LAMMPS](./install-lammps.md) and/or [Install GROMACS](./install-gromacs.md).
31+
One can also follow the manual [Install LAMMPS](./install-lammps.md). For historical GROMACS context, see the [deprecation notice](./install-gromacs.md).
3232

3333
:::{cmake:variable} DEEPMD_C_ROOT
3434

doc/install/install-gromacs.md

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,17 @@
1-
# Install GROMACS with DeePMD-kit
1+
---
2+
orphan: true
3+
---
24

3-
Before following this section, [DeePMD-kit C++ interface](install-from-source.md) should have be installed.
5+
# GROMACS patch was removed from DeePMD-kit
46

5-
## Patch source code of GROMACS
7+
::::{danger}
68

7-
Download the source code of a supported GROMACS version (2020.2) from https://manual.gromacs.org/2020.2/download.html. Run the following command:
9+
:::{deprecated} v3.2.0
10+
The in-tree GROMACS patch was removed from the DeePMD-kit repository in v3.2.0 and is no longer maintained.
811

9-
```bash
10-
export PATH=$PATH:$deepmd_kit_root/bin
11-
dp_gmx_patch -d $gromacs_root -v $version -p
12-
```
12+
For supported production workflows, use the official [LAMMPS interface](./install-lammps.md).
1313

14-
where `deepmd_kit_root` is the directory where the latest version of DeePMD-kit is installed, and `gromacs_root` refers to the source code directory of GROMACS. And `version` represents the version of GROMACS, where **only 2020.2 is supported now**. If attempting to patch another version of GROMACS you will still need to set `version` to `2020.2` as this is the only supported version, we cannot guarantee that patching other versions of GROMACS will work.
14+
If you need a GROMACS-based workflow, see the third-party overview in [Running MD with GROMACS](../third-party/gromacs.md) and [Interfaces out of DeePMD-kit](../third-party/out-of-deepmd-kit.md).
15+
:::
1516

16-
<!-- ## Install C++ api of deepmd-kit and tensorflow
17-
The C++ interface of `deepmd-kit 2.x` and `tensorflow 2.x` are required. -->
18-
19-
<!-- + Tips: C++ api of deepmd and TensorFlow could be easily installed from the deepmd-kit offline packages. But before using tensorflow, you need to manually change the protobuf package to [version 3.9.2](https://github.com/protocolbuffers/protobuf/releases/tag/v3.9.2) in `$deepmd_env_dir/include/google/protobuf` (the offline package will install a version of 3.14, which will cause incompatibility). Here `deepmd_env_dir` refers to the directory of conda environment created by the deepmd-kit offline packages. -->
20-
21-
## Compile GROMACS with deepmd-kit
22-
23-
The C++ interface of `Deepmd-kit 2.x` and `TensorFlow 2.x` are required. And be aware that only DeePMD-kit with **high precision** is supported now since we cannot ensure single precision is enough for a GROMACS simulation. Here is a sample compile script:
24-
25-
```bash
26-
#!/bin/bash
27-
export CC=/usr/bin/gcc
28-
export CXX=/usr/bin/g++
29-
export CMAKE_PREFIX_PATH="/path/to/fftw-3.3.9" # fftw libraries
30-
mkdir build
31-
cd build
32-
33-
cmake3 .. -DCMAKE_CXX_STANDARD=14 \ # not required, but c++14 seems to be more compatible with higher version of tensorflow
34-
-DGMX_MPI=ON \
35-
-DGMX_GPU=CUDA \ # Gromacs on ROCm has not been fully developed yet
36-
-DCUDAToolkit_ROOT=/path/to/cuda \
37-
-DCMAKE_INSTALL_PREFIX=/path/to/gromacs-2020.2-deepmd
38-
make -j
39-
make install
40-
```
17+
::::

doc/third-party/gromacs.md

Lines changed: 8 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,15 @@
11
# Running MD with GROMACS
22

3-
:::{note}
4-
See [Environment variables](../env.md) for the runtime environment variables.
5-
:::
6-
7-
## DP/MM Simulation
8-
9-
This part gives a simple tutorial on how to run a DP/MM simulation for methane in water, which means using DP for methane and TIP3P for water. All relevant files can be found in `examples/methane`.
10-
11-
### Topology Preparation
12-
13-
Similar to QM/MM simulation, the internal interactions (including bond, angle, dihedrals, LJ, Columb) of the region described by a neural network potential (NNP) have to be **turned off**. In GROMACS, bonded interactions can be turned off by modifying `[ bonds ]`, `[ angles ]`, `[ dihedrals ]` and `[ pairs ]` sections. And LJ and Columb interactions must be turned off by `[ exclusions ]` section.
14-
15-
For example, if one wants to simulate ethane in water, using DeepPotential for methane and TIP3P for water, the topology of methane should be like the following (as presented in `examples/methane/methane.itp`):
16-
17-
```
18-
[ atomtypes ]
19-
;name btype mass charge ptype sigma epsilon
20-
c3 c3 0.0 0.0 A 0.339771 0.451035
21-
hc hc 0.0 0.0 A 0.260018 0.087027
22-
23-
[ moleculetype ]
24-
;name nrexcl
25-
methane 3
26-
27-
[ atoms ]
28-
; nr type resnr residue atom cgnr charge mass
29-
1 c3 1 MOL C1 1 -0.1068 12.010
30-
2 hc 1 MOL H1 2 0.0267 1.008
31-
3 hc 1 MOL H2 3 0.0267 1.008
32-
4 hc 1 MOL H3 4 0.0267 1.008
33-
5 hc 1 MOL H4 5 0.0267 1.008
34-
35-
[ bonds ]
36-
; i j func b0 kb
37-
1 2 5
38-
1 3 5
39-
1 4 5
40-
1 5 5
41-
42-
[ exclusions ]
43-
; ai aj1 aj2 aj3 aj4
44-
1 2 3 4 5
45-
2 1 3 4 5
46-
3 1 2 4 5
47-
4 1 2 3 5
48-
5 1 2 3 4
49-
```
50-
51-
For comparison, the original topology file generated by `acpype` will be:
52-
53-
```
54-
; methane_GMX.itp created by acpype (v: 2021-02-05T22:15:50CET) on Wed Sep 8 01:21:53 2021
55-
56-
[ atomtypes ]
57-
;name bond_type mass charge ptype sigma epsilon Amb
58-
c3 c3 0.00000 0.00000 A 3.39771e-01 4.51035e-01 ; 1.91 0.1078
59-
hc hc 0.00000 0.00000 A 2.60018e-01 8.70272e-02 ; 1.46 0.0208
60-
61-
[ moleculetype ]
62-
;name nrexcl
63-
methane 3
64-
65-
[ atoms ]
66-
; nr type resi res atom cgnr charge mass ; qtot bond_type
67-
1 c3 1 MOL C1 1 -0.106800 12.01000 ; qtot -0.107
68-
2 hc 1 MOL H1 2 0.026700 1.00800 ; qtot -0.080
69-
3 hc 1 MOL H2 3 0.026700 1.00800 ; qtot -0.053
70-
4 hc 1 MOL H3 4 0.026700 1.00800 ; qtot -0.027
71-
5 hc 1 MOL H4 5 0.026700 1.00800 ; qtot 0.000
3+
::::{important}
724

73-
[ bonds ]
74-
; ai aj funct r k
75-
1 2 1 1.0970e-01 3.1455e+05 ; C1 - H1
76-
1 3 1 1.0970e-01 3.1455e+05 ; C1 - H2
77-
1 4 1 1.0970e-01 3.1455e+05 ; C1 - H3
78-
1 5 1 1.0970e-01 3.1455e+05 ; C1 - H4
79-
80-
[ angles ]
81-
; ai aj ak funct theta cth
82-
2 1 3 1 1.0758e+02 3.2635e+02 ; H1 - C1 - H2
83-
2 1 4 1 1.0758e+02 3.2635e+02 ; H1 - C1 - H3
84-
2 1 5 1 1.0758e+02 3.2635e+02 ; H1 - C1 - H4
85-
3 1 4 1 1.0758e+02 3.2635e+02 ; H2 - C1 - H3
86-
3 1 5 1 1.0758e+02 3.2635e+02 ; H2 - C1 - H4
87-
4 1 5 1 1.0758e+02 3.2635e+02 ; H3 - C1 - H4
88-
```
89-
90-
### DeePMD-kit Settings
91-
92-
Before running simulations, we need to tell GROMACS to use DeepPotential by setting the environment variable `GMX_DEEPMD_INPUT_JSON`:
93-
94-
```bash
95-
export GMX_DEEPMD_INPUT_JSON=input.json
96-
```
97-
98-
Then, in your working directories, we have to write `input.json` file:
99-
100-
```json
101-
{
102-
"graph_file": "/path/to/graph.pb",
103-
"type_file": "type.raw",
104-
"index_file": "index.raw",
105-
"lambda": 1.0,
106-
"pbc": false
107-
}
108-
```
109-
110-
Here is an explanation for these settings:
111-
112-
- `graph_file` : The [model file](../backend.md) generated by `dp freeze` command
113-
- `type_file` : File to specify DP atom types (in space-separated format). Here, `type.raw` looks like
114-
115-
```
116-
1 0 0 0 0
117-
```
118-
119-
- `index_file` : File containing indices of DP atoms (in space-separated format), which should be consistent with the indices' order in .gro file but **starting from zero**. Here, `index.raw` looks like
120-
121-
```
122-
0 1 2 3 4
123-
```
124-
125-
- `lambda`: Optional, default 1.0. Used in alchemical calculations.
126-
- `pbc`: Optional, default true. If true, the GROMACS periodic condition is passed to DeePMD-kit.
127-
128-
### Run Simulation
129-
130-
Finally, you can run GROMACS using `gmx mdrun` as usual.
131-
132-
## All-atom DP Simulation
5+
:::{deprecated} v3.2.0
6+
The official in-tree GROMACS patch was removed from DeePMD-kit in v3.2.0 and is no longer maintained.
7+
:::
1338

134-
This part gives an example of how to simulate all atoms described by a DeepPotential with Gromacs, taking water as an example. Instead of using `[ exclusions ]` to turn off the non-bonded energies, we can simply do this by setting LJ parameters (i.e. epsilon and sigma) and partial charges to 0, as shown in `examples/water/gmx/water.top`:
9+
::::
13510

136-
```
137-
[ atomtypes ]
138-
; name at.num mass charge ptype sigma epsilon
139-
HW 1 1.008 0.0000 A 0.00000e+00 0.00000e+00
140-
OW 8 16.00 0.0000 A 0.00000e+00 0.00000e+00
141-
```
11+
DeePMD-kit may still be used with GROMACS through third-party integrations maintained outside this repository.
14212

143-
As mentioned in the above section, `input.json` and relevant files (`index.raw`, `type.raw`) should also be created. Then, we can start the simulation under the NVT ensemble and plot the radial distribution function (RDF) by `gmx rdf` command. We can see that the RDF given by Gromacs+DP matches perfectly with LAMMPS+DP, which further provides an evidence on the validity of our simulation.
144-
![rdf](../../examples/water/gmx/rdf.png)
13+
For supported production workflows maintained in-tree, prefer the official [LAMMPS interface](../install/install-lammps.md) together with the [LAMMPS runtime documentation](./lammps-command.md).
14514

146-
However, we still recommend you run an all-atom DP simulation using LAMMPS since it is more stable and efficient.
15+
For currently known external implementations, see [Interfaces out of DeePMD-kit](./out-of-deepmd-kit.md#third-party-gromacs-interface-to-deepmd-kit).

doc/third-party/out-of-deepmd-kit.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ It is also the first example to the DeePMD-kit [plugin mechanism](../development
1212

1313
## C/C++ interface used by other packages
1414

15+
### Third-party GROMACS interface to DeePMD-kit
16+
17+
A third-party GROMACS interface to DeePMD-kit is available outside this repository at [HuXioAn/gromacs/tree/deepmd-oneModel](https://github.com/HuXioAn/gromacs/tree/deepmd-oneModel). It is based on the GROMACS Neural Network Potentials (NNPot) infrastructure and is described in [Enabling AI Deep Potentials for Ab Initio-quality Molecular Dynamics Simulations in GROMACS](https://arxiv.org/abs/2602.02234).
18+
19+
According to that implementation and paper, this interface supports
20+
21+
- DeePMD-kit inference through the C++/CUDA backend;
22+
- multiple DeePMD model families, including `se_e2_a`, `DPA`, `DPA2`, and `DPA3`;
23+
- hybrid workflows where DeePMD-kit is applied to selected atom groups inside a GROMACS simulation.
24+
25+
The reported examples use protein-in-water systems, where DeePMD-kit is applied to the protein internal interactions while water and protein-water interactions remain classical.
26+
27+
Users should also be aware of the current scope reported by the third-party project:
28+
29+
- the published benchmarks enable DeePMD only in the production MD stage, not in EM/NVT/NPT;
30+
- the reported implementation uses single-rank inference in the current GROMACS NNPot workflow;
31+
- scalability and domain-decomposed inference are described as future optimization targets;
32+
- some DPA3 benchmark cases run out of GPU memory on the tested hardware.
33+
34+
This interface is maintained outside DeePMD-kit. Please refer to the corresponding third-party repository for installation instructions, supported GROMACS versions, and runtime details.
35+
1536
### OpenMM plugin for DeePMD-kit
1637

1738
An [OpenMM](https://github.com/openmm/openmm) plugin is provided from [JingHuangLab/openmm_deepmd_plugin](https://github.com/JingHuangLab/openmm_deepmd_plugin), written by the [Huang Lab](http://www.compbiophysics.org/) at Westlake University.

doc/troubleshooting/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Inadequate versions of gcc/g++
44

5-
Sometimes you may use a gcc/g++ of version < 4.8. In this way, you can still compile all the parts of TensorFlow and most of the parts of DeePMD-kit, but i-PI and GROMACS plugins will be disabled automatically. Or if you have a gcc/g++ of version > 4.8, say, 7.2.0, you may choose to use it by doing
5+
Sometimes you may use a gcc/g++ of version < 4.8. In this way, you can still compile all the parts of TensorFlow and most of the parts of DeePMD-kit, but the i-PI driver will be disabled automatically. Or if you have a gcc/g++ of version >= 4.8, say, 7.2.0, you may choose to use it by doing
66

77
```bash
88
export CC=/path/to/gcc-7.2.0/bin/gcc

0 commit comments

Comments
 (0)