KEMBAR78
[Online-DPO] num_generation_per_prompt is fixed by kashif · Pull Request #1898 · huggingface/trl · GitHub
Skip to content

Conversation

@kashif
Copy link
Collaborator

@kashif kashif commented Aug 3, 2024

  • num_generation_per_prompt is always 2 for the online DPO case
  • removed un-needed with torch.no_grad():

@kashif kashif requested a review from qgallouedec August 3, 2024 11:22
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@kashif kashif changed the title [Online-DPO] num_generation_per_prompt is fixed [Online-DPO] num_generation_per_prompt is fixed and fix scores Aug 5, 2024
@qgallouedec
Copy link
Member

Important: seems like eos penalty had an error

- scores = torch.where(contain_eos_token, scores, args.penalty_reward_value)
+ scores = torch.where(contain_eos_token, args.penalty_reward_value, scores)

@kashif kashif changed the title [Online-DPO] num_generation_per_prompt is fixed and fix scores [Online-DPO] num_generation_per_prompt is fixed Aug 5, 2024
del logits, all_logprob
torch.cuda.empty_cache()

with torch.no_grad():
Copy link
Member

@qgallouedec qgallouedec Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because ref model is in eval mode that you don't need to use the context?

@kashif kashif merged commit fc76fe8 into huggingface:main Aug 6, 2024
yxliu-TAMU pushed a commit to mincheolseong/ECEN743-GRPO-Project-Proposal that referenced this pull request Apr 20, 2025
* num_generation_per_prompt is fixed

* remove unused no_grads

* removed bin

* fix scores

* fix scores

* formatting

* undo
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.

3 participants