-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] dp change-bias
will give much large model
#4348
Comments
dp change-bias
command have abnormal result
Finetune with |
Thanks! However the oversize of |
dp change-bias
command have abnormal resultdp change-bias
will give much large model
@QuantumMisaka could you post all keys in the checkpoint import torch
def get_all_keys(d, prefix=""):
"""Gets all keys from a nested dictionary with slash-separated paths."""
keys = []
for k, v in d.items():
if isinstance(v, dict):
keys.extend(get_all_keys(v, prefix + str(k) + "/"))
else:
keys.append(prefix + str(k))
return keys
print(get_all_keys(torch.load("dpa230m.pt")))
print(get_all_keys(torch.load("dpa230m_updated.pt"))) |
@njzjz They print the same results
|
The reason should be the abuse of deepcopy deepmd-kit/deepmd/pt/entrypoints/main.py Line 394 in 058e066
(or the copy of tensors that happens in other places) |
Bug summary
From pre-trained multi-head model,
dp --pt change-bias
will give a model with much larger size. However, finetuen withnumb_steps: 0
will have no problem:the model after change-bias dpa230m_updated.pt have much larger size even more than original model, but the 0-step finetuned model model_finetune.ckpt-0.pt have much small size which is in desire.
And, if try to load the model after change-bias, the head should be selected, which is also not in desire
Where the 0-step finetuned model have no problem
DeePMD-kit Version
v3.0.0b4
Backend and its version
pytorch 2.5.1
How did you download the software?
Offline packages
Input Files, Running Commands, Error Log, etc.
command for change-bias:
command for 0-step finetune
coresponding input.json
Steps to Reproduce
run these command in any dataset
Further Information, Files, and Links
No response
The text was updated successfully, but these errors were encountered: