Skip to content

Print the backend as part of print_device_info. #409

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

Merged
merged 2 commits into from
May 4, 2021

Conversation

diptorupd
Copy link
Contributor

@diptorupd diptorupd commented Apr 28, 2021

Closes #293

Improvements to the print_*_info() functions in both C and Python APIs.

The print_device_info() function now prints the full filter string.

In [2]: d = dpctl.select_gpu_device()

In [3]: d.print_device_info()
    Name            Intel(R) UHD Graphics 630 [0x3e98]
    Driver version  1.0.19438
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0

The print_platform_info() function now supports verbosity levels that can be 0, 1, 2. The default verbosity level is set to 0.

In [5]: p = dpctl.get_platforms()[0]

In [6]: p.print_platform_info(verbosity=0)
Intel(R) FPGA Emulation Platform for OpenCL(TM) OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3

In [7]: p.print_platform_info(verbosity=1)
    Name        Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Version     OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1

In [8]: p.print_platform_info(verbosity=2)
    Name        Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Version     OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
      # 0
        Name                Intel(R) FPGA Emulation Device
        Version             2021.11.3.0.17_160000
        Filter string       opencl:accelerator:0

In [9]: p.print_platform_info()
Intel(R) FPGA Emulation Platform for OpenCL(TM) OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3

The behaviour of the lsplatform function is also modified. Verbosity levels are supported by this function as well and the default level is set to 0. The earlier level of detail is now only printed at verbosity level 2.

In [10]: dpctl.lsplatform()
Intel(R) FPGA Emulation Platform for OpenCL(TM) OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
Intel(R) OpenCL OpenCL 2.1 LINUX
Intel(R) OpenCL HD Graphics OpenCL 3.0 
Intel(R) OpenCL OpenCL 2.1 LINUX
Intel(R) Level-Zero 1.0
SYCL host platform 1.2

In [11]: dpctl.lsplatform(verbosity=0)
Intel(R) FPGA Emulation Platform for OpenCL(TM) OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
Intel(R) OpenCL OpenCL 2.1 LINUX
Intel(R) OpenCL HD Graphics OpenCL 3.0 
Intel(R) OpenCL OpenCL 2.1 LINUX
Intel(R) Level-Zero 1.0
SYCL host platform 1.2

In [12]: dpctl.lsplatform(verbosity=1)
Platform  0 ::
    Name        Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Version     OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
Platform  1 ::
    Name        Intel(R) OpenCL
    Version     OpenCL 2.1 LINUX
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
Platform  2 ::
    Name        Intel(R) OpenCL HD Graphics
    Version     OpenCL 3.0 
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
Platform  3 ::
    Name        Intel(R) OpenCL
    Version     OpenCL 2.1 LINUX
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
Platform  4 ::
    Name        Intel(R) Level-Zero
    Version     1.0
    Vendor      Intel(R) Corporation
    Backend     level_zero
    Num Devices 1
Platform  5 ::
    Name        SYCL host platform
    Version     1.2
    Vendor      unknown
    Backend     unknown
    Num Devices 1

In [13]: dpctl.lsplatform(verbosity=2)
Platform  0 ::
    Name        Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Version     OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
      # 0
        Name                Intel(R) FPGA Emulation Device
        Version             2021.11.3.0.17_160000
        Filter string       opencl:accelerator:0
Platform  1 ::
    Name        Intel(R) OpenCL
    Version     OpenCL 2.1 LINUX
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
      # 0
        Name                Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
        Version             2021.11.3.0.17_160000
        Filter string       opencl:cpu:0
Platform  2 ::
    Name        Intel(R) OpenCL HD Graphics
    Version     OpenCL 3.0 
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
      # 0
        Name                Intel(R) UHD Graphics 630 [0x3e98]
        Version             21.13.19438
        Filter string       opencl:gpu:0
Platform  3 ::
    Name        Intel(R) OpenCL
    Version     OpenCL 2.1 LINUX
    Vendor      Intel(R) Corporation
    Backend     opencl
    Num Devices 1
      # 0
        Name                Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
        Version             2021.11.3.0.17_160000
        Filter string       opencl:cpu:0
Platform  4 ::
    Name        Intel(R) Level-Zero
    Version     1.0
    Vendor      Intel(R) Corporation
    Backend     level_zero
    Num Devices 1
      # 0
        Name                Intel(R) UHD Graphics 630 [0x3e98]
        Version             1.0.19438
        Filter string       level_zero:gpu:0
Platform  5 ::
    Name        SYCL host platform
    Version     1.2
    Vendor      unknown
    Backend     unknown
    Num Devices 1
      # 0
        Name                SYCL host device
        Version             1.2
        Filter string       host:host:0

@oleksandr-pavlyk
Copy link
Contributor

Built, ran, got:

In [3]: dpctl.SyclDevice("gpu").print_device_info()
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.0.19310
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Backend         level_zero
    Device type     gpu

Perhaps it would be useful to combine Backend/Device_Type into fully specified filter selector string, kind of like in intel/llvm#3611, using our relative_id routine ?

@diptorupd
Copy link
Contributor Author

Perhaps it would be useful to combine Backend/Device_Type into fully specified filter selector string, kind of like in intel/llvm#3611, using our relative_id routine ?

Where is the relative_id routine? Makes sense to do it right the first time.

@oleksandr-pavlyk
Copy link
Contributor

Where is the relative_id routine? Makes sense to do it right the first time.

https://github.com/IntelPython/dpctl/blob/master/dpctl-capi/source/dpctl_sycl_device_manager.cpp#L198

@diptorupd diptorupd force-pushed the feature/print-backend-in-device-info branch from 00955bb to 68f20ac Compare May 1, 2021 05:47
@diptorupd
Copy link
Contributor Author

Where is the relative_id routine? Makes sense to do it right the first time.

https://github.com/IntelPython/dpctl/blob/master/dpctl-capi/source/dpctl_sycl_device_manager.cpp#L198

Done.

Diptorup Deb added 2 commits May 4, 2021 15:27
  - print_device_info now prints the filter string. Device type
    is no longer separately printed out. Device profile is not
    printed any more.
  - print_platform_info now has various verbosity levels to
    control amount of information that is printed.
@diptorupd diptorupd force-pushed the feature/print-backend-in-device-info branch from 68f20ac to bde3ff2 Compare May 4, 2021 20:36
@diptorupd diptorupd requested a review from oleksandr-pavlyk May 4, 2021 20:36
@diptorupd diptorupd merged commit 584449d into master May 4, 2021
@diptorupd diptorupd deleted the feature/print-backend-in-device-info branch May 4, 2021 21:35
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.

Improve the print info functions
2 participants