Is there any way to use multi gpu?

#5
by lee1111 - opened

I am using rtx3090*2 gpus and I need to use both of them to load the model. Is there any way to use multi gpu?

upstage org

Thank you for your question! You can load and use a model with multiple GPUs on a RTX3090 with the code below. πŸ™‚

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("upstage/solar-pro-preview-instruct")
model = AutoModelForCausalLM.from_pretrained(
    "upstage/solar-pro-preview-instruct",
    device_map="auto",  
    torch_dtype="auto",  
    trust_remote_code=True,
)
upstage org

@lee1111 Please let us know if this code can address your issue. Thank you!

Thank you so much, the problem has been solved

lee1111 changed discussion status to closed

Sign up or log in to comment