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

Can I use bfloat16 when training? #114

Open
yangyuya opened this issue Jul 1, 2024 · 1 comment
Open

Can I use bfloat16 when training? #114

yangyuya opened this issue Jul 1, 2024 · 1 comment

Comments

@yangyuya
Copy link

yangyuya commented Jul 1, 2024

I see the code use torch.float by default.

    model = VideoChatGPTLlamaForCausalLM.from_pretrained(
        model_args.model_name_or_path,
        cache_dir=training_args.cache_dir,
        # torch_dtype=torch.bfloat16 if training_args.bf16 else torch.float,
    )

Can I use bfloat16 when training? I find if I use bfloat16 I can train with 24G GPUs. But I'm not sure how much this affects model performance? Can you give me some advice?

@mmaaz60
Copy link
Member

mmaaz60 commented Jul 8, 2024

Hi @yangyuya,

Thank you for you interest in our work. I have not tried it though the training in bf16 mode should work and give similar results.

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

No branches or pull requests

2 participants