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

Fixed filter-selector-string output by lsplatform and print_device_info #866

Merged

Conversation

oleksandr-pavlyk
Copy link
Collaborator

SYCLInterface library functions used std::to_string(sycl::backend d.get_platform().get_backend()) to produce backend section of the filter selector. Correspondingly they produced invalid strings like "ext_oneapi_level_zero:gpu:0" where "level_zero:gpu:0" was expected.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?

For example, now:

Platform  3 ::
    Name        Intel(R) Level-Zero
    Version     1.3
    Vendor      Intel(R) Corporation
    Backend     ext_oneapi_level_zero
    Num Devices 1
      # 0
        Name                Intel(R) UHD Graphics [0x9bca]
        Version             1.3.23750
        Filter string       level_zero:gpu:0

While previously the filter string was "ext_oneapi_level_zero:gpu:0".

Similar change for print_device_info:

$ SYCL_FILTER_SELECTOR=level python -c "import dpctl; dpctl.SyclDevice().print_device_info()"
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.3.23750
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0

Previously the filter string used to be "ext_oneapi_level_zero:gpu:0".

@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Jul 26, 2022

Coverage Status

Coverage decreased (-0.06%) to 81.529% when pulling 7b5b4c1 on fix-filter-string-construction-in-lsplatform into 299bd7e on master.

@oleksandr-pavlyk
Copy link
Collaborator Author

Even though SYCL_DEVICE_FILTER does recognize ext_oneapi_level_zero as backend, the DPCTL does not:

In [1]: import dpctl

In [2]: dpctl.SyclDevice("level_zero:gpu:0")
Out[2]: <dpctl.SyclDevice [backend_type.level_zero, device_type.gpu,  Intel(R) UHD Graphics [0x9bca]] at 0x7f3f6ed76cf0>

In [3]: dpctl.SyclDevice("ext_oneapi_level_zero:gpu:0")
---------------------------------------------------------------------------
SyclDeviceCreationError                   Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 dpctl.SyclDevice("ext_oneapi_level_zero:gpu:0")

File ~/repos/dpctl/dpctl/_sycl_device.pyx:293, in dpctl._sycl_device.SyclDevice.__cinit__()
    291 ret = self._init_from_selector(DSRef)
    292 if ret == -1:
--> 293     raise SyclDeviceCreationError(
    294         "Could not create a SyclDevice with the selector string"
    295     )

SyclDeviceCreationError: Could not create a SyclDevice with the selector string

For example, now:

```
Platform  3 ::
    Name        Intel(R) Level-Zero
    Version     1.3
    Vendor      Intel(R) Corporation
    Backend     ext_oneapi_level_zero
    Num Devices 1
      # 0
        Name                Intel(R) UHD Graphics [0x9bca]
        Version             1.3.23750
        Filter string       level_zero:gpu:0
```

While previously the filter string was "ext_oneapi_level_zero:gpu:0".

Similar change for print_device_info:

```
$ SYCL_FILTER_SELECTOR=level python -c "import dpctl; dpctl.SyclDevice().print_device_info()"
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.3.23750
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0
```

Previously the filter string used to be "ext_oneapi_level_zero:gpu:0".
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the fix-filter-string-construction-in-lsplatform branch from cb80117 to 7b5b4c1 Compare July 27, 2022 03:14
@oleksandr-pavlyk oleksandr-pavlyk changed the title Fixed filter-selector-string output by lspltform and print_device_info Fixed filter-selector-string output by lsplatform and print_device_info Jul 27, 2022
@oleksandr-pavlyk
Copy link
Collaborator Author

Ok, I've addressed @diptorupd feedback. Merging now.

@oleksandr-pavlyk oleksandr-pavlyk merged commit c09ac88 into master Jul 28, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-filter-string-construction-in-lsplatform branch July 28, 2022 15:08
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

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.

3 participants