-
Notifications
You must be signed in to change notification settings - Fork 441
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
Add fp32 support for QLoRA #595
Conversation
ghstack-source-id: aa906a002fccbc9e80acfe3c4848febe23d5071f Pull Request resolved: #590
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/595
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8fdb0af with merge base 2940941 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
partial(reparametrize_as_bf16_state_dict_post_hook, offload_to_cpu=True) | ||
partial( | ||
reparametrize_as_dtype_state_dict_post_hook, | ||
# TODO this is clowny, figure out a better way to get what precision the rest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I don't really see a better way to do this
torchtune/modules/peft/lora.py
Outdated
@@ -9,6 +9,8 @@ | |||
import torch.nn.functional as F | |||
|
|||
from torch import nn, Tensor | |||
|
|||
# from torchtune.modules.low_precision.nf4_linear import _linear_nf4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Context
Changelog
NOTE
Test plan
tune lora_finetune_single_device --config llama2/7B_qlora_single_device dtype=fp32 epochs=1