Skip to content

Conversation

shahbuland
Copy link
Collaborator

  • Add DPO LoRA support
  • Should add non-lora support as well but this is WIP for now

Comment on lines +116 to +118
def time_per_1k(n_samples : int):
total_time = timer.hit()
return total_time * 1000 / n_samples
Copy link
Collaborator

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()
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

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

Successfully merging this pull request may close these issues.

2 participants