-
Notifications
You must be signed in to change notification settings - Fork 8
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
DPO #30
base: main
Are you sure you want to change the base?
DPO #30
Conversation
shahbuland
commented
Jan 26, 2024
- Add DPO LoRA support
- Should add non-lora support as well but this is WIP for now
def time_per_1k(n_samples : int): | ||
total_time = timer.hit() | ||
return total_time * 1000 / n_samples |
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.
this func should probably be in utils
if not do_lora: | ||
ref_model = deepcopy(self.accelerator.unwrap_model(self.model).unet) | ||
ref_model.requires_grad = False | ||
if self.config.method.ref_mem_strategy == "half": ref_model = ref_model.half() |
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.
hmm is it a problem that the ref model is in half? does the original DPO do this?
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.
I'm not aware of how it would cause issues but I figured it was just a nice addition for memory saving purposes. It's not necessary if you match the original papers hyperparameters though.