Skip to content

Fine-tune descriptor mismatch warning should ignore seed #6038

Description

@OutisLi

Summary

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions