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

LoRA finetuning tutorial #671

Merged
merged 11 commits into from
Sep 18, 2024
Merged

LoRA finetuning tutorial #671

merged 11 commits into from
Sep 18, 2024

Conversation

michaelbenayoun
Copy link
Member

@michaelbenayoun michaelbenayoun commented Jul 29, 2024

What does this PR do?

  • Features required for the tutorial
  • Training script available
  • First draft of the tutorial ready
  • Able to properly fine-tune a llama model

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

Copy link
Collaborator

@JingyaHuang JingyaHuang left a comment

Choose a reason for hiding this comment

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

The tutorials are great! I left some some nits and questions to better understand it, thanks Michael!

docs/source/training_tutorials/finetune_llm.mdx Outdated Show resolved Hide resolved
docs/source/training_tutorials/finetune_llm.mdx Outdated Show resolved Hide resolved
docs/source/training_tutorials/sft_lora_finetune_llm.mdx Outdated Show resolved Hide resolved
docs/source/training_tutorials/sft_lora_finetune_llm.mdx Outdated Show resolved Hide resolved
docs/source/training_tutorials/sft_lora_finetune_llm.mdx Outdated Show resolved Hide resolved

To overcome this, we added a [model cache repository](https://huggingface.co/docs/optimum-neuron/guides/cache_system), which allows us to use precompiled models from the Hugging Face Hub to skip the compilation step. But be careful: every change in the model configuration might lead to a new compilation, which could result in some cache misses.

_Note: If your model configuration is not cached please open an issue on [Github](https://github.com/huggingface/optimum-neuron/issues), we are happy to include it._
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shall guide to the cache repo on the hub or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a link!

docs/source/training_tutorials/sft_lora_finetune_llm.mdx Outdated Show resolved Hide resolved
@@ -14,6 +14,8 @@
title: Fine-tune BERT for Text Classification on AWS Trainium
- local: training_tutorials/finetune_llm
title: Fine-tune Llama 3 8B on AWS Trainium
- local: training_tutorials/sft_lora_finetune_llm
title: Fine-tune Llama 3 8B on with LoRA and the SFTTrainer
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
title: Fine-tune Llama 3 8B on with LoRA and the SFTTrainer
title: Fine-tune Llama 3.1 8B with LoRA and the SFTTrainer

Copy link
Member

Choose a reason for hiding this comment

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

Should we do 3.1?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we could not do for the rope thing? Or for the transformers version.
Let's keep it like that. In any case we will move to 70B asap, and I can try to do 3.1 then.

Copy link
Collaborator

@JingyaHuang JingyaHuang left a comment

Choose a reason for hiding this comment

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

LGTM!
(Don't worry about failing inf2 CIs, they will be fixed via #691.

@michaelbenayoun michaelbenayoun merged commit d55d3ad into main Sep 18, 2024
5 of 10 checks passed
@michaelbenayoun michaelbenayoun deleted the lora_tutorial branch September 18, 2024 09:08
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.

4 participants