You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fine-tune descriptor mismatch warning should ignore seed #6038
warn_configuration_mismatch_during_finetune reports descriptor.seed as a configuration mismatch. seed only selects the RNG used when a module is first constructed. It is not a loaded parameter, and a difference does not change which pretrained weights are reused.
What happens
_IGNORED_DESCRIPTOR_KEYS in deepmd/utils/finetune.py is {"trainable"}. A fine-tune whose input sets descriptor.seed to null while the checkpoint was trained with seed: 42 therefore logs:
DEEPMD WARNING Descriptor configuration mismatch detected between input.json and pretrained model (branch 'Default'). Only descriptor parameters that are compatible with the pretrained model can be reused; incompatible parameters may be reinitialized, skipped, or rejected by backend-specific loading:
seed: input=None, pretrained=42
The weight copy in collect_single_finetune_params (deepmd/pt/train/training.py) does not consult this diff. Matching tensors are still taken from the pretrained state dict. The warning text implies that the descriptor may be reinitialized or rejected, which does not happen for seed.
descriptor.seed: null is the documented way to draw a fresh seed for any parameter that is actually created during the run. That choice should not be reported as an incompatible descriptor change.
Expected behavior
Add seed to _IGNORED_DESCRIPTOR_KEYS, next to trainable, so initialization RNG settings are not treated as architecture mismatches.
descriptor.use_amp belongs in the same ignore set.
It is an execution policy, not part of the learned function. The DPA4C serializer already leaves it out of the checkpoint for that reason (deepmd/dpmodel/descriptor/dpa4c.py, serialize): training reads it from the input, and inference reads DP_AMP_INFER. The pt / pt_expt modules store it as a Python bool (self.use_amp = bool(use_amp)), so load_state_dict does not restore it and the input value is what actually enables autocast.
Fine-tuning an AMP checkpoint with descriptor.use_amp: false therefore still loads the pretrained weights, but logs:
DEEPMD WARNING Descriptor configuration mismatch detected between input.json and pretrained model (branch 'Default'). Only descriptor parameters that are compatible with the pretrained model can be reused; incompatible parameters may be reinitialized, skipped, or rejected by backend-specific loading:
use_amp: input=False, pretrained=True
That warning is wrong in the same way as seed: nothing is reinitialized or rejected. Please ignore use_amp in _IGNORED_DESCRIPTOR_KEYS as well.
Confirmed on current master: deepmd/utils/finetune.py still has _IGNORED_DESCRIPTOR_KEYS = {"trainable"}, so both seed and the use_amp case you added are currently reported as descriptor incompatibilities even though they do not control which pretrained tensor values are loadable.
I agree these should be treated as non-structural descriptor settings for this warning path. A small regression test in source/tests/common/test_finetune_utils.py would be useful as part of the fix: make two otherwise-identical descriptors differ only in seed (including None vs an integer) and use_amp, and assert warn_configuration_mismatch_during_finetune() emits no warning; keep an adjacent structural difference such as repflow.nlayers to ensure real incompatibilities are still reported.
No linked fix PR is visible yet, so leaving this open for implementation.
Activity
OutisLi commentedon Sep 22, 2026
descriptor.use_ampbelongs in the same ignore set.It is an execution policy, not part of the learned function. The DPA4C serializer already leaves it out of the checkpoint for that reason (
deepmd/dpmodel/descriptor/dpa4c.py,serialize): training reads it from the input, and inference readsDP_AMP_INFER. The pt / pt_expt modules store it as a Python bool (self.use_amp = bool(use_amp)), soload_state_dictdoes not restore it and the input value is what actually enables autocast.Fine-tuning an AMP checkpoint with
descriptor.use_amp: falsetherefore still loads the pretrained weights, but logs:That warning is wrong in the same way as
seed: nothing is reinitialized or rejected. Please ignoreuse_ampin_IGNORED_DESCRIPTOR_KEYSas well.njzjz-bot commentedon Sep 22, 2026
Confirmed on current
master:deepmd/utils/finetune.pystill has_IGNORED_DESCRIPTOR_KEYS = {"trainable"}, so bothseedand theuse_ampcase you added are currently reported as descriptor incompatibilities even though they do not control which pretrained tensor values are loadable.I agree these should be treated as non-structural descriptor settings for this warning path. A small regression test in
source/tests/common/test_finetune_utils.pywould be useful as part of the fix: make two otherwise-identical descriptors differ only inseed(includingNonevs an integer) anduse_amp, and assertwarn_configuration_mismatch_during_finetune()emits no warning; keep an adjacent structural difference such asrepflow.nlayersto ensure real incompatibilities are still reported.No linked fix PR is visible yet, so leaving this open for implementation.
Agent: ChatGPT
Model: GPT-5.6 Sol
fix(finetune): ignore runtime-only descriptor options in warnings