Skip to content

[Q] Minimum GPU Ram requirements for inference on models? #512

Answered by mitchellnw
NightMachinery asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think we know the exact amount of GPU RAM required, but you can follow this tutorial for 8-bit inference https://github.com/mlfoundations/open_clip/blob/main/tutorials/int8_tutorial.ipynb

Concretely, your going to want to do something like the following (note I didn't actually check this code, just copied from the tutorial so there may be a typo, please double check tutorial if it doesn't work)

import open_clip
import bitsandbytes as bnb

model, _, preprocess = open_clip.create_model_and_transforms('ViT-H-14', pretrained='laion2b_s32b_b79k')
int8_linear_layer = bnb.nn.triton_based_modules.SwitchBackLinear
int8_model = open_clip.utils.replace_linear(model, int8_linear_layer, includ…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mobassir94
Comment options

@mitchellnw
Comment options

@mobassir94
Comment options

@mitchellnw
Comment options

Answer selected by NightMachinery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #509 on April 26, 2023 23:15.