Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#6,050 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Stack tecnológico
cpp, pytorch

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:

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

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de deepmodeling/deepmd-kit

Todos los issues de deepmodeling/deepmd-kit

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.