Skip to content

Specifying backend for device_context #100

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

Closed
diptorupd opened this issue Oct 5, 2020 · 6 comments
Closed

Specifying backend for device_context #100

diptorupd opened this issue Oct 5, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@diptorupd
Copy link
Contributor

diptorupd commented Oct 5, 2020

Is it possible to set only "gpu" ? Is it possible to select default backend?

Originally posted by @PokhodenkoSA in #93 (comment)

Another thing that I have concerns this – API device_context('opencl:gpu:0')
As user I don’t want to select backend or gpu device unless I would like to do so. And currently this are mandatory params. Even with DPC++ runtime i’m not providing such level of details – so I assume I shouldn’t do this in python as well.

Originally posted by @napetrov

Another point about specifying backend:
For now, we have to specify “OpenCL” backend if we run on CPU. But in oneDAL, we have no OpenCL dependency for CPU computations – we run native code. I think it’s incorrect to specify “OpenCL” backend in such cases where you don’t know what the actual backend will be used – why we need to specify it?
The same case for MKL – they run native GEN9-12 assembly on GPUs – I’m not sure we can specify “opencl” or “level0” backend here.
And what should the library do if the requested backend does not match the way how device support is implemented inside? Check backend type and throw an exception?

Originally posted by @michael-smirnov

what’s about the host device on the dpctl side, which do not require to have any backend installed? I did not find this in your sources.

Originally posted by @michael-smirnov

Related: #131

@oleksandr-pavlyk
Copy link
Contributor

oleksandr-pavlyk commented Oct 5, 2020

Should it be the default based on behavior of SYCL's device selector for the specified group of devices? For example for gpu devices we will rank all GPU devices based on the score provided by cl:sycl::gpu_selector, and use the back-end associated with the the selected device?

@diptorupd diptorupd changed the title Allow users to speficy a default backend when selecting a device_context. Allow users to specify a default backend when selecting a device_context. Oct 7, 2020
@napetrov
Copy link

Comment on default behavior - the assumption is that in case just gpu device selected we are are not mapping to particular device underneath or doing some sort of round robin dispatching - compiler runtime is capable of doing dispatching assuming internal load balancing across devices - so i would say this should be done in similar way.

@oleksandr-pavlyk
Copy link
Contributor

Please see SYCL extension proposal for filter selectors: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/FilterSelector/FilterSelector.adoc

@napetrov
Copy link

I think most important part - "Every element of the triple is optional, but a filter must contain at least one component."

@oleksandr-pavlyk
Copy link
Contributor

filter_selector is implemented in dpcpp b10, e.g.

std::string filter_spec = "gpu";
sycl::device d { sycl::ONEAPI::filter_selector(filter_spec) };

@diptorupd
Copy link
Contributor Author

Closing as we now support filter selectors in device_context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants