Skip to content

Update Kokkos library in LAMMPS to v4.1.0#3670

Merged
akohlmey merged 29 commits intolammps:developfrom
stanmoore1:kk_update_4.0
Aug 3, 2023
Merged

Update Kokkos library in LAMMPS to v4.1.0#3670
akohlmey merged 29 commits intolammps:developfrom
stanmoore1:kk_update_4.0

Conversation

@stanmoore1
Copy link
Copy Markdown
Contributor

@stanmoore1 stanmoore1 commented Mar 3, 2023

Summary

Update Kokkos library in LAMMPS to v4.1.0
NOTE: Requires C++17

Related Issue(s)

None

Author(s)

Stan Moore (SNL), Kokkos developers

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

Yes

@stanmoore1
Copy link
Copy Markdown
Contributor Author

stanmoore1 commented Mar 3, 2023

Note: here is a list of minimum compiler versions for Kokkos 4.0: kokkos/kokkos#5285 (comment)

@stanmoore1
Copy link
Copy Markdown
Contributor Author

Kokkos regression tests passed. Need to check performance.

@rbberger rbberger added test_runs Enable to trigger run tests test_for_regression Enable to trigger regression tests gpu_unit_tests Enable to trigger GPU unit tests labels Mar 3, 2023
Copy link
Copy Markdown
Member

@rbberger rbberger left a comment

Choose a reason for hiding this comment

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

The CMake changes look fine to me.

@opoplawski
Copy link
Copy Markdown

Any progress here? Fedora Rawhide has updated kokkos to 4.0 and now the lammps builds are failing. A new release would be very helpful. Thanks.

@akohlmey akohlmey removed test_runs Enable to trigger run tests test_for_regression Enable to trigger regression tests gpu_unit_tests Enable to trigger GPU unit tests labels Mar 21, 2023
@stanmoore1
Copy link
Copy Markdown
Contributor Author

@opoplawski I think #3701 will address the issue you are seeing, can you confirm?

@stanmoore1
Copy link
Copy Markdown
Contributor Author

@akohlmey it looks like the run test failure is unrelated to this PR?

@stanmoore1
Copy link
Copy Markdown
Contributor Author

Since this PR requires c++17, we are planning to wait until after the next stable release to merge this, to maximize backwards compatibility. Deprecated code was removed in #3701, which should allow LAMMPS to be compatible with an external Kokkos v4.0.

@akohlmey
Copy link
Copy Markdown
Member

@akohlmey it looks like the run test failure is unrelated to this PR?

That is correct. It is a ripple from the removal of installing the python module from "make install". The run and regression tests depend on it, and the replacement has a race condition when running "make install-python" concurrently from the same source checkout. It took me a while to narrow down where the exact issue is since there were multiple problems that needed changes in multiple places.

@skyreflectedinmirrors
Copy link
Copy Markdown
Collaborator

skyreflectedinmirrors commented Mar 30, 2023

FWIW Stan, I still see a bunch of hash map errors:

lammps/src/KOKKOS/neigh_bond_kokkos.cpp:284:89: error: reference to __host__ function 'dual_hash_type' in __host__ __device__ function
    int atom1 = AtomKokkos::map_kokkos<DeviceType>(bond_atom(i,m),map_style,k_map_array,k_map_hash);
                                                                                        ^
lammps/src/KOKKOS/neigh_bond_kokkos.cpp:1230:16: note: in instantiation of member function 'LAMMPS_NS::NeighBondKokkos<Kokkos::HIP>::operator()' requested here
template class NeighBondKokkos<LMPDeviceType>;
               ^
lammps/src/KOKKOS/kokkos_type.h:511:8: note: 'dual_hash_type' declared here
struct dual_hash_type {
       ^
lammps/src/KOKKOS/neigh_bond_kokkos.cpp:372:89: error: reference to __host__ function 'dual_hash_type' in __host__ __device__ function
    int atom1 = AtomKokkos::map_kokkos<DeviceType>(bond_atom(i,m),map_style,k_map_array,k_map_hash);

when building w/ your branch + Kokkos develop. I think it's because there's still an implicit constructor in the dual_hash_type:

image

that isn't deleted (and therefore defaults to __host__)?

This might be something specific to develop however.

@rbberger
Copy link
Copy Markdown
Member

@stanmoore1 created stanmoore1#16 with some cleanups and a HIP bugfix, which would merge into this PR branch.

@stanmoore1 stanmoore1 changed the title Update Kokkos library in LAMMPS to v4.0 Update Kokkos library in LAMMPS to v4.0.1 Jun 5, 2023
@skyreflectedinmirrors
Copy link
Copy Markdown
Collaborator

Can confirm, this builds w/ the latest kokkos develop on MI-2XX

@stanmoore1 stanmoore1 changed the title Update Kokkos library in LAMMPS to v4.0.1 Update Kokkos library in LAMMPS to v4.1.0 Jun 29, 2023
@stanmoore1 stanmoore1 assigned akohlmey and unassigned stanmoore1 Aug 3, 2023
@stanmoore1
Copy link
Copy Markdown
Contributor Author

@akohlmey would like to get this merged ASAP now that the stable is out.

@akohlmey
Copy link
Copy Markdown
Member

akohlmey commented Aug 3, 2023

@akohlmey would like to get this merged ASAP now that the stable is out.

Yup. I am working through the back log right now.

@akohlmey akohlmey merged commit 794e3d1 into lammps:develop Aug 3, 2023
@stanmoore1 stanmoore1 deleted the kk_update_4.0 branch October 12, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

7 participants