static void reorder_mul_mat_vec_q4_0_q8_1_sycl(const void * vx, const void * vy, float * dst, const int ncols,
const int nrows, dpct::queue_ptr stream) {
GGML_ASSERT(ncols % QK4_0 == 0);
- const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y);
- constexpr size_t num_subgroups = 16;
- GGML_ASSERT(block_num_y % num_subgroups == 0);
+ // Round up to a whole number of subgroup-sized workgroups; out-of-range rows are skipped inside the kernel.
+ constexpr size_t num_subgroups = WARP_SIZE;
+ const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y * (int) num_subgroups) * (int) num_subgroups;
const sycl::range<3> global_size(1, GGML_SYCL_MMV_Y, (block_num_y * WARP_SIZE));
const sycl::range<3> workgroup_size(1, GGML_SYCL_MMV_Y, num_subgroups * WARP_SIZE);
static void reorder_mul_mat_vec_q8_0_q8_1_sycl(const void * vx, const void * vy, float * dst, const int ncols,
const int nrows, dpct::queue_ptr stream) {
GGML_ASSERT(ncols % QK8_0 == 0);
- const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y);
- constexpr size_t num_subgroups = 16;
- GGML_ASSERT(block_num_y % num_subgroups == 0);
+ // Round up to a whole number of subgroup-sized workgroups; out-of-range rows are skipped inside the kernel.
+ constexpr size_t num_subgroups = WARP_SIZE;
+ const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y * (int) num_subgroups) * (int) num_subgroups;
const sycl::range<3> global_size(1, GGML_SYCL_MMV_Y, (block_num_y * WARP_SIZE));
const sycl::range<3> workgroup_size(1, GGML_SYCL_MMV_Y, num_subgroups * WARP_SIZE);
const int nrows, dpct::queue_ptr stream) {
GGML_ASSERT(ncols % QK_K == 0);
- const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y);
- constexpr size_t num_subgroups = 16;
- GGML_ASSERT(block_num_y % num_subgroups == 0);
+ // Round up to a whole number of subgroup-sized workgroups; out-of-range rows are skipped inside the kernel.
+ constexpr size_t num_subgroups = WARP_SIZE;
+ const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y * (int) num_subgroups) * (int) num_subgroups;
const sycl::range<3> global_size(1, GGML_SYCL_MMV_Y, block_num_y * WARP_SIZE);
const sycl::range<3> workgroup_size(1, GGML_SYCL_MMV_Y, num_subgroups * WARP_SIZE);
static void reorder_mul_mat_vec_q6_k_q8_1_sycl(const void * vx, const void * vy, float * dst, const int ncols,
const int nrows, dpct::queue_ptr stream) {
GGML_ASSERT(ncols % QK_K == 0);
- const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y);
- constexpr size_t num_subgroups = 16;
- GGML_ASSERT(block_num_y % num_subgroups == 0);
+ // Round up to a whole number of subgroup-sized workgroups; out-of-range rows are skipped inside the kernel.
+ constexpr size_t num_subgroups = WARP_SIZE;
+ const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y * (int) num_subgroups) * (int) num_subgroups;
const sycl::range<3> global_size(1, GGML_SYCL_MMV_Y, block_num_y * WARP_SIZE);
const sycl::range<3> workgroup_size(1, GGML_SYCL_MMV_Y, num_subgroups * WARP_SIZE);