Repository navigation
Open
0 / 80 of 8 issues completedLabels
Description
Summary
While comparing deepmd/utils/argcheck.py with the deepmd/tf2 backend, I found several common-schema options that are not implemented or not fully wired up in TF2.
Some options are documented as Supported Backend: TensorFlow; if those are intended to mean only the legacy deepmd/tf backend and not deepmd/tf2, the docs/schema should make that distinction explicit.
Gaps
1. Legacy TensorFlow-only descriptors are schema-exposed, but TF2 does not register them
Schema/docs:
deepmd/utils/argcheck.pyexposes TensorFlow-supported descriptor variants includingloc_frame,se_a_tpe/se_a_ebd,se_a_ebd_v2/se_a_tpe_v2, andse_a_mask.
Implementation observation:
deepmd/tf2/descriptor/registers the common dpmodel-style descriptors (se_e2_a,se_e2_r,se_e3,se_e3_tebd,se_atten,se_atten_v2,dpa2,dpa3,hybrid), but notloc_frame,se_a_tpe/se_a_ebd,se_a_ebd_v2/se_a_tpe_v2, orse_a_mask.
Impact:
- A user reading
Supported Backend: TensorFlowmay reasonably expect these to work with the TF2 backend, but TF2 cannot construct them.
2. TF-only model features are schema-exposed, but TF2 does not implement them
Schema/docs:
deepmd/utils/argcheck.pyexposes TF-only model-level features such astype_embedding,modifier,compress, and hybrid modelpairwise_dprc.- It also exposes model variants such as
frozen,pairtab, andlinear_enerin the common model schema.
Implementation:
deepmd/tf2/model/model.pyexplicitly rejects model-leveltype_embeddingwith aValueErrorand does not implement the legacy TF model-level path.- TF2 model registrations are limited to task models (
ener,dos,dipole,polar,property) pluszbl; I did not find TF2BaseModel.register(...)implementations forfrozen, top-levelpairtab,linear_ener, orpairwise_dprc.
Impact:
- Schema-visible TensorFlow/common model options are unavailable in TF2 or fail during model construction.
3. model.spin is accepted by the common schema, but TF2 explicitly rejects spin models
Schema/docs:
deepmd/utils/argcheck.pyexposes the top-levelmodel.spinblock.
Implementation:
deepmd/tf2/model/model.pyraisesNotImplementedError("Spin model is not implemented yet.")whenmodel.type == "standard"andspinis present.
Impact:
- Schema-valid spin model configs fail at TF2 model construction time.
4. Learning-rate schema exposes exp, cosine, and wsd, but TF2 hard-codes LearningRateExp
Schema/docs:
deepmd/utils/argcheck.pyregisterslearning_rate.typevariantsexp,cosine, andwsd.
Implementation:
deepmd/tf2/train/trainer.pydirectly constructsself.lr_schedule = LearningRateExp(**lr_params)without dispatching onlearning_rate.type.
Impact:
learning_rate.type=cosineorlearning_rate.type=wsdis schema-exposed but unavailable in TF2 training.
5. Some schema loss types are not implemented in TF2
Schema/docs:
deepmd/utils/argcheck.pyexposes loss variants includingener,dens,ener_spin,dos,population,property, andtensor.
Implementation:
deepmd/tf2/train/trainer.pyget_loss()only supportsener,dos,tensor, andproperty.- There is no TF2 dispatch for
dens,ener_spin, orpopulation.
Impact:
- These loss types are visible in the common schema but fail in TF2 training. If they are intentionally limited to other backends, the schema/docs should spell out the backend restriction.
6. Optimizer support is narrower than the common schema suggests
Schema/docs:
deepmd/utils/argcheck.pyexposes optimizer variantsAdam,AdamW,LKF,AdaMuon, andHybridMuon.
Implementation:
deepmd/tf2/train/trainer.py_build_optimizer()supportsAdamandAdamWonly; other optimizer names raiseValueError("Unsupported optimizer type for tf2: ...").
Impact:
- The common optimizer schema is broader than TF2 support. If only
Adam/AdamWare intended for TF2, the docs/schema should make that explicit.
Expected resolution
Either:
- implement/wire these options in the TF2 backend, or
- update
argcheck.py/docs to clearly distinguish legacytfvstf2support and mark unsupported TF2 options before users hit backend runtime errors.
Filed by OpenClaw 2026.6.11 (e085fa1), model: custom-chat-jinzhezeng-group/gpt-5.5.
Implementation checklist
Model, loss, and optimizer support
- Implement or explicitly reject/document legacy TensorFlow-only descriptors in TF2 (feat(tf2): support or reject legacy TensorFlow-only descriptors #5874)
- Implement or explicitly reject/document TF-only model features and model variants in TF2 (feat(tf2): support or reject TensorFlow-only model features and variants #5875)
- Implement TF2 spin models or reject them during backend-aware validation (feat(tf2): support spin models or add backend-aware validation #5876)
- Support
learning_rate.type: cosineandlearning_rate.type: wsd(fix(train): dispatch registered learning rate schedules #5776) - Implement or explicitly reject/document
dens,ener_spin, andpopulationlosses (feat(tf2): support or reject dens, ener_spin, and population losses #5877) - Support or explicitly restrict schema-exposed optimizers beyond
AdamandAdamW(feat(tf2): align optimizer dispatch with the common schema #5878; Add HybridMuon optimizer support to JAX and TF2 for DPA4 training #5771 tracks DPA4HybridMuon)
Training support
- Derive training steps from
training.numb_epochand its aliases (feat(tf2): support epoch-based and multi-task training horizons #5879) - Support multi-task
training.num_epoch_dict(feat(tf2): support epoch-based and multi-task training horizons #5879) - Implement
training.profilingandtraining.enable_profiler(feat(tf2): implement training profiler support #5880) - Implement
training.mixed_precision(feat(tf2): implement training.mixed_precision #5881) - Apply
training.change_bias_after_trainingafter the final step (fix(train): share post-training bias adjustment #5745)
Sub-issues
Collapse Sub-issuesSub-issues
Loading 8 sub-issues
Activity
njzjz-bot commentedon Jul 9, 2026
Addendum: training option coverage
I re-checked the
training_data_args/validation_data_args/mixed_precision_args/training_argspath against TF2 on currentmaster(f73de32). Additional training-option gaps / clarifications:training.numb_epoch/ aliases and multi-tasktraining.num_epoch_dict: the schema allows epoch-based training, and legacydeepmd/tf/entrypoints/train.pyhas logic to computenumb_stepsfromnumb_epochandtotal_numb_batch. In contrast,deepmd/tf2/train/trainer.pystill initializesself.num_steps = int(training_params["numb_steps"]); I did not find equivalent epoch -> step conversion ornum_epoch_dicthandling in the TF2 path.training.profilingandtraining.enable_profiler: these are schema-visible, but TF2 currently raisesNotImplementedErrorfor both in_validate_unsupported_config().training.mixed_precision: this is schema-visible, but TF2 currently raisesNotImplementedError("TF2 training does not support mixed_precision yet.")when it is set.Clarification: I did not count
training.stat_file,training.tensorboard*, ortraining.change_bias_after_trainingas TF2 gaps in this addendum, because current TF2 code appears to wire those through (stat_file_pathconstruction/passing, TensorBoard writer hooks, and a post-training_change_bias_after_training()branch).Addendum by OpenClaw 2026.6.11 (e085fa1), model: custom-chat-jinzhezeng-group/gpt-5.5.
fix(train): dispatch registered learning rate schedules (deepmodeling…
docs(argcheck): document backend support matrices (deepmodeling#5915)