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 #2016

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

fealho
Copy link
Member

@fealho fealho commented May 16, 2024

CU-86azg7w2c, Resolve #1819.

@sdv-team
Copy link
Contributor

@fealho fealho marked this pull request as ready for review May 16, 2024 22:30
@fealho fealho requested a review from a team as a code owner May 16, 2024 22:30
@fealho fealho requested review from rwedge and pvk-developer and removed request for a team May 16, 2024 22:30
Comment on lines 495 to 502
try:
synthesizer = cloudpickle.load(f)
except RuntimeError:
raise 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.'
)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this occur on the sampling instead ? or the error gets raised while you load the synthesizer?

Copy link
Member Author

Choose a reason for hiding this comment

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

From the user issue, they ran into this problem when loading the synthesizer, so that's where I added the warning.

try:
synthesizer = cloudpickle.load(f)
except RuntimeError:
raise SamplingError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we only switch to the new error message after confirming the error that surfaced has that specific message about the current machine being CPU-only?

@fealho fealho requested a review from rwedge May 20, 2024 18:46
Copy link
Contributor

@rwedge rwedge left a comment

Choose a reason for hiding this comment

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

If the error message doesn't match the specific case we should re-raise it

@fealho fealho merged commit eef6467 into main May 21, 2024
39 checks passed
@fealho fealho deleted the issue-1819-cpu branch May 21, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message when sampling on a non-CPU device
4 participants