Skip to content

Commit ffdc091

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

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
@@ -2790,7 +2790,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
27902790
uint32_t wg_size_subgroup16 = (w == DMMV_WG_SIZE_SUBGROUP) ? subgroup_size_16 : (subgroup_size_16 * 4);
27912791
uint32_t wg_size_subgroup = (w == DMMV_WG_SIZE_SUBGROUP) ? device->subgroup_size : (device->subgroup_size * 4);
27922792

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

27952795
for (uint32_t i = 0; i < mul_mat_vec_max_cols; ++i) {
27962796
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);
@@ -4430,7 +4430,7 @@ static vk_pipeline ggml_vk_get_dequantize_mul_mat_vec(ggml_backend_vk_context *
44304430

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

0 commit comments

Comments
 (0)