-
Notifications
You must be signed in to change notification settings - Fork 794
Add sycl ext intel kernel queries extension #16834
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
Add sycl ext intel kernel queries extension #16834
Conversation
sycl/doc/extensions/proposed/sycl_ext_intel_kernel_queries.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/proposed/sycl_ext_intel_kernel_queries.asciidoc
Outdated
Show resolved
Hide resolved
sycl/source/detail/kernel_info.hpp
Outdated
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.
Is it possible to check for the aspect here as well?
sycl/source/detail/kernel_info.hpp
Outdated
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.
The mapping to devices relies on UR providing the same order within a single application (see oneapi-src/unified-runtime#2614 for details). There was a problem inside UR implementation that demanded the API to return an array of values for spills instead of a single value (due to device pointer unavailability). This implementation hides that inconvenience from SYCL users.
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.
Fixed in UR v1 adapter
sycl/source/detail/kernel_info.hpp
Outdated
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.
Is this the right type of exception?
sycl/test-e2e/Basic/kernel_info.cpp
Outdated
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.
There might be a better way to test the thing. This would just return zero. Any suggestions?
|
Hi @kurapov-peter, I hope you don't mind, but I pushed a commit with my proposal for how the specification should look in b027f870d67e035e6476dc0a84bc3f5dfddbf99f. Feel free to revert this commit if you are opposed, or to add comments in this PR. Here is my rationale for some of the changes:
Note that I did not update the implementation, so that will need to be changed to match the spec. |
|
All the changes look reasonable to me. I'll update the implementation. |
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.
Is L0 important here?
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.
Normally, we would not define a SYCL API in terms of a particular backend like this. However, it seemed to me that "spill memory size" is too vaguely defined. The reality is that SYCL is just returning whatever value comes from Level Zero. If people have questions about what it means, I'd rather direct them to Level Zero.
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.
fair enough
|
#16810 is merged, so this has no dependencies. Putting it to ready for review. |
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 doubt that this line has any effect on the test, so you may as well drop it. Moreover, I'm not sure what are the rules of redefining metadata, it may not be a valid change at all
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.
Yep, I agree with @AlexeySachkov on behalf of sanitizer reviewer.
sycl/test-e2e/Basic/kernel_info.cpp
Outdated
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.
This should be hidden under an if, the query is not guaranteed to be supported everywhere. The same goes for other change in this file.
|
@Pennycook could you review this for @intel/dpcpp-specification-reviewers ? I'm the author of the spec in this PR. |
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.
Specification looks good, but a meta-comment: if we're going to have to end up exposing all the Level Zero kernel queries, it might be a good idea to just provide a single way to query things using the Level Zero enums and/or backend interop.
Why don't we push for that right now?
This needs an update, I assume |
ed41dfc to
7402507
Compare
This adds a
sycl_ext_intel_kernel_queriesextension for target-specific low-level information retrieval. In a nutshell, the extension adds compiled kernel traits for the intel backend. The traits can be queried using the usualkernel::get_info()calls (andget_kernel_info). Each query gets its own aspect to tell whether the query is supported on the device. This PR addsext_intel_spill_memory_sizeaspect and an implementation for querying the spilled memory size as reported by L0.