Skip to content
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] Use kernel bundles to query reduction work-group sizes #16009

Draft
wants to merge 3 commits into
base: sycl
Choose a base branch
from

Conversation

GeorgeWeb
Copy link
Contributor

Work-group sizes currently rely on device maximum rather than the max from a kernel query.
This changes aims to allow querying the kernels by using kernel bundles in the reduction implementations.
In order to do that, all kernel functions have to be defined as function objects and given unique names (for the kernel_ids), so they can be identified for a kernel_bundle to be obtained.

Additionally, the kernel_bundle can be used with the command group execution to ensure we exeucte the same kernel we queried. This has been added as an optional and can be user-configured via SYCL_REDUCTION_ENABLE_USE_KERNEL_BUNDLES=1|0. It is set to 0 by default, which means use_kernel_bundle is not called.

The goal of this is to be do kernel.get_info<kernel_device_specific> (i.e. work_group_size) queries, primarily to make sure that safe work-group sizes are chosen, but also for other capability queries which can be use for the implementations of the different kernel startegies.

@GeorgeWeb GeorgeWeb force-pushed the georgi/sycl-reduction-wg-size branch from 5b7d20a to f543115 Compare November 7, 2024 15:24
@GeorgeWeb GeorgeWeb force-pushed the georgi/sycl-reduction-wg-size branch from f543115 to 4e15b07 Compare November 7, 2024 15:32
@GeorgeWeb GeorgeWeb changed the title Use kernel bundles to query reduction work-group sizes [SYCL] Use kernel bundles to query reduction work-group sizes Nov 7, 2024
Work-group sizes currently rely on device maximum rather than the max from a kernel query.
This changes aims to allow querying the kernels by using kernel bundles in the reduction implementations.
In order to do that, all kernel functions have to be defined as function objects and given unique names
(for the `kernel_id`s), so they can be identified for a kernel_bundle to be obtained.

Additionally, the kernel_bundle can be used with the command group execution to ensure we exeucte the
same kernel we queried. This has been added as an optional and can be user-configured via
`SYCL_REDUCTION_ENABLE_USE_KERNEL_BUNDLES=1|0`.
It is set to 0 by default, which means `use_kernel_bundle` is not called.

The goal of this is to be do `kernel.get_info<kernel_device_specific>` (i.e. `work_group_size`) queries,
primarily to make sure that safe work-group sizes are chosen, but also for other capability queries which
can be use for the implementations of the different kernel startegies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant