Skip to content

When using PyTorch, enable GPU usage for MacOS #2672

@npatki

Description

@npatki

Problem Description

SDV currently offers several different neural network-based synthesizers that use PyTorch under-the-hood:

  • CTGANSynthesizer
  • TVAESynthesizer
  • CopulaGANSynthesizer
  • PARSynthesizer

Because these are neural network-based, the synthesizers may be slower to run using a CPU. SDV currently offers a solution for this using the cuda parameter, which you can set during initialization. When set to True (default), SDV will use the GPU whenever it's possible.

Unfortunately, this is not available for MacOS users (only for Windows/Linux).

Expected behavior

Rather than CUDA, MacOS users can use MPS.

API-wise, this means:

  • Deprecating the cuda parameter for all of the above synthesizers. (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

This will only be possible in SDV after making the changes to underlying libraries with the ML models -- CTGAN and DeepEcho. Issues will be filed there as well.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions