pair_style deepmd/kk does not populate global virial / thermo pressure for a DPA4 pt_expt model
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
source/lmp/pair_deepmd_kokkos.cpp から始め、グローバル virial の reduction 条件を source/lmp/pair_deepmd.cpp と比較し、vflag_global と vflag の違いに注目してください。変換済みモデルを使って添付された最小限の quartz input を実行し、pair_style deepmd/kk と pair_style deepmd を比較してください。thermo Press、Pxx、Pyy、Pzz にゼロではない virial が含まれ、per-atom virial および非 Kokkos の結果と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug summary
When using a converted DPA4 pt_expt model with LAMMPS, pair_style deepmd/kk produces correct per-atom virials but fails to populate the global virial used by LAMMPS thermo pressure. As a result, Press, Pxx, Pyy, and Pzz contain only the kinetic contribution; at zero velocity they are exactly zero.
The same structure and model work correctly with the non-Kokkos path, pair_style deepmd.
This is important for NPT simulations: the barostat receives an incorrect pressure signal, which can cause unphysical cell evolution.
DeePMD-kit Version
Source checkout at commit 14a71f13
Backend and its version
PyTorch 2.11.0+cu126 (CUDA 12.6)
How did you download the software?
Built from source
Input Files, Running Commands, Error Log, etc.
Environment
-
LAMMPS:
patch_4Jul2026(LAMMPS (4 Jul 2026)) -
GPU: NVIDIA A40
-
CUDA: 12.6
-
DeePMD-kit was built from source at commit
14a71f13. -
The DPA4 model was converted with:
dp convert-backend --atomic-virial DPA4-Pro-MPtrj.pt DPA4-Pro-converted.pt2
Minimal test
The same relaxed alpha-quartz SiO2 structure was evaluated with zero velocities and run 0.
Input:
read_data quartz_dpa_relaxed.lmp
mass 1 28.0855
mass 2 15.9994
pair_style deepmd/kk DPA4-Pro-converted.pt2
pair_coeff * * Si O
compute stress all centroid/stress/atom NULL virial
thermo_style custom step temp press pxx pyy pzz
run 0
Observed behavior
With pair_style deepmd/kk, thermo output is exactly zero at zero velocity:
Press = 0
Pxx = 0
Pyy = 0
Pzz = 0
However, compute centroid/stress/atom returns nonzero per-atom virials. Their sum agrees with an independent ASE stress calculation within approximately 0.1%.
For the same structure and converted model, replacing only:
pair_style deepmd/kk DPA4-Pro-converted.pt2
with:
pair_style deepmd DPA4-Pro-converted.pt2
produces nonzero thermo pressure/stress consistent with both ASE and the summed per-atom virial.
Therefore, the issue appears specific to the Kokkos path.
Steps to Reproduce
- Convert a DPA4-Pro-MPtrj checkpoint to pt_expt format with:
dp convert-backend --atomic-virial DPA4-Pro-MPtrj.pt DPA4-Pro-converted.pt2 - Build LAMMPS with Kokkos/CUDA support against this DeePMD-kit checkout.
- Run the input below (relaxed alpha-quartz SiO2, 72 atoms) with
pair_style deepmd/kk, using:
lmp -k on g 1 -sf kk -pk kokkos newton on neigh half -in in.lammps - Observe that thermo Press/Pxx/Pyy/Pzz are exactly zero, while
compute centroid/stress/atom still gives correct nonzero per-atom
virials (summed, they agree with an independent ASE calculation
within ~0.1%). - Repeat step 3 with pair_style deepmd (no /kk) instead, changing
nothing else. Thermo pressure/stress becomes correct and nonzero.
Further Information, Files, and Links
Source-level observation:
source/lmp/pair_deepmd.cppperforms the explicit global-virial reduction underif (vflag).source/lmp/pair_deepmd_kokkos.cppperforms the corresponding reduction underif (vflag_global).
In the failing reproduction,vflagis nonzero (10when the per-atom virial compute is requested), whereasvflag_global = 0. Therefore, the explicit Kokkos reduction is skipped. The per-atom virial buffer is nevertheless nonzero and agrees with the non-Kokkos result; the LAMMPS globalvirial[]/ thermo pressure remains zero.
I have attached a zip archive containing the minimal structure, the two LAMMPS input files, the two comparison logs, and a README. The converted model is not included because it is large; it can be regenerated from the DPA4-Pro-MPtrj checkpoint using the conversion command given above.
TheDEBUG_VFLAGlines in the attached logs were added locally for diagnosis and are not part of the upstream DeePMD-kit output.
- 主要言語
- Python
- スター
- 2.1k
- フォーク
- 654
- 平均マージ
- 3日 10時間
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
deepmodeling/deepmd-kit のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
deepmodeling/deepmd-kit#6038 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepmodeling/deepmd-kit#5991 ·
メンテナーはふだん 4 日以内に返信
-
Docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
deepmodeling/deepmd-kit#5766 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
deepmodeling/deepmd-kit#5689 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepmodeling/deepmd-kit#5686 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
deepmodeling/deepmd-kit の issue をすべて見る
似ている issue
-
repo-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scverse/repo-health#20 ·
メンテナーはふだん 1 日以内に返信
-
/context/prime scope override double-prefixes an entity-ref project and drops its scoped memoriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
phasespace-labs/palinode#232 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
collective/icalendar#1858 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langflow-ai/langflow#15496 ·
メンテナーはふだん 1 日以内に返信