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

Support pre-training 8*V100 (32G) gpus with xformers #411

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

guanlaoda
Copy link
Contributor

FlashAttention does not support V100 GPU, and llava cannot train on V100, but most of the cards now are still V100. Now we introduce the FastChat solution to llava, and xFormers replaces FlashAttention. Like FastChat(https://github.com/lm-sys/FastChat), you can now use LLaVa to train on V100.

@guanlaoda
Copy link
Contributor Author

image
image
image
image

llava-7B-v1.1 model

@haotian-liu haotian-liu changed the title Pre-training supports 8*V100 (32G) gpus Support pre-training 8*V100 (32G) gpus with xformers Sep 1, 2023
@haotian-liu
Copy link
Owner

Thank you for your contribution! It looks nice to me, and thank you for providing the training logs as well. One minor: can you remove xformers from pyproject.toml and add a short instruction about how to install xformers? Similar to the one in FastChat:

If you are using V100 which is not supported by FlashAttention, you can use the memory-efficient attention implemented in xFormers. Install xformers and replace fastchat/train/train_mem.py above with fastchat/train/train_xformers.py.

@guanlaoda
Copy link
Contributor Author

OK, I'll modify it as soon as possible and submit it.

@guanlaoda
Copy link
Contributor Author

Completed the modification and submitted

@guanlaoda
Copy link
Contributor Author

image
image

@guanlaoda
Copy link
Contributor Author

no response,Is there anything else that needs to be modified?

@tingxueronghua
Copy link

no response,Is there anything else that needs to be modified?

Thanks for your effort and I want to inquire about the GPU assumption. After applying xformers like FastChat, could LLaVA 13B be fine-tuned on 8 V100?

@guanlaoda
Copy link
Contributor Author

I have tested it and GPU OOM will occur. I'll test it tomorrow and see if I can adjust the parameters.

@guanlaoda
Copy link
Contributor Author

Test results on 8*V100 (32G) gpus with xformers: pre-training works on 7b, but fine-tuned does not work on 7b, causing OOM.
Do I need to try to resolve this issue?

@tingxueronghua
Copy link

Test results on 8*V100 (32G) gpus with xformers: pre-training works on 7b, but fine-tuned does not work on 7b, causing OOM. Do I need to try to resolve this issue?

Thanks! I think I will just use Lora. Thanks for your effort and patience!

@haotian-liu
Copy link
Owner

Sorry for the late response, and thank you for the modification. I will review and merge this week.

@guanlaoda guanlaoda reopened this Nov 1, 2023
@hojisu
Copy link

hojisu commented Nov 2, 2023

is there any way to pretrain on 4*v100 (32gb)?

@aileenliao03
Copy link

Test results on 8*V100 (32G) gpus with xformers: pre-training works on 7b, but fine-tuned does not work on 7b, causing OOM. Do I need to try to resolve this issue?

Hi, is there a way to fine tune 7b on 8*V100s now by any chance? Thanks!

@haotian-liu haotian-liu merged commit 5da9716 into haotian-liu:main Nov 4, 2023
choics2623 pushed a commit to choics2623/LLaVA that referenced this pull request Dec 16, 2023
Support pre-training 8*V100 (32G) gpus with xformers
@pritamqu
Copy link

pritamqu commented Feb 1, 2024

could you please confirm which version of xformers did you use?

@zfr00
Copy link

zfr00 commented Jun 14, 2024

So there's no way to do full-parameter fine-tuning with v100, right?

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.

7 participants