Skip to content

Commit 533abed

Browse files
jeffbolznv0cc4m
andcommitted
update heuristic for amd/intel
Co-authored-by: 0cc4m <[email protected]>
1 parent b1c79bf commit 533abed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,7 +2783,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
27832783
uint32_t wg_size_subgroup16 = (w == DMMV_WG_SIZE_SUBGROUP) ? subgroup_size_16 : (subgroup_size_16 * 4);
27842784
uint32_t wg_size_subgroup = (w == DMMV_WG_SIZE_SUBGROUP) ? device->subgroup_size : (device->subgroup_size * 4);
27852785

2786-
bool s = device->subgroup_add;
2786+
const bool s = device->subgroup_add && device->architecture != vk_device_architecture::AMD_GCN;
27872787

27882788
for (uint32_t i = 0; i < mul_mat_vec_max_cols; ++i) {
27892789
ggml_vk_create_pipeline(device, device->pipeline_dequant_mul_mat_vec_f32_f32[w][GGML_TYPE_F32 ][i], "mul_mat_vec_f32_f32_f32_"+std::to_string(w)+"_"+std::to_string(i+1), arr_dmmv_f32_f32_f32_len[s], arr_dmmv_f32_f32_f32_data[s], "main", 3, sizeof(vk_mat_vec_push_constants), {2, 1, 1}, {wg_size_subgroup, 2, i+1}, 1);
@@ -4438,7 +4438,7 @@ static vk_pipeline ggml_vk_get_dequantize_mul_mat_vec(ggml_backend_vk_context *
44384438

44394439
// heuristic to choose workgroup size
44404440
uint32_t dmmv_wg = DMMV_WG_SIZE_SUBGROUP;
4441-
if (ctx->device->vendor_id == VK_VENDOR_ID_NVIDIA) {
4441+
if (ctx->device->vendor_id == VK_VENDOR_ID_NVIDIA || ctx->device->vendor_id == VK_VENDOR_ID_INTEL) {
44424442
// Prefer larger workgroups when M is small, to spread the work out more
44434443
// and keep more SMs busy.
44444444
// q6_k seems to prefer small workgroup size even for "medium" values of M.

0 commit comments

Comments
 (0)