-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[GPU] choose kernel compile option for work_group_(OPS) #30162
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
[GPU] choose kernel compile option for work_group_(OPS) #30162
Conversation
src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp
Outdated
Show resolved
Hide resolved
if (engine_info.supports_work_group) | ||
kernel_string->options += " -cl-std=CL3.0"; | ||
else | ||
kernel_string->options += " -cl-std=CL2.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.
Why should the support/implementation of some feature affect the kernel's OpenCL version?
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.
OpenCL_C::unified-spec
the opencl_c<feature_name> feature: Features that were introduced in OpenCL C 2.0 as mandatory, but made optional in OpenCL C 3.0.
On Elkhart Lake(Legacy platform), OpenCL C 3.0 is working but work_group APIs are not supported.
OpenCL C 2.0 includes work_group_ on EHL.
@@ -388,6 +388,7 @@ struct EngineInfo { | |||
bool enable_sub_groups_emulation = false; | |||
bool bOptHintsSupport = false; | |||
bool supports_microkernels = false; | |||
bool supports_work_group = false; |
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.
[random spot]
We have KernelBase::get_required_device_features_key()
function, I suppose this work_group functions should be exposed as an independent option and considering during kernel selection
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 is a good idea. The only ref kernel that requires workgroup collective feature is dynamic_quantize_gpu_ref.cl, and I think we can disable dynamic quantize if the collective function is not supported.
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'll apply work_group to 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.
If not support_work_group_collective_func, it selects '-cl-std=CL2.0' for kernel build. OpenCL 2.0 supports work_group_ API.
Other issues can be made if it just disables kernels use work_group_ API.
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.
@sungeunk, does it mean that some device/runtime fully supports OpenCL 2.0 (including its required features such as work_group_* functions), but also supports OpenCL 3.0, where these features are reported as unsupported?
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.
@sshlyapn Support varies depending on the opencl version used when compiling the kernel.
Legacy platform (ex. Gen11) | New platform (ex. UHD 770) | |
---|---|---|
CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT | false | true |
work_group_ API at OpenCL 2.0 (runtime) | working | working |
work_group_ API at OpenCL 3.0 (runtime) | not working | working |
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.
@sungeunk, let's discuss it with the driver team first
-rename to supports_work_group_collective_functions -supports_work_group is true if CL_HPP_TARGET_OPENCL_VERSION is 200
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
135b624
Tickets: