Skip to content

Jl/v3 - #814

Merged
jnsLs merged 5 commits into
v3from
jl/v3
Oct 27, 2026
Merged

Jl/v3#814
jnsLs merged 5 commits into
v3from
jl/v3

Conversation

@jnsLs

@jnsLs jnsLs commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

jnsLs and others added 5 commits October 26, 2026 17:49
spkdeploy compiles a potential with the make_fx tracer of CompiledPotential,
torch.export and AOTInductor into a package for the LAMMPS pair style, which
is rewritten next to load it.

- model.compile: trace(), the make_fx core of CompiledPotential, shared by
  CompiledPotential and deploy
- interfaces.lammps_interface: LammpsPotential (flat tensors with a local mask
  for ghost atoms; energy, per-atom energies, forces and edge virial) and
  deploy_lammps (trace, export, AOTI package with metadata, checked against
  eager before it is written)
- spkdeploy moved into schnetpack.cli; cli_scripts removed
- SO3net and PaiNN created tensors in float32 in float64 models; SO3net's
  float32 sqrt(0.5) caused the ~2e-8 deviation of its float64 package
- tests: parity with the model, domains with ghost atoms adding up to the
  periodic system, rejected models, packages and spkdeploy (slow)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pair_style schnetpack loads the packages spkdeploy writes with
AOTIModelPackageLoader instead of TorchScript, and runs on any number of
MPI ranks.

- schnetpack_model.{h,cpp}: loads and runs a package, independent of
  LAMMPS; checks its metadata and torch version, picks the GPU per rank on
  a node; keeps torch headers out of style_pair.h
- pair_schnetpack: ghost atoms as graph nodes with a local mask (newton pair
  on, ghost cutoff raised to the receptive field plus skin), or
  no_domain_decomposition on one rank with periodic shifts; per-atom
  energies and the virial from the model
- built as a LAMMPS plugin (CMakeLists.txt, C++20 for torch >= 2.14), or
  into LAMMPS with patch_lammps.sh
- tests/model_check.cpp, run by a slow test against Python; deploy_lammps
  compiles into a temporary directory next to the package
- how-to and aspirin example updated; not yet run in LAMMPS
- schnetpack[compile] extra for torch >= 2.14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lammps_check.py deploys a random PaiNN potential and compares LAMMPS to
Python: energy, per-atom energies, forces and virial with domain
decomposition on 1, 2 and 4 ranks and with no_domain_decomposition, NVE
trajectories across these setups, and an NPT run. Runs that hang are
killed after --timeout.

The LAMMPS workflow builds LAMMPS with the pair style as a plugin and
patched in, and runs the check on CPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jnsLs
jnsLs merged commit e91052e into v3 Oct 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant