Skip to content

fix(lammps): register Kokkos plugin styles - #5988

Open
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/lammps-kokkos-plugin-registration
Open

fix(lammps): register Kokkos plugin styles#5988
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/lammps-kokkos-plugin-registration

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport 0004-register-lammps-kokkos-plugin-styles.patch from conda-forge/deepmd-kit-feedstock@d02138263b0b30629fe28c68c8bcecc2b8644513.

Runtime LAMMPS plugins do not consume the PairStyle declarations used by the built-in package machinery, so explicitly register:

  • deepmd/kk
  • deepmd/kk/device
  • deepmd/kk/host
  • dpa4spin/kk
  • dpa4spin/kk/device
  • dpa4spin/kk/host

The newly registered Kokkos plugin styles are attributed to Tiancheng Li via plugin.author.

Validation

  • Single-file change derived from the feedstock patch, with only the requested author attribution adjusted.
  • Existing non-Kokkos plugin author fields are unchanged.
  • Split from fix: backport conda-forge build fixes #5985 so plugin registration can be reviewed independently.
  • Full build/runtime validation is left to upstream CI.

Agent: ChatGPT
Model: GPT-5.6 Sol

Summary by CodeRabbit

  • New Features
    • Added Kokkos-enabled support for DeepMD and DPA-4Spin pair styles.
    • Added host and device runtime variants for improved compatibility across supported execution environments.
    • Registered additional pair-style aliases so these implementations can be selected through standard runtime configuration.

Backport conda-forge/deepmd-kit-feedstock patch 0004 at d02138263b0b30629fe28c68c8bcecc2b8644513, with the new Kokkos plugin registrations attributed to Tiancheng Li.

Agent: ChatGPT
Model: GPT-5.6 Sol
@njzjz
njzjz marked this pull request as ready for review August 22, 2026 19:17
Copilot AI lite review requested due to automatic review settings August 22, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@njzjz
njzjz requested a review from OutisLi August 22, 2026 19:17
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70ef292e-6138-43b6-9413-dbb9dfc619ef

📥 Commits

Reviewing files that changed from the base of the PR and between 8cfd46e and b9c4d8c.

📒 Files selected for processing (1)
  • source/lmp/plugin/deepmdplugin.cpp

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The plugin now includes Kokkos pair implementations, defines host and device factories, and registers Kokkos aliases for the deepmd and dpa4spin pair styles when Kokkos is enabled.

Changes

Kokkos pair-style integration

Layer / File(s) Summary
Kokkos headers and factories
source/lmp/plugin/deepmdplugin.cpp
The plugin conditionally includes Kokkos pair headers and defines host and device factories for PairDeepMDKokkos and PairDPA4SpinKokkos.
Runtime alias registration
source/lmp/plugin/deepmdplugin.cpp
The plugin registers deepmd/kk, deepmd/kk/device, deepmd/kk/host, dpa4spin/kk, dpa4spin/kk/device, and dpa4spin/kk/host.

Estimated code review effort: 3 (Moderate) | ~15 minutes

Merge Risk: ⚪ Minimal · up to b9c4d

This localized change registers the listed Kokkos plugin styles without any identified merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: registering LAMMPS Kokkos plugin styles.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.84%. Comparing base (8cfd46e) to head (b9c4d8c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5988      +/-   ##
==========================================
- Coverage   79.10%   78.84%   -0.26%     
==========================================
  Files        1105     1105              
  Lines      130981   130979       -2     
  Branches     4771     4771              
==========================================
- Hits       103609   103273     -336     
- Misses      25686    26022     +336     
+ Partials     1686     1684       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OutisLi OutisLi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The registration mapping itself looks correct, but this PR has runtime/build dependencies that should be explicit before merge. The upstream workflows never enable DEEPMD_LAMMPS_KOKKOS, so the new #ifdef LMP_KOKKOS block is not compiled there. The successful feedstock validation applied patches 0002, 0004, and 0005 together: #5987 supplies compatibility with the documented stable_22Jul2025 API, while #5989 removes the duplicate Kokkos runtime that its own description notes can corrupt shutdown when the plugin unloads. Please ensure the corrected #5987 and #5989 are merged before #5988 (or stack this PR on them), and validate an enabled Kokkos-plugin build plus plugin list; otherwise the aliases become discoverable while the corresponding plugin path remains known-unsafe and the upstream green checks do not exercise it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants