deepmodeling / deepmodeling/deepmd-kit
feat(tf2): support spin models or add backend-aware validation
- Dominant language
- Python
- Stars
- 2k
- Forks
- 649
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 15
Description
## Summary
The common schema accepts `model.spin`, while TF2 model construction currently raises `NotImplementedError`. This creates a late backend-specific failure for a schema-valid configuration.
## Scope
Choose and implement one explicit TF2 contract:
1. support spin-aware model construction, data requirements, losses, training, serialization, and inference; or
2. reject spin during backend-aware validation and document the limitation.
If implementation is selected, preserve the shared spin conventions for atom types, labels, forces, model outputs, and checkpoint formats.
## Acceptance criteria
- TF2 spin configurations either train/infer correctly or fail during backend-aware validation.
- The current late `NotImplementedError` is no longer the first user-visible validation.
- Serialization and configuration round-trips preserve the selected contract.
- Tests cover a minimal spin configuration or explicit rejection, plus a non-spin regression.
- Documentation clearly distinguishes TF2 from legacy TensorFlow support.
Refs #5757.
Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh
Contributor guide
Assessment
This issue has not been assessed yet.