Skip to content
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

[Liger] liger DPO support #2568

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

[Liger] liger DPO support #2568

wants to merge 14 commits into from

Conversation

kashif
Copy link
Collaborator

@kashif kashif commented Jan 14, 2025

What does this PR do?

Add support for Liger-kernel losses for the DPO Kernel

Needs: linkedin/Liger-Kernel#521

@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.

3. Loss values are reasonable and finite
4. Training works with both default and custom beta values
"""
beta_values = [0.1, 0.5] # Test multiple beta values
Copy link
Member

Choose a reason for hiding this comment

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

Can you use @parameterized.expand instead?

@qgallouedec
Copy link
Member

liger loss isn't compatible with ref precomputing right? If so we could add a warning or an error.

Comment on lines 87 to 105

## Liger for reducing peak memory usage

[To complete]

<hfoptions id="liger">
<hfoption id="DPO">

To use Liger for reducing peak memory usage, use the following code snippet:

```python
from trl import DPOConfig

training_args = DPOConfig(..., use_liger_loss=True)
```

</hfoption>
</hfoptions>
Copy link
Member

Choose a reason for hiding this comment

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

@kashif I've added this section in the new guide for reducing memory usage, if you've words to fill it

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