Repository navigation
ace-jax 0.4.0
Highlights. float32 is now a real float32 calculation in LAMMPS bundles
and calculators, and a new page tells you when it is safe. The linear fit can
calculate its design rows in float32 (--row-precision float32). MD runs on
the device with JAX-MD (ace_jax.jaxmd). Larger models use the DAG product
basis automatically. aj fit fits linear ACE by default.
Upgrading from 0.3.0. Saved models are unchanged.
aj fitwithout--m-per-speciesnow fits linear ACE (it was the hybrid
ACE + GP model). Give--m-per-species> 0 for the hybrid model.- A float32 bundle or calculator made with 0.3.0 from a model loaded under
x64 calculated in float64. Export it again for the float32 speed. - Models with 4,000 or more chain-form multiplications per atom use the DAG
product basis. Results agree with 0.3.0 to round-off. Setaa_dag=None
for the 0.3.0 form.
Fixed
- float32 export and calculators calculated in float64. With x64 enabled,
export_lammps(dtype="float32"),aj export --dtype float32and
ACECalculator(dtype=float32)on a model already loaded traced a float64
program. Only the inputs and outputs were float32, so there was no speed-up.
The model is now converted to float32 after the lean form and the splines
are made in float64 (ace_jax.eval.with_dtype). - float32 spline tables lost the precision of their derivatives. Splined
and learned radials and radial tables in float32 had a relative derivative
error of up to 5e-2. The tables are now kept in a local difference form,
made in float64: 8e-7. - The design rows of a fit are calculated at the highest matmul precision.
TF32 on an A100 corrupted float32 force rows.
Changed
- The recursive (DAG) product basis is automatic.
ACECalculatorand
export_lammpsdefault toaa_dag="auto". It uses the DAG for models with
4,000 or more chain-form multiplications per atom, and the chain form for
smaller models. Results below the threshold are unchanged. Larger models run
1.2-2.7x faster on a CPU node and 1.1-1.8x faster on an A100 (linear ACE
o4d20: 2.7x and 1.8x).calc.aa_dagand the bundle'sace_jax.aa_daggive
the form used. Setaa_dag=Nonefor the chain form. aj fitfits linear ACE by default. The default of--m-per-species
is now 0 (it was 500). The hybrid ACE + GP model is experimental. To use
it, give--m-per-species> 0. The GP options (--kernel,--no-bump,
--density,--pca-d,--embedding) without--m-per-species> 0 are
now an error.FitConfigin Python is not changed: setarmexplicitly.
Added
- float32 design rows for the linear fit.
aj fit --row-precision float32(FitConfig.row_precision) calculates the design rows, and on a GPU
the QR merges, in float32. The evidence, the MAP and the posterior stay in
float64. A silicon o4d16 fit took 169 s instead of 265 s on an RTX A4500,
with the RMSE within 1%. The GP arm and--learn-radialrefuse it.
--row-checkis an optional stability check of the result. - The float32 error of a model.
ace_jax.calc.precision.precision_check
compares float32 with float64 on a structure.export_lammps(..., precision_structure=atoms)andaj export --dtype float32 --structure
record it in the bundle and warn above 0.1 meV/atom or a relative force
error of 1e-4. - A new page, "Choose float64 or float32" (
howto/precision), gives the
speed-up by GPU (2.1-4.5x on an RTX A4500, 1.3-1.5x on an A100), the errors,
and which tasks can use float32. Energy line searches fail in float32: use
a force-only optimiser, for example ASEODE12r. - MD with JAX-MD (
ace_jax.jaxmd, the newjaxmdextra).
jaxmd.potentialgives the energy and forces of a model to the
integrators of JAX-MD. The neighbour list, the model and the integrator
then run on the device in one compiled program. The energy is the energy
ofACECalculatorwith the same options.Ksets the slots for each
atom. If an atom has more neighbours thanK, the energy and forces are
NaN, andoverflowtells you. The model runs in blocks of atoms of the
size thatexport_lammpsselects, so the memory is approximately that of a
LAMMPS bundle. See Run MD with JAX-MD. write_yace(model, path, summed=True)writes one A basis for all
neighbour species, as ace-jax evaluates the model. The default writes each
product once for each neighbour species. The summed form has far fewer
products for multi-element models: 849 instead of 15,021 for a
three-element embedded model at order 3. ML-PACE reads it only with the
summed_neighbour_Aaddition. ace-jax does not read summed files.
Testing
- The
pace-parityCI job builds ML-PACE from
jameskermode/lammps-user-pace(ICAMS/lammps-user-pace#31): the
v.2025.12.4.p1release plus tabulated radials, recursive-evaluator
speed-ups andsummed_neighbour_A.
tests/test_pace_mlpace_yace.pyevaluates four multi-element exports with
ML-PACE, expanded and summed, and compares them with ace-jax.
LAMMPS export
- Bundle row blocks are sized to an element target scaled by the memory of
the target GPU. o4d16 runs up to 2.65x faster on an RTX A4500. - lammps-jax is on PyPI. Install it with the new
lammpsextra:
pip install "ace-jax[lammps]". The CI tests the export with lammps-jax
0.2.0. - lammps-jax excludes jaxlib 0.10.2, because its GPU scatter-add is
approximately 4x slower. With thelammpsextra, Python 3.11 gets jax
0.10.1. - The bundle no longer writes
ace_jax.platform. lammps-jax 0.2.0 reads the
platformkey from anywhere in the bundle. Read the platform from
export_info.platform.
Benchmarks
-
The silicon accuracy-cost figure adds linear ACE run by ML-PACE with the
speed-ups proposed upstream (ICAMS/lammps-user-pace#31 on the CPU, and
prototypepace/kkkernels inpace_ref/faston the A100). Against stock
ML-PACE on the same node it is 1.5-1.8x faster on the CPU and 1.1-1.7x
faster on the A100 (o4d20: 2.89 against 5.31 µs/atom-step on 128 cores,
2.42 against 4.13 on the A100). -
The silicon accuracy-cost benchmark adds linear ACE run by ACEpotentials.jl
on the CPU: eachaj fitmodel rebuilt as an ACEpotentialsace_model
(bench/scaling/julia/build_trim_acejax.jl, gated to 1e-10 against ace-jax),
compiled withjuliac --trim(ACEpotentials PR 309) and run in LAMMPS. It is
the fastest CPU code for linear ACE up to o4d14, ties ML-PACE at o4d16 and is
2x slower than ML-PACE at o4d20 (bench/accuracy_cost/build_trim.py,
envs/sulis-cpu-trim.sbatch). -
The benchmark adds NEP (NEP4, trained with GPUMD). On the CPU it runs in
LAMMPS withpair_style nepin float64. On the A100 it runs in GPUMD in mixed
precision, and the figure labels these points. NEP is the cheapest family on
the A100. On the CPU, PACE reaches the same force error at a lower cost. Its
force error stops at approximately 0.10 eV/Å, the published NEP
result for this dataset, and it does not reach the QoI target
(bench/accuracy_cost/fit_nep.py).