Skip to content

Conversation

diptorupd
Copy link
Contributor

@diptorupd diptorupd commented Feb 18, 2021

Closes #146
Closes #248
Closes #313

Various improvements to device management.

  • Implements a _sycl_device_factory module to easily get the list of available devices in Python from SYCL.
  • Dpctl now creates a cache of devices and stores a context per device that may be reused to create queues for the device.

@diptorupd diptorupd force-pushed the feature/device_manager branch 3 times, most recently from 8849425 to e8a5068 Compare February 19, 2021 21:15
@oleksandr-pavlyk
Copy link
Contributor

This is not right:

In [1]: import dpctl

In [2]: dpctl.SyclDevice("gpu")
Out[2]: <dpctl.SyclDevice at 0x7fd76edb44b0>

In [3]: dpctl.SyclQueue(dpctl.SyclDevice("gpu"))
Out[3]: <dpctl._sycl_queue.SyclQueue at 0x7fd7641299b0>

In [4]: Out[3].get_sycl_device() # UNEXPECTED: expecting to see SyclDevice, like in Out[2], but getting None

In [5]: !git status
On branch feature/device_selectors
Your branch is up to date with 'dipto/feature/device_selectors'.

nothing to commit, working tree clean

In [6]: !git log -1 --format=%H
28022afb8df19f46a7e488677dfb6f13c988c802

@diptorupd
Copy link
Contributor Author

@oleksandr-pavlyk Needs more work. Something I did wrong results in get_devices() always returning all devices. I will look at it tomorrow, if you beat me to it and spot the issue let me know.

@diptorupd
Copy link
Contributor Author

@oleksandr-pavlyk I think this is good to go. Unfortunately the PR became way too huge than I had intended it to be, but will be great if you take a pass before we merge.

@diptorupd diptorupd force-pushed the feature/device_manager branch 12 times, most recently from 99bc335 to d7036d6 Compare March 4, 2021 04:20
Diptorup Deb added 8 commits March 3, 2021 22:21
  - Add a new dpctl_sycl_device_manager module to store a
    cache of root devices along with a cached context per
    device.
  - The device manager includes functions to get a vector of
    devices and the number of root devices of a specific type
    and backend combination.
  - Move the DPCTLDevice_DumpInfo() to a new module called
    dpctl_sycl_device_manager, and rename it to
    DPCTLDeviceMgr_PrintDeviceInfo().
  - Introduce a new _sycl_device_factory module in the Python API.
  - Move device selector functions to the _sycl_device_factory
    module.
  - Add functions to get list of SYCL devies in dpctl.
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

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

Commits from this PR are also included in feature/queue_manager_v2.

@diptorupd diptorupd merged commit 7219c50 into IntelPython:master Mar 8, 2021
@diptorupd diptorupd deleted the feature/device_manager branch March 8, 2021 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants