Skip to content

Support peer access DPC++ extension #2077

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 29 commits into from
May 15, 2025

Conversation

ndgrigorian
Copy link
Collaborator

This PR adds full support for the DPC++ sycl_ext_oneapi_peer_access extension

This adds a Python interface to calls that check if a dpctl.SyclDevice can enable peer access to another dpctl.SyclDevice and, if so, to enable or disable it.

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@ndgrigorian ndgrigorian force-pushed the feature/support-peer-access-extension branch from da9f596 to 20e80f1 Compare May 5, 2025 21:33
Copy link

github-actions bot commented May 5, 2025

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

Copy link

github-actions bot commented May 5, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_194 ran successfully.
Passed: 1109
Failed: 3
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented May 5, 2025

Coverage Status

coverage: 84.961% (-0.7%) from 85.626%
when pulling 7317df9 on feature/support-peer-access-extension
into 8718814 on master.

Copy link

github-actions bot commented May 6, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_194 ran successfully.
Passed: 1109
Failed: 3
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/support-peer-access-extension branch from 20e80f1 to a21d585 Compare May 6, 2025 23:47
Copy link

github-actions bot commented May 7, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_199 ran successfully.
Passed: 1107
Failed: 5
Skipped: 119

Copy link

github-actions bot commented May 7, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_200 ran successfully.
Passed: 1109
Failed: 3
Skipped: 119

Copy link

github-actions bot commented May 7, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_201 ran successfully.
Passed: 1108
Failed: 4
Skipped: 119

@ndgrigorian
Copy link
Collaborator Author

ndgrigorian commented May 9, 2025

Noting here that for future reference, we will probably need to document how this extension interacts with sub-devices and composite devices.

For example, per composite device documentation

Interaction with the default context

If the implementation supports the sycl_ext_oneapi_default_context extension, then each platform has the notion of a default context.
This default context contains only the platform’s root devices, which are those returned by platform::get_devices.
Any composite devices for the platform are not considered root devices, and thus the default context does not include these composite devices.
If an application wants a context that contains the composite devices, then it must explicitly create such a context.

this means that while the peer access methods will work between composite device and its component devices, and vice versa, to actually leverage it, the user needs to explicitly construct a context containing component and composite devices.

also make peer access invalid when the device and peer device are the same
Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_203 ran successfully.
Passed: 1105
Failed: 7
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/support-peer-access-extension branch from 04c424b to 5a92522 Compare May 12, 2025 22:12
@ndgrigorian ndgrigorian requested a review from antonwolfy May 12, 2025 22:13
@ndgrigorian ndgrigorian force-pushed the feature/support-peer-access-extension branch from 031cff1 to 629a4b4 Compare May 14, 2025 16:45
@ndgrigorian ndgrigorian requested a review from antonwolfy May 14, 2025 16:50
Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_213 ran successfully.
Passed: 1113
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_216 ran successfully.
Passed: 1113
Failed: 6
Skipped: 119

antonwolfy
antonwolfy previously approved these changes May 14, 2025
Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Thank you @ndgrigorian, no more comments from me

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_220 ran successfully.
Passed: 1114
Failed: 5
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/support-peer-access-extension branch from 85bcb7d to 56bd37f Compare May 14, 2025 22:37
@ndgrigorian ndgrigorian requested a review from antonwolfy May 14, 2025 22:39
@ndgrigorian
Copy link
Collaborator Author

@antonwolfy
made one more quick round of changes—combined the can_access_peer methods into one since extension defaults to access_supported anyway. This seems more convenient for users.

Take a look, it should have overall small impact on the implementation.

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_220 ran successfully.
Passed: 1111
Failed: 8
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_221 ran successfully.
Passed: 1114
Failed: 5
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_222 ran successfully.
Passed: 1113
Failed: 6
Skipped: 119

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

In overall LGTM, few small comments which might be address separately.

@ndgrigorian ndgrigorian enabled auto-merge May 15, 2025 21:37
@ndgrigorian ndgrigorian disabled auto-merge May 15, 2025 21:37
@ndgrigorian ndgrigorian merged commit 3d71288 into master May 15, 2025
72 of 86 checks passed
@ndgrigorian ndgrigorian deleted the feature/support-peer-access-extension branch May 15, 2025 21:37
@ndgrigorian
Copy link
Collaborator Author

Addressing other comments in follow-up

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