Skip to content

Enable GPU usage for MacOS (using MPS) #161

@npatki

Description

@npatki

Problem Description

As described in sdv-dev/SDV#2672, we would like to allow MacOS users to make use of their GPU. To do this, they will need to use MPS instead of the currently-supported CUDA. (CUDA is only available for Linux/Windows).

Expected behavior

For PAR model:

  • Deprecate the current cuda parameter. (For backwards compatibility, throw a FutureWarning if it is supplied)
  • Add a new parameter called enable_gpu, which is True by default. This parameter enable GPU usage with whatever technology is available for the platform.
    • For Linux/Windows users, this parameter behaves identically to the cuda parameter
    • For MacOS users, it will use MPS instead

Additional context

MPS can be enabled with the following lines:

if torch.backends.mps.is_available():
    device = torch.device('mps') # Use Mac GPU

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions