Repository navigation
Open
Labels
Description
Summary
Native-spin DPA4/DPA4C models are meant to run through pair_style dpa4spin / dpa4spin/kk, which provide magnetic_force cartesian for Newtonian spin dynamics (#6077). Several native-spin models and run setups cannot use these styles yet and fall back to pair_style deepspin, which offers only the precession convention. This issue tracks the missing pieces so that every native-spin model can run through dpa4spin.
Detailed Description
- Multi-block DPA4 models frozen with the graph lower. A native-spin model with more than one message-passing block exports the graph (NeighborGraph) lower together with a with-comm artifact, which carries the per-block
border_opexchange of ghost features for multi-rank runs.DeepSpinroutes every archive withhas_comm_artifacttoDeepSpinPTExpt, anddpa4spinserves onlyNativeSpinPTExpt. Such a model therefore runs only withdeepspin, on one rank or several, and cannot usemagnetic_force cartesian. In current master this covers every uncompressed multi-block DPA4 native-spin model. Proposed direction: carry the halo exchange in the main program of the native-spin graph lower, as the compact canonical lower already does (communicator and border plan as inputs,deepmd::border_exchangeinside the program, an empty plan on one rank). Every native-spin archive then routes toNativeSpinPTExpt, and no native-spin archive needs a with-comm artifact. - Uncompressed DPA4 on
dpa4spin/kk.dpa4spin/kkrequires the compact canonical lower, which only a compressed DPA4C exports today. A single-precision DPA4/DPA4.5 model frozen on a CUDA device could export the same compact lower and be evaluated by its own graph forward, so it runs device-resident on one GPU or several. - Model deviation.
dpa4spinanddpa4spin/kktake a single model: no ensemble on thepair_styleline, and noout_freq,out_file,atomic,relativeorrelative_v.deepspinwrites the deviation of the force and the magnetic force;dpa4spinshould do the same, anddeepmd/kklacks it too. - Frame and atomic parameters.
dpa4spinpasses nofparam/aparam(nor their*_from_compute/*_from_fixvariants), so a native-spin model that requires them runs only withdeepspin. The compact canonical lower carries no frame or atomic parameters either, so such a model would use the graph lower of item 1 on the host style.
I plan to open pull requests for items 1 to 3; item 4 is open.
Further Information, Files, and Links
- Routing:
native_spin_backend_servesinsource/api_cc/src/DeepPotPTExptPlugin.cc. - With-comm decision:
_needs_with_comm_artifactindeepmd/pt_expt/utils/serialization.py. - Compact canonical spin lower with the halo exchange in its main program:
forward_lower_canonical_graph_exportableof the native-spin model indeepmd/pt_expt/model/native_spin_model.py. - Related: [Feature Request] Native Cartesian magnetic-force mode for Newtonian spin dynamics in LAMMPS #6077 (Cartesian magnetic force), feat(lammps): support Cartesian native-spin magnetic forces #6084.
Activity