Repository navigation
Conversation
Train and predict a spin-dependent NEP using the existing SNES lifecycle. Add shared Spin3 descriptors and derivatives, magnetic-force parallel/perpendicular supervision, torque and grouped-response losses, input validation, reference scaling, prediction, restart and versioned model IO. The shared descriptor headers are introduced here for both consumers. GPUMD force dispatch and spin dynamics are not enabled in this PR.
Load exported NEP-spin models and evaluate energy, atomic forces, magnetic forces and the full virial in GPUMD. Add single-process multi-GPU evaluation, per-atom spin input/output and replication, fixed-spin restart output, and group/region magnetic fields. The spin coordinates remain fixed under ordinary supported lattice integration. No spin integrator, spin velocity, or lattice-thermostat checkpoint state is introduced. Runtime and training reuse the descriptor kernels from part 1.
Add Cartesian TSPIN dynamics with fixed-lattice and coupled NVT/NPT modes, element-wise spin masses, spin-velocity IO and lifecycle validation. Introduce the shared Spin integration hooks and Spin-specific NHC/MTTK lattice checkpoint classes. Ordinary NHC/MTTK implementations remain byte-identical to upstream. The initial-temperature cache retains its upstream meaning while the per-step target is passed to Spin. No SIB or GLSD commands are accepted yet. Lattice checkpoints do not imply full TSPIN extended-state restart reproducibility.
Add deterministic and stochastic semi-implicit B integration for fixed-magnitude spins, with fixed-lattice and coupled NVT/NPT modes. Introduce the shared counter-based noise helper and endpoint force refresh used by predictor/corrector spin methods. Refresh endpoint energy, force, virial and magnetic force before measurements, preserving the already-sampled mechanical-force increment. Reuse part 3's lattice drivers. This does not add stochastic SIB random-stream restart continuation.
Add Cartesian variable-magnitude GLSD with shared-noise Heun stepping, precession and longitudinal/transverse relaxation, dimensionless damping input and checked unit conversion. Add GLSD noise-counter/seed restart metadata and combine it with the Spin lattice checkpoint support. Reuse the potential, noise helper, endpoint refresh and lattice drivers from preceding parts. Keep GLSD's Cartesian Boltzmann measure and zero-moment behavior separate from fixed-magnitude SIB.
Add energy minimization for spin coordinates using FIRE, with fixed or variable moment magnitudes and optional coupled atomic/cell relaxation. Validate input combinations and use the same NEP-spin energy, force, magnetic-force and virial evaluation as MD. FIRE is a separate minimizer and does not modify the dynamics algorithms. The combined production source at the top of this series matches the previously reviewed complete Spin branch; fixture/test helpers are factored to keep earlier parts independently testable.
This was referenced Oct 26, 2026
Reject flexible ZBL before parameter loading, retain universal ZBL, and remove C++17-only syntax from the magnetic kernels and probes. Consolidate overlapping training checks while retaining numerical, restart, JIT and multi-GPU coverage.
Preserve the existing PR history while carrying prerequisite Spin fixes and the reduced regression suites into this stage.
Preserve the existing PR history while carrying prerequisite Spin fixes and the reduced regression suites into this stage.
Preserve the existing PR history while carrying prerequisite Spin fixes and the reduced regression suites into this stage.
Preserve the existing PR history while carrying prerequisite Spin fixes and the reduced regression suites into this stage.
Preserve the existing PR history while carrying prerequisite Spin fixes and the reduced regression suites into this stage.
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.
Add energy minimization for spin coordinates using FIRE, with fixed or variable moment magnitudes and optional coupled atomic/cell relaxation. Validate input combinations and use the same NEP-spin energy, force, magnetic-force and virial evaluation as MD.
FIRE is a separate minimizer and does not modify the dynamics algorithms. The combined production source at the top of this series matches the previously reviewed complete Spin branch; fixture/test helpers are factored to keep earlier parts independently testable.
Series and review scope
Part 6 of six, split from #1849. Depends on #1855.
Incremental diff for this part: parent → this commit.
This draft currently targets upstream
master, so GitHub's Files changed also includes the preceding parts. After this part's prerequisites merge, rebase it onto the updatedmasterto expose only this part in GitHub.Validation
Validated production/test inputs for
96cfe29c7dbf40e35a4b5ac7a9b0c42b3336e3d8on four NVIDIA V100 GPUs with CUDA 12.9.1; 1/2/4 GPUs where specified. Final documentation/ignore-only cleanup was checked separately. The publication base isc7e6340; its only change from the GPU-tested upstream base04bd535isdoc/publications.bib, and documentation was rebuilt after adopting it. No numerical tolerance or oracle values were changed.gpumdandnep; 22 model-format tests.-W --keep-going), Markdown links andgit diff --checkpassed.These are implementation/regression checks, not scientific fit-quality or performance claims. HIP, WPE and Windows execution are not covered by this validation.
The combined final
src/tree is byte-identical to the previously reviewed full Spin branch atb7d58c136fa63203bf74a2b5959b892593553d05. Ordinary NHC/MTTK sources remain identical to upstream throughout all six parts.