-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] Add Level-Zero interop with specification of ownership for kernel and kernel_bundle. #4542
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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.
I have several comments about these APIs:
It seems like
make<kernel>()
might also need aze_module_handle_t
parameter. There is a SYCL APIkernel::get_kernel_bundle()
which returns the kernel bundle that contains akernel
. How will you implement this if you don't know the underlying Level Zero module handle?Both APIs should be more precise about the requirements of the
context
parameter. Formake<kernel_bundle>()
, I think it is required that theze_module_handle_t
be created from the same context. Likewise, formake<kernel>()
, I think it is required that theze_kernel_handle_t
come from a module that is created from thatcontext
.I think we probably need to document another requirement for
make<kernel_bundle>()
whenownership
istransfer
. Since the runtime takes ownership of the L0 handle in this case, I think the application must also promise not to have any outstandingze_kernel_handle_t
handles to the underlyingze_module_handle_t
. Otherwise, the runtime won't be able to deallocate thatze_module_handle_t
.The prototype for
make<kernel_bundle>
isn't correct becausekernel_bundle
is a template type. Instead, I think you want to saymake<kernel_bundle<bundle_state::executable>>
. You can then remove the wording in the description "and thus the SYCL program is created in the "linked" state" because this is clear from the prototype.The wording for
make<kernel_bundle>
should be updated: "Constructs a SYCL program instance". Instead say "Construct a SYCL kernel bundle instance".I also have a general word of caution about this API. We made a decision for the last release that this document should describe the existing API even thought it does not conform to the SYCL 2020 spec, with the understanding that we would update the extension document and the API implementation to conform "soon". We should do that sooner, rather than later. All of these APIs will end up getting deprecated because none of them conform to the spec, so it would be better to migrate to a conformant API before adding too many more additions. What do you think @smaslov-intel ?
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.
My recent commit #4512 makes all of the current Level-Zero interop following SYCL-2020 and deprecates prior functions. Update of https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md is WIP. Further additions like in this PR should follow SYCL-2020 from the beginning.