Skip to content
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

Runtime error:数据类型报错 #55

Open
sqqiao opened this issue Jul 23, 2024 · 0 comments
Open

Runtime error:数据类型报错 #55

sqqiao opened this issue Jul 23, 2024 · 0 comments

Comments

@sqqiao
Copy link

sqqiao commented Jul 23, 2024

作者好,我在复现RRHF时碰到变量类型报错:
我配置fsdp_config进行分布式训练,当我使用--bf16混合精度时,报错:
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got CUDABFloat16Type instead (while checking arguments for embedding)

如果不使用bf16和tf32,报错:
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)

我的fsdp_config配置如图
1

使用的模型是llama3-8b,或者是tokenizer需要重新配置一下吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant