Dream icon indicating copy to clipboard operation
Dream copied to clipboard

`Dream-v0-Base-7B` and `Dream-v0-Instruct-7B` Have Identical Weights

Open lingjiechen2 opened this issue 1 year ago • 3 comments

Hi team,

Thank you for sharing and maintaining the excellent Dream models. While checking the two checkpoints on huggingface Dream-org/Dream-v0-Base-7B and Dream-org/Dream-v0-Instruct-7B, I found that their weights appear to be identical.

Reproduction

import torch
from transformers import AutoModel

path_base = "Dream-org/Dream-v0-Base-7B"
path_instruct = "Dream-org/Dream-v0-Instruct-7B"

model_base = AutoModel.from_pretrained(path_base, torch_dtype=torch.bfloat16, trust_remote_code=True)
model_instruct = AutoModel.from_pretrained(path_instruct, torch_dtype=torch.bfloat16, trust_remote_code=True)

diffs = []
for (n1, p1), (n2, p2) in zip(model_base.state_dict().items(), model_instruct.state_dict().items()):
    if not torch.allclose(p1, p2, atol=1e-6, rtol=1e-5):
        diffs.append(n1)

print(f"Differing parameters: {len(diffs)}")  # prints 0

All parameters appear to be identical, with no numerical differences detected across any layer. Could you please confirm whether this is the intended behavior or if it might be an upload issue?

Thank you again for your great work and contribution to the community.

lingjiechen2 avatar Oct 12 '25 01:10 lingjiechen2

Interesting, I got 339 after running the exact same code multiple times. Not sure if it's related to GPUs, I am using H800.

jiacheng-ye avatar Oct 15 '25 06:10 jiacheng-ye

That's pretty strange. I will try to use another device to rerun this code, I previously used the A100 80G.

lingjiechen2 avatar Oct 16 '25 07:10 lingjiechen2

I think the problem lies in my machine, I changed to another machine and the problem was solved. Thanks for your help!

lingjiechen2 avatar Oct 22 '25 06:10 lingjiechen2