Skip to content

Conversation

@GeorgeWeb
Copy link
Contributor

@GeorgeWeb GeorgeWeb commented Nov 7, 2024

Problem statement
Work-group sizes currently rely on device maximum rather than the max from a kernel query.

Changes overview
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.

End Goal
The goal of this is to be able to do kernel.get_info<kernel_device_specific::<query_value_here>> (i.e. work_group_size) queries, primarily to make sure that safe work-group sizes (not device maximums but kernel maximums) are chosen. This will also benefit us with querying other kernel-device-specific capabilities which can be used for implementing (or optimizing) the different kernel strategies to be as efficient as possible.

@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
@GeorgeWeb GeorgeWeb force-pushed the georgi/sycl-reduction-wg-size branch from 4e15b07 to cbdd5bb Compare November 7, 2024 15:49
@GeorgeWeb GeorgeWeb force-pushed the georgi/sycl-reduction-wg-size branch from ff69fef to 01aafd3 Compare November 8, 2024 11:24
@omarahmed1111 omarahmed1111 force-pushed the georgi/sycl-reduction-wg-size branch from 5e99a28 to cc63f30 Compare November 15, 2024 17:37
@omarahmed1111 omarahmed1111 force-pushed the georgi/sycl-reduction-wg-size branch from cc63f30 to 6d92aa0 Compare January 6, 2025 10:14
Georgi Mirazchiyski and others added 6 commits January 6, 2025 11:37
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.
@omarahmed1111 omarahmed1111 force-pushed the georgi/sycl-reduction-wg-size branch from 6d92aa0 to 1f246bf Compare January 6, 2025 11:37
@omarahmed1111 omarahmed1111 force-pushed the georgi/sycl-reduction-wg-size branch from 1f246bf to fc94f20 Compare January 6, 2025 14:38
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.

2 participants