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

Load ESM2 in bf16 if supported #235

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brianloyal
Copy link

Description

Updated ESM2 model load to use bfloat16 (if supported).

Motivation

Slightly improved VRAM usage for greater support on A10 gpus

Test plan

Run on test data using g5.2xlarge instances on AWS

@wukevin wukevin requested a review from arogozhnikov December 9, 2024 23:31
@arogozhnikov
Copy link
Contributor

  1. we offload ESM, so this unlikely to bring any memory benefits
  2. if model works well in fp16/bf16 (this needs checking by looking at difference in predictions vs fp32 version), we'd better just use one of them, not both.

model_name,
cache_dir=esm_cache_folder,
torch_dtype=(
torch.float16 if is_torch_bf16_gpu_available() else torch.bfloat16
Copy link
Contributor

@arogozhnikov arogozhnikov Dec 9, 2024

Choose a reason for hiding this comment

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

you want opposite

Copy link
Author

Choose a reason for hiding this comment

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

🤦 sigh - sorry about that

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