DOI: 10.5281/zenodo.17956942
title: A Kokkos-Accelerated Moment Tensor Potential Implementation for LAMMPS

description: A Kokkos-Accelerated Moment Tensor Potential Implementation for LAMMPS: Data and Example Scripts

The data/ folder contains the benchmark data. The benchmarking was conducted on a block of unstrained BCC potassium under NVE conditions with a 1-femtosecond timestep for 100 timesteps. The active learning benchmarking that evaluates multiple species also uses pure potassium simulations; this does not affect the measured rates. The training dataset used to train all the potentials is relatively simplistic, which may limit the potentials' prediction accuracy outside of this benchmark. Default hyperparameters and cutoff distances were applied, resulting in a comparatively low number of neighbors per neighborhood. The performance is known to vary significantly with the material and the number of neighbors per neighborhood (cutoff distance).

Data File Explanations

data/inference.lmpThis is the script used to run the inference simulations used to generate the benchmark data in potassium. It includes example invocations for all three variants: CPU, thread-parallel, and block parallel. To generate the results, the script was wrapped into a Python script which automated the test runs sequentially. MLIP-3 invocations are not included. This script relates to Figures 1 and 2.

data/active_learning.lmpThis is the script used to run the active learning simulations used to generate the benchmark data in potassium. It includes example invocations for all three variants: CPU, thread-parallel, and block parallel. To generate the results, the script was wrapped into a Python script which automated the test runs sequentially. MLIP-3 invocations are not included. This script relates to Figure 3.

Data Folder Explanations

data/active_learning/This directory contains CSV result files produced by active-learning benchmark runs. The naming pattern is method-hardware.csv (examples: gpu-1.csv, mtp-32core.csv, mlip3-1core.csv). The results cover 1 to 64 AMD EPYC 7532 cores, 1 to 4 A100s (40GB), all active learning variants, configuration and neighborhood modes, and 1, 2, and 3 species. Each CSV contains the run number, atom count, MTP level, species count, active learning mode, nanoseconds per day, hours per nanosecond, timesteps per second, atom steps per second, and elapsed time. These results relate to Figure 3.

data/active_learning_plotting/This folder contains plotting scripts and generated figures for active learning results. It includes data/active_learning_plotting/plot.py, which generates Figure 3 as a PDF. It also contains copies of the CSV files from data/active_learning/ for convenience.

data/active_learning_potentials/This directory contains the MTP potential files with active learning data, compatible with MLIP packages and this implementation. The naming pattern is LL_trainX_cfg.almtp and LL_trainX_nbh.almtp, where LL is the level (e.g., 06, 28), X indicates the number of species, and the suffix indicates either configuration or neighborhood active learning mode. These files were used during the scripting of data/active_learning.lmp to generate the results in data/active_learning/.

data/inference/This folder contains CSV result files produced by inference benchmark runs and plotting scripts. It includes data/inference/plot.py (which generates Figure 1) and data/inference/speedup.py (which generates Figure 2). The CSV naming pattern follows method-hardware.csv. The results cover 1 to 64 AMD EPYC 7532 cores, 1 to 4 A100s, and all inference variants. Each CSV contains performance metrics such as nanoseconds per day and atom steps per second.

data/potentials/This directory contains the MTP potential files (e.g., 06.almtp, 08.almtp) compatible with MLIP packages and this implementation. These were used during the scripting of data/inference.lmp to generate the results in data/inference/.

data/profiling/This folder contains performance profiling data.





data/profiling/block_parallel_ncu/ and data/profiling/thread_parallel_ncu/ contain the raw output of the Nsight Compute kernel profiling of a single timestep.




data/profiling/block_parallel_nsys/ and data/profiling/thread_parallel_nsys/ contain the raw output of the Nsight Systems GPU traces.




data/profiling/cpu_perf/ contains the outputs of the perf profiling, including raw output (perf.dat) and text summaries (profile.txt). Note that different sampling rates may be used for file size management.



Reproducibility of Data Figures

To reproduce the figures in the main body of the manuscript, you need data. If you simply want to plot the figures with the existing data, you can run the plotting scripts. Python, Matplotlib, NumPy, and Seaborn are required. If you want to generate your own data, you will need to adapt data/inference.lmp and data/active_learning.lmp into an automation framework, perform the benchmarking, and save the results into the correct format.





Figure 1 (Inference Performance): Use data/inference/plot.py with the CSVs located in data/inference/. To generate data, iteratively invoke data/inference.lmp with different hardware counts and methods.




Figure 2 (Inference Speedups Over MLIP-3): Use data/inference/speedup.py with the CSVs located in data/inference/.




Figure 3 (Active Learning Speedup Over MLIP-3): Use data/active_learning_plotting/speedup.py with CSVs in data/active_learning/ and the small example CSVs inside data/active_learning_plotting/. To generate data, iteratively invoke data/active_learning.lmp.



Illustrative Examples' LAMMPS Scripts

The example_scripts/ folder contains example LAMMPS scripts and the potentials that were used to run them. An example SLURM submission script, example_scripts/example.qsub, is included; this is roughly what was used to run the illustrative examples. Notably, these runs were intended as examples, not production simulations with serious predictions, and these potentials were not necessarily validated in these particular use cases. The LAMMPS scripts may require modifications to run on your system. MLIP-3 invocations are not included.

Example File Explanations

example_scripts/lammps_script/al_nanocrystal_deform.lmpRuns an uniaxial deformation on a prepared (relaxed) nanocrystal using thread-parallel GPU inference (mtp/kk). It does not include the preparation of the nanocrystal. This relates to Illustrative Example 2.

example_scripts/lammps_script/interface.datNaK interface LAMMPS data file containing BCC, C14 Laves, and Liquid phases. This relates to Illustrative Example 3.

example_scripts/lammps_script/nak_interface.lmpLoads example_scripts/lammps_script/interface.dat and runs with mtp/extrapolation/small/kk in a coexistence simulation with active learning enabled. The script's extrapolation grade thresholds are tuned to avoid selections and writing files which may affect the accuracy of the performance comparison. This relates to Illustrative Example 3.

example_scripts/lammps_script/screw.datSilicon screw dislocation LAMMPS data file. This relates to Illustrative Example 1.

example_scripts/lammps_script/si_dislocation.lmpLoads example_scripts/lammps_script/screw.dat and runs a shear deformation using block-parallel GPU inference (mtp/small/kk). This relates to Illustrative Example 1.

example_scripts/potentials/Contains the MTP potential files used by the LAMMPS scripts. These are example potentials and should be validated for your specific use case before production runs.





example_scripts/potentials/al.mtp — MTP 16 used by example_scripts/lammps_script/al_nanocrystal_deform.lmp (Illustrative Example 2).




example_scripts/potentials/nak.almtp — MTP 18 used by example_scripts/lammps_script/nak_interface.lmp (Illustrative Example 3).




example_scripts/potentials/si.mtp — MTP 26 used by example_scripts/lammps_script/si_dislocation.lmp (Illustrative Example 1).



example_scripts/example.qsubExample SLURM job script configured for a 4-GPU run. It loads compilers and CUDA modules, then launches a Kokkos-enabled MPI GPU run. This relates to Illustrative Examples 1, 2, and 3.

Reproducibility of Examples

You may need to modify the scripts to ensure they work with your system and your file paths.





Illustrative Example 1 (Silicon Dislocation): Use the LAMMPS script example_scripts/lammps_script/si_dislocation.lmp and the potential file example_scripts/potentials/si.mtp. Modify example_scripts/example.qsub with correct job submission parameters and file paths, then submit it to SLURM.




Illustrative Example 2 (Nanocrystalline Aluminum Tension): Use the LAMMPS script example_scripts/lammps_script/al_nanocrystal_deform.lmp and the potential file example_scripts/potentials/al.mtp. Note that the input data file is not provided and must be generated yourself using Atomsk to create a polycrystal. Run and equilibrate in NPT and use write_data to save the simulation. Because MTP forces are often divergent at small pair distances, you may need to run an EAM potential briefly before equilibrating with the MTP. Modify example_scripts/example.qsub and submit.




Illustrative Example 3 (Sodium-Potassium Interface Active Learning): Use the LAMMPS script example_scripts/lammps_script/nak_interface.lmp and the potential file example_scripts/potentials/nak.almtp. Modify example_scripts/example.qsub with correct job submission parameters and file paths, then submit it to SLURM.