Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature Request] Reduce host graph preparation overhead for compressed DPA4C in ordinary LAMMPS

オープン
#6,050 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, pytorch

調査の方向性

Start with source/api_cc/src/DeepPotPTExpt.cc and source/api_cc/include/graph_assembly.h to trace the ordinary path’s assembleGraph and compactCanonicalGraph work; compare the device-side construction in source/lmp/pair_deepmd_kokkos.cpp. Run the supplied ordinary-versus-Kokkos benchmark and verify correctness, including exclusions and ghost mapping. Done means reducing host assembly and transfer overhead for CUDA canonical artifacts without changing the ordinary LAMMPS API or results.

索引モデルが issue の本文から書いたものです。

説明

Summary

Reduce per-step host graph construction and CPU-to-GPU transfers when ordinary LAMMPS pair_style deepmd evaluates a compressed DPA4C canonical .pt2 model on CUDA.

The gap relative to deepmd/kk grows with atom count even when running strictly serially with 24 physical CPU cores assigned to one GPU. Kokkos is an effective production path; this issue tracks a future optimization of the ordinary LAMMPS path. No correctness failure was observed.

Detailed Description

Both LAMMPS modes used the same compressed DPA4C Air model, executable and DeePMD runtime. Each measurement ran alone on GPU 0 with physical CPU cores 0–23; no concurrent benchmark jobs were running.

  • NVIDIA RTX PRO 6000 Blackwell Server Edition.
  • Intel Xeon Platinum 8558P; 24 physical cores local to the GPU.
  • LAMMPS 4 Jul 2026, Kokkos 5.1.99, PyTorch 2.13.0+cu130.
  • One MPI rank; ordinary LAMMPS uses 24 OpenMP threads. Kokkos uses its GPU execution space and one LAMMPS host thread, with the same CPU-core allocation.
  • DPA4C Air compressed float32 canonical artifact, lower_input_kind=dpa4c_canonical.
  • Periodic diamond carbon, lattice constant 3.567 Å, small Gaussian positional perturbations, initial temperature 300 K.
  • NVE, 1 fs timestep, 20 warmup steps followed by 100 measured steps.
  • Three independent runs per configuration; the table reports medians.
  • Throughput is atoms divided by complete MD seconds per step. Export, compression, loading and warmup are excluded.
Path 512 atoms 3,136 atoms 9,680 atoms 49,248 atoms
Ordinary LAMMPS, compressed 310,375 794,813 927,621 753,016
Kokkos LAMMPS, compressed 585,428 2,836,777 4,239,738 6,439,693

All values are in atoms/s.

An additional instrumented run at 49,248 atoms and 24 CPU cores measured the following approximate shares within the DeePMD C++ call:

Stage Share
CPU graph filtering, filling and source CSR construction 38%
Main graph payload CPU-to-GPU transfers 45%
Exported model execution 12%
Other preparation and output handling 5%

The graph contains about 13.49 million skin candidates and 7.78 million active edges. The main edge/index/CSR arrays transferred each step total approximately 275 MiB, calculated from the recorded graph sizes and tensor dtypes. There were no LAMMPS neighbor-list rebuilds during the measured 49,248-atom segment. The instrumented run is separate from the throughput measurements above.

The ordinary path calls assembleGraph on the host every step and then compactCanonicalGraph. Its cached skin topology avoids rebuilding the host neighbor list, but does not eliminate per-step CPU graph assembly or edge-sized transfers. The Kokkos path constructs the compact graph on the device and supplies device pointers to canonical inference.

A possible improvement is to retain suitable cached topology on the device and perform cutoff filtering, geometry updates and compact graph preparation there for CUDA canonical artifacts, while preserving exclusions, ghost mapping and the existing ordinary LAMMPS API.

Further Information, Files, and Links

Build provenance: these measurements use a local development build based on upstream 5b9fe0716442b0346336c0242b16d5c464da8162, with local model/kernel changes. The host graph assembly and LAMMPS pair-style files linked below are unchanged from that upstream revision. Absolute model throughput is therefore a development-build measurement; both compared LAMMPS modes use the identical artifact and runtime.

Relevant upstream code:

The relevant runtime controls are:

export CUDA_VISIBLE_DEVICES=0
export OMP_NUM_THREADS=24
export MKL_NUM_THREADS=24
export OPENBLAS_NUM_THREADS=1
export DP_INTRA_OP_PARALLELISM_THREADS=24
export DP_INTER_OP_PARALLELISM_THREADS=1
export DP_TF32_INFER=0

taskset -c 0-23 lmp -in in.lammps
taskset -c 0-23 lmp -k on g 1 -sf kk -pk kokkos neigh full newton off -in in.lammps

Both commands use the same input and compressed model:

units metal
boundary p p p
atom_style atomic
atom_modify map yes sort 0 0.0
read_data diamond.data
pair_style deepmd compressed.pt2
pair_coeff * * C
neighbor 1.0 bin
neigh_modify every 1 delay 0 check yes
fix integrate all nve
timestep 0.001
thermo 100
run 20
run 100

The data file includes the shared initial velocities. Initial energy, force and stress comparisons passed; the maximum initial force difference across the measured paths was about 1.63e-5 eV/Å.

Related: #5595 covers an earlier DPA4 host-marshalling report. This follow-up concerns the current compressed DPA4C canonical path and its assembleGraph / compactCanonicalGraph preparation.

主要言語
Python
スター
2.1k
フォーク
659
平均マージ
4日 2時間
マージ済み PR(30日)
6

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepmodeling/deepmd-kit のほかの issue

deepmodeling/deepmd-kit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。