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

Added example with Workflow interface for finetuning Llama2 LLM #905

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

manuelhsantana
Copy link
Collaborator

@manuelhsantana manuelhsantana commented Dec 30, 2023

This PR introduces a new example of fine-tuning the Llama2 Language Model (LLM), using the workflow interface.

The main objective of this PR is to provide users and developers with a practical guide on how to fine-tune the Llama2 LLM for their specific use cases.

The added example includes:

  • Steps on how to load the Llama2 LLM and prepare it for fine-tuning.
  • Instructions on how to set up the training and validation datasets.
  • Use the OpenFL workflow interface for fine-tune the model with a specific dataset.

A few things to keep in mind:

  • For this new example it is a prerequisite to register and request access to the Meta model.
  • The lvwerra and some Huggingface libraries are used.

This tutorial serves as a basic example, and users are encouraged to adapt and expand upon it to suit their specific needs and requirements.

Users are animated to explore this example and provide feedback, which will be invaluable in refining and expanding our set of examples.

Please review the changes and provide your valuable feedback.

Copy link
Contributor

@psfoley psfoley left a comment

Choose a reason for hiding this comment

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

Thanks @manuelhsantana. This PR is very close. Three small changes to address, then this is ready to merge.

@kta-intel
Copy link
Collaborator

I am trying to run it on CPU, but am running error:
NameError: name 'str2optimizer32bit' is not defined

@manuelhsantana did you happen to run into this? I can try to triage a bit more, but from a quick investigate, it seems like it is expecting CUDA drivers, which I think is a req for bitesandbytes currently

for easier testing, I reduced dataset size by replacing the data cell with this:

dataset=load_dataset(dataset_name,split='train[10:20]')

dataset = DatasetDict({
    'train': dataset,
    'test': dataset,
    'valid': dataset})

@manuelhsantana
Copy link
Collaborator Author

I am trying to run it on CPU, but am running error: NameError: name 'str2optimizer32bit' is not defined

@manuelhsantana did you happen to run into this? I can try to triage a bit more, but from a quick investigate, it seems like it is expecting CUDA drivers, which I think is a req for bitesandbytes currently

for easier testing, I reduced dataset size by replacing the data cell with this:

dataset=load_dataset(dataset_name,split='train[10:20]')

dataset = DatasetDict({
    'train': dataset,
    'test': dataset,
    'valid': dataset})

I changed the optimizer to avoid the warning on CPU

@kta-intel
Copy link
Collaborator

I am trying to run it on CPU, but am running error: NameError: name 'str2optimizer32bit' is not defined
@manuelhsantana did you happen to run into this? I can try to triage a bit more, but from a quick investigate, it seems like it is expecting CUDA drivers, which I think is a req for bitesandbytes currently
for easier testing, I reduced dataset size by replacing the data cell with this:

dataset=load_dataset(dataset_name,split='train[10:20]')

dataset = DatasetDict({
    'train': dataset,
    'test': dataset,
    'valid': dataset})

I changed the optimizer to avoid the warning on CPU

Thanks - this resolved the issue on my end. Everything looks good to me. Great contribution!

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.

None yet

3 participants