fix(lammps): expose Kokkos pair style through plugin - #5980
Draft
njzjz-bot wants to merge 5 commits into
Draft
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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