-
Notifications
You must be signed in to change notification settings - Fork 808
[SYCL][CUDA] Implement sycl_ext_oneapi_peer_access extension #8303
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 80 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
5d788c6
[SYCL][CUDA] Decouple CUDA contexts from PI contexts
npmiller 8685475
[SYCL][CUDA] Move deprecation warning to class
npmiller de16f88
Initial P2P impl.
b5f9481
added ext_oneapi_disable_peer_access and ext_oneapi_can_access_peer.
JackAKirk 64ecf25
Introduced pi_peer_attr.
15d4bf6
Format.
a35294f
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk df55a69
Format.
JackAKirk ddca3c3
Format.
JackAKirk c3a2009
Format.
JackAKirk f0f448d
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk 1855367
Corrected hip pi die function.
JackAKirk 644c880
Added esimd p2p pi functions.
JackAKirk e5b421e
fix mistake in last commit.
JackAKirk 6f45d53
corrected pi function names.
JackAKirk 1849619
format.
JackAKirk aa7a7eb
Update sycl/plugins/cuda/pi_cuda.cpp
JackAKirk 3380230
Update sycl/plugins/level_zero/pi_level_zero.cpp
JackAKirk 5f6360c
Early exit in ext_oneapi_can_access_peer
JackAKirk e33a578
Switched piextCanAccessPeer to more general piextPeerAccessGetInfo.
JackAKirk 32d714a
format.
JackAKirk 7d12cd7
Added unittest, fixed hip pi names.
JackAKirk 4cf5999
Format.
JackAKirk 63f23e5
Add missing abi symbols to test.
JackAKirk aaec286
Update l0 abi test.
JackAKirk 76245f2
Corrected die error messages.
JackAKirk 55a9b6a
cleanup test.
JackAKirk 80dfb3a
Add global var check that pi is reached.
JackAKirk 76f6772
Format.
JackAKirk 85949f7
Fix copy/paste error.
JackAKirk 65aa452
trying to scope up meaningful error mech.
JackAKirk ea7e855
added some comments.
JackAKirk eae9b12
working impl throwing exceptions in all backends.
JackAKirk c825b9c
remove comments.
JackAKirk ae358bb
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk ce81826
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk 72aca2e
format.
JackAKirk c2579aa
fixes for recent sycl branch changes.
JackAKirk 0c87405
Format.
JackAKirk dfcb01c
Added P2P USM tests.
JackAKirk b84da4d
Update sycl/source/device.cpp
JackAKirk 9e5408b
Address review comments.
JackAKirk 57c5747
Just use Plugin::call.
JackAKirk 029c1fe
Remove trace checks CI doesn't support.
JackAKirk 8d41240
Added comments, updating namings.
JackAKirk b86954d
Added windows symbols.
JackAKirk a6f7602
Refactor common code.
JackAKirk cc5eb63
Format.
JackAKirk 716bf30
Some final corrections.
JackAKirk 484cf25
Format.
JackAKirk 333b7d6
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk 308f45a
Correct version comment order.
JackAKirk 8b8cbc8
Merge branch 'sycl' into P2P-primary-ctxt
b2b6fcb
Removed broken error message.
2bea80b
Addressed review comments.
04b8610
Format.
d0b138c
Try UR invalid value error.
3e488c4
Stated return type of queries in comment.
c1905c6
Merge branch 'sycl' into P2P-primary-ctxt
19d2a7d
Integrate UR usm-p2p interfaces.
f2a2026
Attempt to fix getLastError.
37aecb1
Switch to UR_CHECK_ERROR usage.
JackAKirk e80ff9b
Format.
JackAKirk 8956f50
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk b987dba
RT:: -> sycl::detail::pi::
JackAKirk 6724a40
u_int32_t -> uint32_t
JackAKirk 69a6506
Removed unnecessary includes.
JackAKirk 11ca2a6
Merge branch 'sycl' into P2P-primary-ctxt
8b9c2ab
PI_ERROR_UNKNOWN -> return PI_ERROR_INVALID_VALUE
0a09023
Merge branch 'sycl' into P2P-primary-ctxt
f1eb0f0
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk 40e93d0
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk e5e967f
Conflict fix.
JackAKirk 92e1420
Merge branch 'sycl' into P2P-primary-ctxt
JackAKirk f0993b9
Reverted pi2ur.hpp due to problem diff.
JackAKirk 28028ac
same as last commit.
JackAKirk 6ed3213
Added back peer functions to pi2ur.
JackAKirk 512d2a8
Removed unnecessary usm_p2p.hpp headers.
JackAKirk 1e088a1
Removed level_zero pi::die impl.
JackAKirk 80dd26a
Format.
JackAKirk 9dc099c
Added missing inline and urPrint.
JackAKirk b191914
Format.
JackAKirk 5d83aeb
Format.
JackAKirk c389980
Moved p2p ext doc to supported.
JackAKirk 8bd6b60
Added Backend support status, updated status.
5e7d821
Updated sycl 2020 revision version.
ab3ac25
Switch to Greg's suggested wording.
47acd23
Use code font for function name.
4ab6215
Merge branch 'sycl' into P2P-primary-ctxt
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
|---|---|---|
|
|
@@ -98,6 +98,20 @@ thread_local char ErrorMessage[MaxMessageSize]; | |
| ErrorMessageCode = ErrorCode; | ||
| } | ||
|
|
||
| void setPluginSpecificMessage(CUresult cu_res) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: since this cannot yet be used due to the recent bug: #10066 , I could remove it from the PR. However it will be added later anyway so I see no harm in including it here. |
||
| const char *error_string; | ||
| const char *error_name; | ||
| cuGetErrorName(cu_res, &error_name); | ||
| cuGetErrorString(cu_res, &error_string); | ||
| char *message = (char *)malloc(strlen(error_string) + strlen(error_name) + 2); | ||
| strcpy(message, error_name); | ||
| strcat(message, "\n"); | ||
| strcat(message, error_string); | ||
|
|
||
| setErrorMessage(message, UR_RESULT_ERROR_ADAPTER_SPECIFIC); | ||
| free(message); | ||
| } | ||
|
|
||
| // Returns plugin specific error and warning messages; common implementation | ||
| // that can be shared between adapters | ||
| ur_result_t urGetLastResult(ur_platform_handle_t, const char **ppMessage) { | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to define the returned value (and type) for these queries, is it pi_bool aka uint32_t?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the definition of
cuDeviceGetP2PAttributehere : https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g4c55c60508f8eba4546b51f2ee545393This function is used to get the query result. Although currently we only support queries which can be represented as booleans there is e.g.
CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANKwhich returns a relative integer value. This is why the return type is integer and not bool for future proofing.L0 backend should decide whether it also will require such attributes at some point, and then whether SYCL (and in turn UR) will want to support them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with it being integer, but ask this to be documented (comments in pi.h)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I forgot the to document the return type. I will do this now. Note that this is a comment so won't affect the test status of this PR that is all green (everything passing.)