You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ For more details on Allegro itself, background, and the LAMMPS pair style please
9
9
and
10
10
> *Scaling the leading accuracy of deep equivariant models to biomolecular simulations of realistic size* <br/>
11
11
> Albert Musaelian, Anders Johansson, Simon Batzner, Boris Kozinsky <br/>
12
-
> https://arxiv.org/abs/2304.10061 <br/>
12
+
> https://doi.org/10.1145/3581784.3627041 <br/>
13
13
14
14
`pair_allegro` authors: **Anders Johansson**, Albert Musaelian.
15
15
16
16
## Pre-requisites
17
17
18
-
* PyTorch or LibTorch >= 1.11.0; please note that at present we **only recommend 1.11** on CUDA systems.
18
+
* PyTorch or LibTorch >= 1.11.0; please note that at present we have only thoroughly tested 1.11 on NVIDIA GPUs (see [#311 for NequIP](https://github.com/mir-group/nequip/discussions/311#discussioncomment-5129513)) and 1.13 on AMD GPUs, but newer 2.x versions *may* also work. With newer versions, setting the environment variable `PYTORCH_JIT_USE_NNC_NOT_NVFUSER=1` sometimes helps.
19
19
20
20
## Usage in LAMMPS
21
21
@@ -32,7 +32,7 @@ To run with Kokkos, please see the [LAMMPS Kokkos documentation](https://docs.la
32
32
```bash
33
33
mpirun -np 8 lmp -sf kk -k on g 4 -pk kokkos newton on neigh full -in in.script
34
34
```
35
-
to run on 2 nodes with 4 GPUs each.
35
+
to run on 2 nodes with 4 GPUs *each*.
36
36
37
37
### Compute
38
38
We provide an experimental "compute" that allows you to extract custom quantities from Allegro models, such as [polarization](https://arxiv.org/abs/2403.17207). You can extract either global or per-atom properties with syntax along the lines of
@@ -42,22 +42,25 @@ compute polarizability all allegro polarizability 9
42
42
compute borncharges all allegro/atom born_charge 9 1
43
43
```
44
44
45
-
The name after `allegro[/atom]` is attempted extracted from the dictionary that the Allegro model returns. The following number is the number of elements after flattening the output. In the examples above, polarization is a 3-element global vector, while polarizability and Born charges are global and per-atom 3x3 matrices, respectively. For per-atom quantities, the second number is a flag indicating whether the properties should be reverse-communicated "Newton-style" like forces, which will depend on your property and the specifics of your implementation.
45
+
The name after `allegro[/atom]` is attempted extracted from the dictionary that the Allegro model returns. The following number is the number of elements after flattening the output. In the examples above, polarization is a 3-element global vector, while polarizability and Born charges are global and per-atom 3x3 matrices, respectively.
46
+
47
+
For per-atom quantities, the second number is a 1/0 flag indicating whether the properties should be reverse-communicated "Newton-style" like forces, which will depend on your property and the specifics of your implementation.
48
+
46
49
47
50
*Note: For extracting multiple quantities, simply use multiple commands. The properties will be extracted from the same dictionary, without any recomputation.*
48
51
49
-
*Note: The quantities will be attempted extracted at every timestep. In the future, we may add support for passing a flag to the model indicating that the "custom" output should be computed.*
52
+
*Note: The group flag should generally be `all`.*
50
53
51
-
*Note: The group flag shoul generally be `all`.*
54
+
*Note: Global quantities are assumed extensive and summed across MPI ranks. Keep ghost atoms in mind when trying to think of whether this works for your property; for example, it does not work for Allegro's global energy if there are non-zero energy shifts, as these are also applied to ghost atoms.*
(`--depth1` prevents the entire history of the LAMMPS repository from being downloaded.)
63
+
(`--depth=1` prevents the entire history of the LAMMPS repository from being downloaded.)
61
64
62
65
### Download this repository
63
66
```bash
@@ -108,8 +111,8 @@ Note that the CUDA that comes with PyTorch when installed with `conda` (the `cud
108
111
#### With OpenMP (optional, better performance)
109
112
`pair_allegro` supports the use of OpenMP to accelerate certain parts of the pair style, by setting `OMP_NUM_THREADS` and using the [LAMMPS OpenMP package](https://docs.lammps.org/Speed_omp.html).
110
113
111
-
#### With Kokkos (GPU, optional, best performance)
112
-
`pair_allegro` supports the use of Kokkos to accelerate certain parts of the pair style on the GPU to avoid host-GPU transfers.
114
+
#### With Kokkos (GPU, optional, best performance, most reliable)
115
+
`pair_allegro` supports the use of Kokkos to accelerate the pair style on the GPU and avoid host-GPU transfers.
113
116
`pair_allegro` supports two setups for Kokkos: pair_style and model both on CPU, or both on GPU. Please ensure you build LAMMPS with the appropriate Kokkos backends enabled for your usecase. For example, to use CUDA GPUs, add:
114
117
```
115
118
-DPKG_KOKKOS=ON -DKokkos_ENABLE_CUDA=ON
@@ -146,4 +149,4 @@ This gives `lammps/build/lmp`, which can be run as usual with `/path/to/lmp -in
146
149
Exception: Argument passed to at() was not in the map
147
150
```
148
151
149
-
A: We now require models to have been trained with stress support, which is achieved by replacing `ForceOutput` with `StressForceOutput` in the training configuration. Note that you do not need to train on stress (though it may improve your potential, assuming your stress data is correct and converged). If you desperately wish to keep using a model without stress output, you can remove lines that look like [these](https://github.com/mir-group/pair_allegro/blob/99036043e74376ac52993b5323f193dee3f4f401/pair_allegro_kokkos.cpp#L332-L343) in your version of `pair_allegro[_kokkos].cpp`.
152
+
A: We now require models to have been trained with stress support, which is achieved by replacing `ForceOutput` with `StressForceOutput` in the training configuration. Note that you do not need to train on stress (though it may improve your potential, assuming your stress data is correct and converged). If you desperately wish to keep using a model without stress output, there are two options: 1) Remove lines that look like [these](https://github.com/mir-group/pair_allegro/blob/99036043e74376ac52993b5323f193dee3f4f401/pair_allegro_kokkos.cpp#L332-L343) in your version of `pair_allegro[_kokkos].cpp` 2) Redeploy the model with an updated config file, as described [here](https://github.com/mir-group/nequip/issues/69#issuecomment-1129273665).
0 commit comments