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

Harmonize device selection and allow SYCL to circumvent it when no GPU is available #5222

Merged
merged 3 commits into from
Jul 15, 2022

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Jul 15, 2022

#5211 may have broken SYCL running on CPUs
This PR make sure backends do not try to interpret on their own the settings and use directly the GPU that is selected by Core. It allows SYCL to not call Impl::get_gpu when it detects there are none.

@dalg24 dalg24 requested a review from masterleinad July 15, 2022 01:16
@dalg24 dalg24 force-pushed the harmonize_device_selection branch from 1b1a13d to 0c2eca6 Compare July 15, 2022 02:24
@dalg24 dalg24 force-pushed the harmonize_device_selection branch from 0c2eca6 to f2ffb32 Compare July 15, 2022 02:26
@dalg24 dalg24 added this to the Tentative 3.7 Release milestone Jul 15, 2022
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Testing current develop, the behavior for initializing SYCL seems as I intended it to be. If you are requesting a specific device it is assumed to be a GPU and we fail if no GPUs are available. This pull request changes that behavior to silently ignore the device id.
I don't necessarily think this change in behavior is a problem; we should just be conscious of it.

@dalg24
Copy link
Member Author

dalg24 commented Jul 15, 2022

Testing current develop, the behavior for initializing SYCL seems as I intended it to be. If you are requesting a specific device it is assumed to be a GPU and we fail if no GPUs are available. This pull request changes that behavior to silently ignore the device id.
I don't necessarily think this change in behavior is a problem; we should just be conscious of it.

I updated the PR to only consider the fallback when no device id was specified

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Now, this pull request changes the error message when requesting a specific device id when there are no GPUs from

terminate called after throwing an instance of 'std::runtime_error'
  what():  Requested GPU with id 0 but only 0 GPU(s) available!

to

Error: no GPU available for execution.

which is fine with me.

@dalg24 dalg24 merged commit 086f569 into kokkos:develop Jul 15, 2022
@dalg24 dalg24 deleted the harmonize_device_selection branch July 15, 2022 16:39
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.

None yet

3 participants