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

Service improvements #1508

Merged
merged 3 commits into from
Jan 29, 2024
Merged

Service improvements #1508

merged 3 commits into from
Jan 29, 2024

Conversation

oleksandr-pavlyk
Copy link
Collaborator

dpctl/__main__.py no longer triggers loading of libsycl library for queries

python -m dpctl --includes will no longer load SYCL runtime libraries.

Module file acquired three more options

  --include-dir
  --tensor-include-dir
  --library-dir

This would output absolute path to directory of include headers,
tensor include headers, and directory containing DPCTLSyclInterface
library.

FindDpctl.cmake has been renamed to dpctl-config.cmake.

This PR also installs dpctl-config.cmake to ${PREFIX}/lib/cmake folder, making find_package(Dpctl) work out of the box with dpctl installed in the Python environment.

With local build of dpctl, downstream projects can hint CMake to finding Dpctl package by
using standard mechanism:

-DDpctl_ROOT=$(python -m dpctl --cmakedir)
  • 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?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

…ueries

`python -m dpctl --includes` will no longer load SYCL runtime libraries.

Module file acquired three more options

   --include-dir
   --tensor-include-dir
   --library-dir

This would output absolute path to directory of include headers,
tensor include hedaers, and directory containing DPCTLSyclInterface
library.

`FindDpctl.cmake` has been renamed to `dpctl-config.cmake`. This
allows downstream objects to hint CMake to finding Dpctl package by
using standard mechanism:

`-DDpctl_ROOT=$(python -m dpctl --cmakedir)`
Update comments in dpctl-config.cmake
Copy link

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_34 ran successfully.
Passed: 908
Failed: 1
Skipped: 86

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.039% (+0.07%) from 90.974%
when pulling 6e30b84 on service-improvements
into 8f82fe1 on master.

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_35 ran successfully.
Passed: 908
Failed: 1
Skipped: 86

@antonwolfy
Copy link
Collaborator

I've checked find_package(Dpctl) out of the box, without defining any DPCTL_MODULE_PATH flag, and it works fine in dpnp.

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

I have tested building extensions with these changes, and using -DDpctl_ROOT=$(python -m dpctl --cmakedir)

It works for me out of the box, so LGTM

@oleksandr-pavlyk
Copy link
Collaborator Author

oleksandr-pavlyk commented Jan 29, 2024

It turns out python -m dpctl --include-dir does trip loading of DPCTLSyclInterface and libsycl.so.*. This is because python -m dpctl effectively does import dpctl.__main__ and this imports dpctl.__init__ which triggers loading of libDPCTLSyclInterface.

To accomplish running queries like --include-dir without loading libsycl requires creating a stand-alone helper package, dpctl_info, and requiring users to do python -m dpctl_info --include-dir instead. This is a task for another PR though, if this is to be accomplished at all @napetrov

@oleksandr-pavlyk oleksandr-pavlyk merged commit 16a9c81 into master Jan 29, 2024
45 of 49 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the service-improvements branch January 29, 2024 22:31
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.

4 participants