Repository navigation
Conversation
Fuse the large-box radial, angular, and spin neighbor filtering passes while preserving separate cutoff and list semantics.
Adopt upstream Action lifecycle, channel-major training parameters and input/checkpoint interfaces. Preserve Spin3-only descriptors, response training and SIB/TSPIN integration; exclude magnetic models from the ordinary NEP element compactor. Validated on Sai V100: training/prediction/runtime parity, 106-dimensional O3-C3 restart, grouped dumps, 24 frozen-oracle cases, SIB/TSPIN, and ordinary NEP native/JIT RMSE parity (job 1120358).
SIB adds the thermal increment to the rotation vector directly, without a Gilbert cross term, so its variance must match the damping mobility: sigma^2 = 2 alpha gamma k_B T dt / (mu_s (1 + alpha^2)). The drift already carries one 1 / (1 + alpha^2) factor, so dividing the noise amplitude by it again made the bath equilibrate at T / (1 + alpha^2). Cover the seeded increment with a fluctuation-dissipation oracle in the pytest suite and in the standalone runtime validator, and fix the documented formula.
Merge brucefan1983/GPUMD master at ac082df. Preserve Spin3 response metadata and neighbor paths with upstream structure copying and periodic-boundary support; adapt fixed-lattice/SIB thermodynamics and ZBL member naming. Validated gpumd and nep builds on Sai V100 (job 1335340): group magnetic field, SIB/TSPIN, 24 frozen runtime oracles, response training, ZBL, restart, and native/JIT checkpoint checks.
Share fractional-coordinate region helpers with heat_lan and update field membership at every force evaluation. Preserve group input and document sharp-boundary energy semantics. Validated on Sai V100, job 1335423: group and region Zeeman energy/force, boundaries, tilted/scaled cells, periodic wrapping, region entry/exit, parser negatives, and SIB regression.
Integrate the upstream training layouts, parameter interfaces and MD input lifecycle while preserving spin3 response, restart and scaler fixes. Reuse NEP slab partition helpers to distribute geometry and spin halos. Evaluate local environments on each GPU and gather owner energy, force, magnetic force and virial outputs. Cache valid partitions while refreshing positions and spins for every force evaluation, including SIB substeps. Preserve model formats, SOC conventions and external-field behavior. Validation on Sai V100 with isolated candidate builds: - 1/2/4-GPU static and short-dynamics parity, 33 acceptance cases. - 253 upstream regression cases, 25 relations and 104 pytest tests. - Spin FP64 oracle, restart-scaler checks and four-GPU memcheck. - Ordinary NEP compatibility and matched repeated strong-scaling tests. This merge tree is the previously built and validated integration snapshot. Benchmark logs, models, binaries and remote job artifacts remain external.
Use sphere-log angular displacements and separate moment-magnitude differences. Preserve nonuniform three-point weights, mask inactive spins and reject antipodal stencils. Add independent analytic rotation tests.
Use each response group target RMS with the existing floor and mean weight, preventing stronger groups from suppressing weaker response scales. Update runtime checks and document the new tangent and scaling contract. Matched BFO fine-tuning improved one anisotropy slice but did not resolve the incorrect D sign. This changes training weights and is not joint J/D/anisotropy acceptance.
Accumulate per-structure predictions in host double precision and print non-stress averages and final reference columns with 16 significant digits. Training kernels and model precision are unchanged.
Preserve the current Spin training implementation at this integration checkpoint. The following PR brucefan1983#1841 merge migrates it directly to the final model interfaces; this intermediate commit is not a release acceptance point.
…terface Keep upstream SNES/Fitness generation-zero behavior and shared Structure/Dataset. Move Spin3 parameters, labels, magnetic neighbors, response loss, checkpoint I/O and evaluation into nep_spin; share structural evaluation kernels. Remove curriculum and retain upstream prediction output formatting. Validated on Sai V100 with CUDA 12.9.1: 23 ordinary training cases against pure PR, 24 frozen spin oracle cases, training/runtime and JIT parity, response isolation, single/four-GPU restart and fixed-seed training parity, SIB/TSPIN and 29 host regression tests. No push.
Merge upstream 30a6db0 and adapt Spin3 training and MD to format_version 1 and shared energy_reference. Remove the duplicate spin baseline fit and kernel addition, retain the shared bias correction, and preserve legacy model/restart compatibility. Validate old/new formats and reference shifts on 1/2/4 V100 GPUs, including spatial decomposition, spin integrators and atom migration. Fixed-seed 1/2/4-GPU training produces identical restart, reference and loss outputs. Sai job 1930081 passed the training/prediction/restart/JIT suite; the previous single-GPU oracle checks and 8 host codec tests pass. Record same-model multi-GPU repeat controls using existing tolerances.
Retain batch=1 as a centered-energy-loss negative control and add batch=3 training on 1/2/4 GPUs. Predict all structures with each exported model, verify original energy labels, check raw RMSE against the training log, and compare per-structure predictions alongside restart and loss values. Write spin_cutoff with the same nine significant digits as structural cutoffs, updating the existing model-output regression expectations. Validation: Sai job 1930272 passed all six training/prediction cases. Cross-GPU differences are zero; batch=3 raw energy RMSE is 0.04610498 eV/atom versus 0.04610 in loss.out. Cutoff formatting also passed the single-GPU training/prediction/MD/restart suite in job 1930249.
Apply initial_para to the fixed reference radial coefficients used to prepare Spin scalers, while preserving search initialization and imported scalers. Reject non-finite initial_para values and cover the lifecycle in regression tests. Share the training/MD layout builder and remove unreachable fixed-mode branches. Clarify response-mask semantics, remove the stale keyword-table cell, and fix RST headings so the complete documentation builds without warnings. Validation: 22 CPU format tests; strict Sphinx HTML build; Sai CUDA build, training/lifecycle policies, 24 independent oracle cases per model format, and 1/2/4-GPU scaler and multi-structure training/actual-energy checks.
Merge upstream 04bd535 and place Spin force implementations under force/nep_spin, preserving model-format dispatch and shared entry points. Move Spin lattice checkpoints and resumed protocols into dedicated NHC/MTTK adapters. Restore ordinary NHC/MTTK source and behavior to upstream, retaining existing Spin checkpoint formats. Update builds, documentation and tests. Validation: full regression 255 passed, 0 failed; relations 25 passed, 0 failed, 0 skipped. Spin NHC/MTTK and GLSD restart checks, 1/2/4-GPU MD, legacy/block model oracles, 78 pytest cases, Make/CMake and strict Sphinx build passed. Resolves all 12 prior ordinary restart-output differences.
Keep Integrate's initial target temperature unchanged during stepping while continuing to update the lattice and Spin per-step targets. Add a production driver probe for the cache contract and the independent Spin target update. Move Spin ensemble parsing into integrate/spin/input.cu and endpoint force refresh kernels into integrate/spin/step.cu, preserving the existing sampling and measurement order. Give the Spin force entry an explicit compute_spin name and remove its unused velocity and mass arguments. Document the probe. Validation: temperature contract probe passed; the same probe fails against previous validated objects as expected. Full regression: 255 passed, 0 failed; relations: 25 passed, 0 failed, 0 skipped. All 78 pytest cases, NHC/MTTK restart, GLSD, 1/2/4-GPU MD and both model-format oracles passed. Fresh Make builds and an independent CMake gpumd build passed with the validated source snapshot.
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This complete-branch draft has been split into six smaller draft PRs:
The original
spin3-refactorbranch remains atb7d58c136fa63203bf74a2b5959b892593553d05. Please use the six drafts for current scope, dependencies, incremental diffs and validation results. Closing this umbrella draft keeps the review in the split series.Previous complete-branch description (historical)
Summary
Add spin-dependent NEP training and spin–lattice dynamics to GPUMD. A single learned energy supplies atomic forces, magnetic forces and virials, so magnetic reference data can be fitted and the exported potential used for spin and coupled spin–lattice simulations.
This is a draft for upstream review of the model interface, shared-code changes and validation coverage. Head:
MagTheoryLab:spin3-refactor(076511ffbf2f979a9663341d3f2c36ac812960fa); base:master(30a6db02e36494b8bba71c9fa1d1a68627604961). The diff contains 171 files, +34,109/−490 lines, including documentation, tests and frozen numerical references.Local follow-up reviewed on 2026-10-26 — not pushed
The GitHub PR head is still
076511ffbf2f979a9663341d3f2c36ac812960fa. The following review and validation apply to local candidateb7d58c136fa63203bf74a2b5959b892593553d05, which includes upstream04bd53510707415dee2a07f839b04262808834dcthrough merge988893fc8993ef1815519d36587e9fd676027fb1. These local changes are not yet present in the PR diff. The PR remains a draft.The candidate moves Spin force implementations and magnetic fields into
src/force/nep_spin/, and isolates Spin input parsing, endpoint refresh, lattice restart and serialization insrc/integrate/spin/. Ordinary NHC/MTTK implementation/header files, their ensemble documentation and the ordinary NEP small-box header are byte-identical to the incorporated upstream commit. Spin lattice subclasses reuse the upstream mechanical integration and own their continuation state. The public drivers retain model selection, validation and lifecycle hooks.The final cleanup preserves the initial-temperature cache, including ordinary MTTK, while continuing to pass the per-step lattice target to Spin. Spin parsing and force-delta kernels were moved without algorithm changes; SIB/GLSD endpoint refresh remains after the second integration phase and before measurements, preserving the already-sampled mechanical-force increment. Spin MD, endpoint refresh and FIRE use the explicit
Force::compute_spinentry point.A focused final diff review found no new blocking issue in these entry points or the Spin isolation. Shared-code changes still include neighbor capacity/invalidation handling, reusable GPU allocation capacity, partition/region helper extraction and numerical helper templates; this is not a claim that all non-Spin files are unchanged. Make, HIP/WPE source lists and CMake include the new directories; only the CUDA builds below were executed.
Validation of local candidate b7d58c1
Sai job
1947761, V100-SXM2-32GB (up to four GPUs), CUDA 12.9.1,sm_70; final statusCOMPLETED / 0:0. Source/test/build input hashes (922 files) were unchanged through the run and have been checked against the local candidate. Existing regression manifests, tolerances and comparison rules were retained.tests_regression/suite against incorporated upstreamgpumdandnepbuilds passedgpumdpassedgit diff --checkpassedCandidate Make
gpumdSHA256:d33738c91cf9c092c83e27dd1e858f5deaed9c9439ed3b8111cc9aa3667133e7.The earlier training/JIT/magnetic-loss validations below retain their original commit attribution; they were not rerun on this candidate. Lattice restart coverage does not imply complete SIB random-stream or TSPIN extended-state checkpoint reproducibility. HIP/WPE/Windows execution, CMake
nep, and the earlier strict ordinary-NEP multi-GPU discrepancy remain outside this validation result. This final review rechecked the collected evidence; it did not launch another GPU run.Changes in the currently pushed PR
spin_version 1. Export the upstream named-block container usingformat_version 1,model nep_spinand a separatespin_version 1; reuse elementalenergy_referenceand restart IO. Retain compatible legacy readers and reject unknown versions or conflicting selectors.initial_parascales reference radial coefficients, defaults to 1 and accepts finite values in [0.1, 1]; it does not change the SNES initial search distribution. Prediction, restart and explicit scaler import preserve saved scalers.spin_dof_typeselects public response/supervision and does not freeze integrated spin coordinates.Earlier validation of the pushed PR
CUDA checks used V100-SXM2-32GB GPUs, CUDA 12.9.1 and
sm_70, with up to four GPUs. Original numerical tolerances were retained. Reproduction entry points and oracle policy are documented in developer/spin_validation.md which includes the GLSD/NHC/MTTK test entry points and their external prerequisites. Historical experiment reports are kept outside the source tree; user-facing units and continuation contracts are in the main documentation.The following suites ran directly on
c4dc508faccf417ca226b3516ed4f80391a6bb61, with source/test hashes checked against that commit. The current head only consolidates documentation; source code, tests and fixtures are unchanged. This documentation update passed a complete strict Sphinx HTML build (warnings treated as errors), stale-reference/local-link checks andgit diff --check; GPU tests were not rerun for it:Additional checks ran on
13bbe23ec1bd5f5e5fe4604bfc112d866027ce32. The only subsequent source-code changes are verified license comments in five shared files; all bytes after those headers are unchanged:gpumd/nepand training-policy probe passed.initial_parachecks passed on 1/2/4 GPUs: default/explicit 1 agree, 0.5/0.1 affect scalers as expected, saved scalers persist and invalid values are rejected.Known limits and open validation item
c4dc508passed strict 1-versus-4-GPU comparisons for Spin C2/C3 at 14,400 and 80,000 atoms. Ordinary NEP did not pass the same strict componentwise gates: at 80,000 atoms, maximum per-atom energy/force/virial differences were 1.43e-5 eV, 1.98e-4 eV/Å and 1.55e-4 eV. The cause and whether this is upstream behavior or a regression are not established. This remains an open validation item; ordinary-NEP multi-GPU equivalence is not claimed from that experiment.gpumd.