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?
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,
)
Thank you so much, the problem has been solved
lee1111
changed discussion status to
closed