-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][ABI] Subgroup Extension spec update #1600
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
[SYCL][ABI] Subgroup Extension spec update #1600
Conversation
sycl/plugins/opencl/pi_opencl.cpp
Outdated
if (ret_err != CL_SUCCESS) | ||
return cast<pi_result>(ret_err); | ||
|
||
*((uint32_t *)param_value) = (uint32_t)ret_val; |
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 OpenCL returns "size_t", why are you truncating this to 32-bit? If really needed (I don't think it is) we should document this for piKernelGetSubGroupInfo
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 return type of the get_sub_group_info APIs have been changed to return uint32_t data instead of size_t, which is why this change was done. How should this be documented?
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.
Add a comment in the pi.h for piKernelGetSubGroupInfo to indicated now supported parameters with their sizes.
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.
But I suggest that we continue to use "size_t" in PI, and truncate at SYCL level.
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.
Why is that?
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 made the call to PI_API check the returned size of the result value and truncate the value appropriately. Does this look better?
I'm essentially hesitant to make it size_t based on OpenCL spec, because if any new backend is developed based on the SYCL extension spec, it will have to change the Plugin to cast the uint32_t to size_t first, and then in the library will be casting the size_t to uint32_t. It will be weird that the PI APIs are not SYCL extension spec compliant.
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'm essentially hesitant to make it size_t based on OpenCL spec
I'd be fine making it uint32_t
in PI, document this in the pi.h, and truncate in OpenCL plugin.
But we should stick to just one size that fits SYCL well.
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.
@smaslov-intel : Do you mean the initial solution was ok with the document change?
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.
Yes, I'd be fine with it.
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.
Thanks. I have updated the review. Let me know if it looks good.
102c7eb
to
11bcbd9
Compare
@smaslov-intel Ping. |
eac4935
to
ac04c3f
Compare
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.
ac04c3f
to
602c90f
Compare
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.
LGTM
https://github.com/intel/llvm/blob/sycl/sycl/doc/ABIPolicyGuide.md |
e083664
to
b4c6d7b
Compare
Thank you for the link @alexbatashev . Let me know if I have missed something. I have updated the Major version, the ABI version and the PR commit message. |
@@ -8,10 +8,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) | |||
option(SYCL_ENABLE_WERROR "Treat all warnings as errors in SYCL project" OFF) | |||
option(SYCL_ADD_DEV_VERSION_POSTFIX "Adds -V postfix to version string" ON) | |||
|
|||
set(SYCL_MAJOR_VERSION 0) | |||
set(SYCL_MAJOR_VERSION 1) |
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.
@garimagu the major version is updated once per release. You only need to update DEV_ABI version.
set(SYCL_MAJOR_VERSION 1) | |
set(SYCL_MAJOR_VERSION 0) |
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.
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.
uploaded the change. please review and approve. smaslov-intel has approved the changes other than the ABI version update.
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 think we should (semi-)automate SYCL version update.
It's hard to manage multiple commits requiring version update.
@alexbatashev, could you create a post-commit job, which will create a PR with the version update if it's required, please?
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.
@bader I'll take a look into it
Implements the change as per the spec update at https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/SubGroup/SYCL_INTEL_sub_group.asciidoc and update from : intel#1565 ABI update: Functions corresponding to the deleted APIs have been deleted. Edit info.cpp test to expect max sub-group size based on the spec update. Changed pi.h document and changed the plugin to always return a 32 bit value. ABI version update. Signed-off-by: Garima Gupta <garima.gupta@intel.com>
cee31e8
to
21c9f6f
Compare
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
@bader Please approve and merge. |
Waiting on code owner review from smaslov-intel and/or intel/llvm-reviewers-runtime. |
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.
LGTM. A few minor suggestions.
template <info::kernel_sub_group Param> struct get_kernel_sub_group_info { | ||
static uint32_t get(RT::PiKernel Kernel, RT::PiDevice Device, | ||
const plugin &Plugin) { | ||
uint32_t Result; | ||
// TODO catch an exception and put it to list of asynchronous exceptions |
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.
// TODO catch an exception and put it to list of asynchronous exceptions |
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.
Should this comment be removed?
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.
AFAIK, this comment is not valid anymore. Most of the errors now reported through synchronous exceptions.
Although, I'm not the owner of the runtime and let @intel/llvm-reviewers-runtime to decide.
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
@bader uploaded the changes. smaslov has also approved the changes just before the suggested changes were merged. |
@bader ping |
…ctoring [L0] Refactoring of boolean event parameters
[L0] Refactoring of boolean event parameters
Implements the change as per the spec update at
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/SubGroup/SYCL_INTEL_sub_group.asciidoc
and update from : #1565
ABI update: Symbols corresponding to the deleted APIs have been deleted.
Signed-off-by: Garima Gupta garima.gupta@intel.com