-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][DOC] Initial commit of oneapi extension proposal for adding P2P #6104
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
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
19bc35a
Initial commit of oneapi extension proposal for adding Peer-to-Peer m…
jbrodman 96ff0cc
Update based on feedback
jbrodman 164f462
Updates based on feedback, round 2
jbrodman 2eb8ff8
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman e3b12fc
Feedback vol 3
jbrodman 15e306d
Merge branch 'sycl' of github.com:intel/llvm into ext_p2p
jbrodman 410d806
fix merge
jbrodman d28af85
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman 0c4d39d
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman ab8625e
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman 006dd20
Adjust wording based on feedback and bump SYCL spec rev
jbrodman 2329d71
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman 232ce60
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_peer_access.asciidoc
jbrodman 549ce0d
Remove enabled query as it's uncclear any backend really supports it
jbrodman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
157 changes: 157 additions & 0 deletions
157
sycl/doc/extensions/proposed/sycl_ext_oneapi_p2p.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
= sycl_ext_oneapi_myextension | ||
|
||
:source-highlighter: coderay | ||
:coderay-linenums-mode: table | ||
|
||
// This section needs to be after the document title. | ||
:doctype: book | ||
:toc2: | ||
:toc: left | ||
:encoding: utf-8 | ||
:lang: en | ||
:dpcpp: pass:[DPC++] | ||
|
||
// Set the default source code type in this document to C++, | ||
// for syntax highlighting purposes. This is needed because | ||
// docbook uses c++ and html5 uses cpp. | ||
:language: {basebackend@docbook:c++:cpp} | ||
|
||
|
||
== Notice | ||
|
||
[%hardbreaks] | ||
Copyright (C) 2022-2022 Intel Corporation. All rights reserved. | ||
|
||
Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks | ||
of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by | ||
permission by Khronos. | ||
|
||
|
||
== Contact | ||
|
||
To report problems with this extension, please open a new issue at: | ||
|
||
https://github.com/intel/llvm/issues | ||
|
||
|
||
== Dependencies | ||
|
||
This extension is written against the SYCL 2020 revision 4 specification. All | ||
references below to the "core SYCL specification" or to section numbers in the | ||
SYCL specification refer to that revision. | ||
|
||
== Status | ||
|
||
This is a proposed extension specification, intended to gather community | ||
feedback. Interfaces defined in this specification may not be implemented yet | ||
or may be in a preliminary state. The specification itself may also change in | ||
incompatible ways before it is finalized. *Shipping software products should | ||
not rely on APIs defined in this specification.* | ||
|
||
|
||
== Overview | ||
|
||
This extension adds support for mechanisms to query and enable support for | ||
direct memory access between peer devices in a system. | ||
In particular, this allows one device to directly access USM Device allocations | ||
for a peer device. Peer to peer capabilities are useful as they can provide | ||
access to a peer device's memory inside a compute kernel and optimized memory | ||
copies between peer devices. | ||
|
||
== Specification | ||
|
||
=== Feature test macro | ||
|
||
This extension provides a feature-test macro as described in the core SYCL | ||
specification. An implementation supporting this extension must predefine the | ||
macro `SYCL_EXT_ONEAPI_P2P` to one of the values defined in the table | ||
below. Applications can test for the existence of this macro to determine if | ||
the implementation supports this feature, or applications can test the macro's | ||
value to determine which of the extension's features the implementation | ||
supports. | ||
|
||
[%header,cols="1,5"] | ||
|=== | ||
|Value | ||
|Description | ||
|
||
|1 | ||
|Initial version of this extension. | ||
|=== | ||
|
||
|
||
=== Peer to Peer (P2P) Memory Access APIs | ||
|
||
This extension adds support for mechanisms to query and enable support for | ||
direct memory access between peer devices in a system. | ||
In particular, this allows one device to directly access USM Device | ||
allocations for a peer device in the same context. | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Peer to peer capabilities are useful as they can provide access to a peer | ||
device's memory inside a compute kernel and also optimized memory copies between | ||
peer devices. | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This extension adds four new member functions to the device class, as described | ||
below. | ||
|
||
[source,c++] | ||
---- | ||
namespace sycl { | ||
namespace ext { | ||
namespace oneapi { | ||
enum class p2p_property { | ||
access_supported, | ||
atomics_supported | ||
}; | ||
} // namespace oneapi | ||
} // namespace ext | ||
|
||
class device { | ||
public: | ||
bool ext_oneapi_can_access_peer(const device &peer); | ||
void ext_oneapi_enable_peer_access(const device &peer); | ||
void ext_oneapi_disable_peer_access(const device &peer); | ||
int ext_oneapi_get_p2p_property(const device &peer, ext::oneapi::p2p_property value); | ||
}; | ||
|
||
} // namespace sycl | ||
---- | ||
|
||
The semantics of the new functions are: | ||
|
||
|=== | ||
| Member Function | Description | ||
|
||
| bool can_access_peer(device peer) | ||
| Queries if this device may directly access the peer device's memory. | ||
Returns true if direct access is supported. | ||
|
||
| void enable_peer_access(device peer) | ||
| Enables this device to access USM device allocations located on the peer | ||
device. This does not permit the peer device to access this device's memory. | ||
Throws an exception if access cannot be enabled or if access is already | ||
enabled. This device and the peer device must be in the same context. | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
| void disable_peer_access(device peer) | ||
| Disables access to the peer device's memory from this device. Throws an | ||
exception if access cannot be disabled or if access is not enabled. | ||
|
||
| int get_p2p_property(const device &peer, ext::oneapi::p2p_property value) | ||
| This method allows querying extra details about peer-to-peer connections | ||
between this device and the peer device. | ||
Valid properties are defined below. Backends may define additional | ||
backend-specific properties that may also be queried. | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|=== | ||
|
||
=== P2P Properties Query | ||
|
||
|=== | ||
| ext::oneapi::p2p_property::access_supported | ||
| Returns 1 if peer access is supported between this device and the peer device. | ||
Note that querying this property is similar to calling can_access_peer. | ||
|
||
| ext::oneapi::p2p_property::atomics_supported | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Returns 1 if peer access supports native atomic operations over the | ||
peer-to-peer link | ||
|=== | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.