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

Kokkos multispecies acceleration with type-sorting and matrix-matrix products #310

Merged
merged 12 commits into from
Jun 16, 2022

Conversation

anjohan
Copy link
Collaborator

@anjohan anjohan commented Jun 16, 2022

This PR accelerates the LAMMPS plugin on GPUs by sorting the atoms by their type, allowing for the atom-wise matrix-vector products to be replaced with per-type matrix-matrix products, for which we now use KokkosKernels.

KokkosKernels will automatically be downloaded using FetchContent, the user should hopefully not notice any change to the installation procedure.

The neighborlist requests are now compatible with the newest version of LAMMPS, which requires a small ASE patch (added to the GitHub Action) and to use half neighbor lists when running the Tersoff potential with Kokkos (changed in unit test).

Some whitespace/formatting happened.

@anjohan anjohan requested a review from YuuuXie June 16, 2022 18:36
Copy link
Collaborator

@YuuuXie YuuuXie left a comment

Choose a reason for hiding this comment

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

Looks great! I left two comments (which might take a bit time)

And here are another two minor ones:

  1. you can update the version number to 1.2.0 in _version.py (the current development branch is 1.1.2)
  2. you can add a trillion simulation image to our gallery: https://github.com/mir-group/flare/blob/gemm/docs/source/related.rst

@@ -39,4 +39,21 @@ target_sources(lammps PRIVATE
${LAMMPS_SOURCE_DIR}/radial.cpp
${LAMMPS_SOURCE_DIR}/y_grad.cpp
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In line 17 (somehow I can not comment there...), we skipped the pair mgp. I remember it is because some syntax is not updated with the latest lammps. Could you check and fix that?

And correspondingly the unit tests in test_lammps.py (line 38 and 146) skip the mgp-kokkos tests, which after the fix we should resume.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think mgp/kk has had issues longer, I can look at that separately.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, that also works. I thought it would be just simple syntax fixing. But we can do it separately

Kokkos::parallel_for("FLARE: B2 norm2 evdwl w",
Kokkos::TeamPolicy<DeviceType, TagNorm2>(batch_size, TEAM_SIZE, vector_length),
*this
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add team::barrier to the code? It is worth testing the large scale long time behavior, to ensure this update will not produce light-speed hydrogens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hope not, without justification other than running this for 8 hours on 8xV100 and not seeing any issues

Copy link
Collaborator

Choose a reason for hiding this comment

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

for now that is sufficient

@anjohan
Copy link
Collaborator Author

anjohan commented Jun 16, 2022

I updated the version and added a reference (hoping the RST will work)

@YuuuXie
Copy link
Collaborator

YuuuXie commented Jun 16, 2022

I updated the version and added a reference (hoping the RST will work)

you can merge after GitHub actions pass

@anjohan anjohan merged commit ef0eca9 into development Jun 16, 2022
@anjohan anjohan deleted the gemm branch June 16, 2022 20:11
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.

2 participants