Skip to content

Specifying backend for device_context #100

Closed

Description

@diptorupd

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

Activity

  1. self-assigned this
    on Oct 5, 2020
  2. oleksandr-pavlyk commented on Oct 5, 2020

    @oleksandr-pavlyk
    Contributor

    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?

  3. 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.[/+] on Oct 7, 2020
  4. napetrov commented on Oct 13, 2020

    @napetrov

    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.

  5. oleksandr-pavlyk commented on Oct 16, 2020

    @oleksandr-pavlyk
    Contributor
  6. napetrov commented on Oct 16, 2020

    @napetrov

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

  7. oleksandr-pavlyk commented on Nov 16, 2020

    @oleksandr-pavlyk
    Contributor

    filter_selector is implemented in dpcpp b10, e.g.

    std::string filter_spec = "gpu";
    sycl::device d { sycl::ONEAPI::filter_selector(filter_spec) };
  8. diptorupd commented on Apr 16, 2021

    @diptorupd
    ContributorAuthor

    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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions