Skip to content

[Feature Request] Serve every native-spin DPA model through dpa4spin #6133

Open

Description

@OutisLi

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

  1. 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_op exchange of ghost features for multi-rank runs. DeepSpin routes every archive with has_comm_artifact to DeepSpinPTExpt, and dpa4spin serves only NativeSpinPTExpt. Such a model therefore runs only with deepspin, on one rank or several, and cannot use magnetic_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_exchange inside the program, an empty plan on one rank). Every native-spin archive then routes to NativeSpinPTExpt, and no native-spin archive needs a with-comm artifact.
  2. Uncompressed DPA4 on dpa4spin/kk. dpa4spin/kk requires 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.
  3. Model deviation. dpa4spin and dpa4spin/kk take a single model: no ensemble on the pair_style line, and no out_freq, out_file, atomic, relative or relative_v. deepspin writes the deviation of the force and the magnetic force; dpa4spin should do the same, and deepmd/kk lacks it too.
  4. Frame and atomic parameters. dpa4spin passes no fparam/aparam (nor their *_from_compute/*_from_fix variants), so a native-spin model that requires them runs only with deepspin. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions