deepmodeling / deepmodeling/deepmd-kit

feat(tf2): support spin models or add backend-aware validation

Open
#5,876 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.