Conversation
Agent: ChatGPT Model: GPT-5.6 Sol
Agent: ChatGPT Model: GPT-5.6 Sol
Agent: ChatGPT Model: GPT-5.6 Sol
Agent: ChatGPT Model: GPT-5.6 Sol
Agent: ChatGPT Model: GPT-5.6 Sol
njzjz-bot
left a comment
There was a problem hiding this comment.
Reviewed this draft against current master. The original Kokkos plugin-registration portion has since landed in a more complete form via #5988, and the Kokkos runtime-linking assumptions in this old branch were superseded by #5989. Current master registers all six Kokkos aliases (deepmd/kk, /device, /host, and the DPA4Spin counterparts) and deliberately avoids linking a second Kokkos::kokkos runtime into the plugin because that can create a duplicate CUDA/Kokkos runtime and corrupt plugin shutdown.
That means this branch should not be merged or rebased wholesale. The only concept here that is not currently present on master is the Python build-backend DP_ENABLE_LAMMPS_KOKKOS environment toggle/tests. If that toggle is still wanted, it should be split/reimplemented narrowly on current master and validated against the now-shared-runtime CMake path rather than carrying forward this branch's old CMake/plugin code. The branch is also currently non-mergeable and its historical Test Python workflow is red.
I left one inline note at the obsolete Kokkos compilation/linkage area. Because this is still a draft (and the executing account is also the PR author), no APPROVE/REQUEST_CHANGES disposition is submitted.
Agent: ChatGPT
Model: GPT-5.6 Sol
GitHub account: njzjz-bot
Reviewed head: 0f8e3bb
Trigger: scheduled all-PR monitoring
| target_compile_definitions(${libname} PRIVATE LMP_KOKKOS) | ||
| target_include_directories(${libname} PRIVATE ${LAMMPS_HEADER_DIR}/KOKKOS) | ||
| target_link_libraries(${libname} PUBLIC Kokkos::kokkos) | ||
| kokkos_compilation(TARGET ${libname}) |
There was a problem hiding this comment.
This build path is obsolete relative to current master. The surrounding branch still links Kokkos::kokkos directly, but merged #5989 replaced that with imported compile/interface properties specifically because a runtime LAMMPS plugin must share liblammps' Kokkos runtime; linking another Kokkos runtime can create a second CUDA/Kokkos instance and corrupt shutdown. Do not carry this kokkos_compilation() hunk forward by rebasing the old CMake block. If the Python DP_ENABLE_LAMMPS_KOKKOS toggle is still desired, apply only that narrow frontend change on top of the current shared-runtime CMake implementation and validate a real plugin build there.
Agent: ChatGPT
Model: GPT-5.6 Sol
GitHub account: njzjz-bot
Reviewed head: 0f8e3bb
Trigger: scheduled all-PR monitoring
Summary
deepmd/kkanddeepmd/kk/devicefrom the dynamic LAMMPS plugin when it is built withDEEPMD_LAMMPS_KOKKOS=ONDP_ENABLE_LAMMPS_KOKKOS=1through the Python build backend so wheel builds can request the existing CMake optionWhy
The Kokkos pair style is already implemented and the plugin CMake target already has a
DEEPMD_LAMMPS_KOKKOSoption, butdeepmdplugin.cppcurrently does not register the Kokkos pair style. As a result, compiling those sources into the module is not sufficient forpair_style deepmd/kkto become available through the dynamic plugin.This PR provides the prerequisite wiring needed before enabling Kokkos in PyPI wheel builds.
PyPI / CUDA architecture investigation
The requested distribution target was a small representative CUDA set (
sm_70,sm_89,sm_120plus acompute_80PTX fallback). I did not turn that set on in the release wheel in this PR because the current packaging stack needs additional coordination with the PyPI LAMMPS host:VOLTA70 + ADA89 + BLACKWELL120in the same way as an ordinary CUDA fatbin.stable_22Jul2025_update2for the wheel plugin headers, and the current PyPIlammpswheel usesstable_22Jul2025_update4; both LAMMPS releases bundle Kokkos 4.6.02. NativeBLACKWELL120support was added in Kokkos 4.7. A newer external Kokkos could be evaluated, but the LAMMPS host and plugin must use a compatible configuration together.lammpswheel is not built withPKG_KOKKOS. Enabling only the DeePMD plugin side would therefore produce a wheel that installs but cannot safely rundeepmd/kkwith the default PyPI LAMMPS host.A safe packaging follow-up is to make the PyPI LAMMPS host Kokkos-enabled with the same Kokkos toolchain as the DeePMD plugin, then determine whether a supported fat-binary strategy is viable or whether matched architecture variants are required. The desired native targets remain Volta70, Ada89 (including RTX 4090), and Blackwell120, with
compute_80PTX considered as a forward-compatibility fallback rather than a substitute for Kokkos's architecture configuration.Validation
DP_ENABLE_LAMMPS_KOKKOSkokkos_compilation(TARGET ...)for downstream CUDA compilationAgent: ChatGPT
Model: GPT-5.6 Sol