[Feature Request] Reduce host graph preparation overhead for compressed DPA4C in ordinary LAMMPS
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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:
- Ordinary graph assembly and canonical dispatch
- Host graph assembly and transfers
- Kokkos compact graph construction and device inference
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.
- Lenguaje dominante
- Python
- Estrellas
- 2.1k
- Forks
- 659
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 6
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de deepmodeling/deepmd-kit
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
deepmodeling/deepmd-kit#6038 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Docs enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
deepmodeling/deepmd-kit#5766 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
[Code scan] Symmetrize ASE calculator stress after reshaping virialPosiblemente ocupada @njzjz la tomó hace 93 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
deepmodeling/deepmd-kit#5689 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
[Code scan] Freeze Paddle DPA3 parameters with stop_gradientPosiblemente ocupada @njzjz la tomó hace 93 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepmodeling/deepmd-kit#5686 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
branch: master lang: py todo comment type: todo
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
deepmodeling/deepmd-kit#5480 ·
Los mantenedores suelen responder en 3 días
Todos los issues de deepmodeling/deepmd-kit
Issues similares
-
area:core-platform effort:S priority:P3 status:in-review type:test
Dificultad 2/5 Menos de una hora Aptitud para principiantes 80/100
randomparity/kdive#3246 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massAbiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
nf-core/metaboigniter#130 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
common-workflow-language/cwl-utils#477 ·
Los mantenedores suelen responder en 1 día
-
Add dependabotAbiertofeat
Dificultad 2/5 Menos de una hora Aptitud para principiantes 72/100
open-nudge/opentemplate#204 ·
Los mantenedores suelen responder en 1 día
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limitPosiblemente ocupada @VascoSch92 la tomó hoy. Abiertopriority:medium ready-for-dev
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenHands/extensions#781 ·
Los mantenedores suelen responder en 1 día