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

add llava multigpu capability #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion eureka_ml_insights/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def pick_available_device(self):
import numpy as np
import torch

device = "cpu"
device = "cpu"

if torch.cuda.is_available():
utilizations = []
Expand All @@ -660,6 +660,9 @@ def pick_available_device(self):

device = f"cuda:{gpu_index}"

if self.multi_gpu:
Copy link
Collaborator

Choose a reason for hiding this comment

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

multi-gpu should be added to HuggingFaceModel attributes, right? Otherwise all huggingface models break because they don't have this arg.

device = f"cuda"

logging.info(f"Using device {device} for model self hosting")

return device
Expand Down Expand Up @@ -738,6 +741,7 @@ class LLaVAHuggingFaceModel(HuggingFaceModel):

quantize: bool = False
use_flash_attn: bool = False
multi_gpu: bool = False

def __post_init__(self):
super().__post_init__()
Expand Down
Loading