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

[Docs] Add unsloth optimizations in TRL's documentation #1119

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

This PR adds details about unsloth library: https://github.com/unslothai/unsloth that can bring very interesting out of the box speedups to users. In the future, I'll make sure users that use unsloth + SFTTrainer have the tag unsloth when they push models on the hub with unsloth

cc @danielhanchen @lvwerra

@danielhanchen let me know if the content does look to you! Feel free to add any suggestion directly in the PR

Related: unslothai/unsloth#34

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

@danielhanchen
Copy link
Contributor

Cool work @younesbelkada and thanks! Looks good - I'll add a few changes in a bit!


### Accelerate fine-tuning using `unsloth` library

You can further accelerate QLoRA / LoRA and even full-finetuning using [`unsloth`](https://github.com/unslothai/unsloth) library that is compatible with `SFTTrainer`. Currently `unsloth` supports only Llama and Mistral architectures.
Copy link
Contributor

Choose a reason for hiding this comment

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

"You can further accelerate QLoRA / LoRA and even full-finetuning using" maybe to

You can further accelerate QLoRA / LoRA 2.2x faster and use 60% less memroy and even full-finetuning (1.1x speed boost) using unsloth library that is compatible with SFTTrainer. Currently unsloth supports only Llama (Yi, TinyLlama etc) and Mistral architectures.

@@ -410,6 +410,61 @@ We have tested NEFTune by training `mistralai/Mistral-7B-v0.1` on the [OpenAssis
</div>

Note however, that the amount of performance gain is _dataset dependent_ and in particular, applying NEFTune on synthetic datasets like [UltraChat](https://huggingface.co/datasets/stingning/ultrachat) typically produces smaller gains.

### Accelerate fine-tuning using `unsloth` library
Copy link
Contributor

Choose a reason for hiding this comment

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

Accelerate fine-tuning using unsloth library

maybe to

Accelerate fine-tuning using unsloth

@danielhanchen
Copy link
Contributor

Actually instead of comments, I just editted the docs in place here: add-unsloth-docs...danielhanchen:trl:patch-1

@younesbelkada
Copy link
Contributor Author

Thanks a lot @danielhanchen ! I just merged your PR with your suggestions

@younesbelkada younesbelkada merged commit f11e213 into main Dec 22, 2023
9 checks passed
@younesbelkada younesbelkada deleted the add-unsloth-docs branch December 22, 2023 12:45
@danielhanchen
Copy link
Contributor

:)

lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
…e#1119)

* add unsloth

* Update sft_trainer.mdx (huggingface#1124)

Co-authored-by: Daniel Han <[email protected]>

---------

Co-authored-by: Daniel Han <[email protected]>
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