Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#6,050 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, pytorch

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
2.1k
Fork
659
Merge medio
4g 2h
PR unite (30g)
6

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di deepmodeling/deepmd-kit

Tutte le issue di deepmodeling/deepmd-kit

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.