-
Notifications
You must be signed in to change notification settings - Fork 417
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
Question about torch_dtype when runnging run_orpo.py #174
Comments
Hi here! Not sure if that's related to #175 at all, but feel free to upgrade the Other than that, could you share the configuration you're using so that we can reproduce and debug that issue further? Thanks in advance! |
Hi alvarobartt, Here are the details of the environment and configuration I used:
run_orpo.py configuration: With this setup, the dtype of the model changes to fp32 when saving the model, even though it was set to bf16. Please let me know if you need any additional information. Thanks! |
Thanks for that @sylee96, to better understand the problem here is that the training is indeed happening in |
Thanks for answering, @alvarobartt. I use this command line like this.
When I checked the gemma2, llama3, or qwen2 model dtype before training, the model's dtype was set to When I checked the model's dtype, I used this line.
|
Anytime @sylee96!
You should load it as follows i.e. specifying the import torch
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path, torch_dtype=torch.float16)
print(model.dtype) Hope that helps! 🤗 |
Thanks for your help, @alvarobartt! I would close this issue. |
I have been using
run_orpo.py
with my personal data successfully. However, as I use it, I have a question.When I look at the code for
run_orpo.py
, I see that there is a code to match torch_dtype to the dtype of the pretrained model. However, when I actually train and save the model, even if the pretrained model's dtype wasbf16
, it gets changed tofp32
. Why is this happening?The text was updated successfully, but these errors were encountered: