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

Use latest peft/transformers/accelerate/bitsandbytes for 4-bit (qlora) #166

Merged
merged 8 commits into from
May 25, 2023

Conversation

arnocandel
Copy link
Member

@arnocandel arnocandel commented May 25, 2023

https://arxiv.org/abs/2305.14314
https://huggingface.co/blog/4bit-transformers-bitsandbytes

  • update deps
  • enable 4-bit generation
  • enable 4-bit lora training

Addresses #136 more directly than #107, but only at runtime.

finetune.py Show resolved Hide resolved
generate.py Show resolved Hide resolved
@arnocandel
Copy link
Member Author

arnocandel commented May 25, 2023

Testing 65B on 2x A6000Ada:
(env) arno@rippa:/nfs4/llm/h2ogpt(4bit)$ CUDA_VISIBLE_DEVICES=0,1 torchrun --nproc_per_node=2 finetune.py --base_model=decapoda-research/llama-65b-hf --train_4bit=True --micro_batch_size=1 --run_id=3 --data_path=h2oai/openassistant_oasst1_h2ogpt_graded
works:
0%|▋ | 1/237 [04:27<17:33:37, 267.87s/it]
1%|█▎ | 2/237 [09:01<17:41:35, 271.04s/it]
image

@arnocandel arnocandel marked this pull request as ready for review May 25, 2023 06:17
Copy link
Collaborator

@pseudotensor pseudotensor left a comment

Choose a reason for hiding this comment

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

We will do more full testing of eval on 4bit vs. 8bit vs. 16bit. According to QLORA paper, as long as do LORA on all linear layers, then should be as good as 16bit. I'm unclear on speed of new Tim stuff.

@arnocandel arnocandel merged commit d160eb6 into main May 25, 2023
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.

2 participants