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

Improve error message when sampling on a non-CPU device #1819

Closed
npatki opened this issue Feb 27, 2024 · 0 comments · Fixed by #2016
Closed

Improve error message when sampling on a non-CPU device #1819

npatki opened this issue Feb 27, 2024 · 0 comments · Fixed by #2016
Assignees
Labels
data:sequential Related to timeseries datasets feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Feb 27, 2024

Problem Description

When using the PARSynthesizer, SDV currently expects that the fitting and sampling are both done on machines with the same processors -- i.e. it is not possible for you to fit on a GPU-enabled device, but then sample from a CPU-only device. The feature request for this is in #1778.

Until we are able to accommodate this feature, we should at least surface a better error message for users explaining this limitation. The current error message looks like this:

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. 
If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') 
to map your storages to the CPU.

Expected behavior

Create a more generic error explaining that this feature isn't yet possible.

SamplingError: This synthesizer was created on a machine with GPU but the current machine is 
CPU-only. This feature is currently unsupported. We recommend sampling on the same GPU-enabled machine.
@npatki npatki added feature request Request for a new feature data:sequential Related to timeseries datasets labels Feb 27, 2024
@fealho fealho self-assigned this May 20, 2024
@fealho fealho added this to the 1.13.2 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:sequential Related to timeseries datasets feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants