ggml-vulkan: move ARM/Qualcomm mul_mat_l restriction to init block
Moves the logic that disables large matrix multiplication for ARM and Qualcomm devices from ggml_vk_load_shaders to the device initialization switch block. This fixes stability issues (silent calculation errors) on Mali G720/Immortalis MC12 while adhering to the code structure requested in PR #18493 discussion.
This commit is contained in:
parent
e6c76f7771
commit
cef48b4cbf
|
|
@ -3084,10 +3084,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
|
|||
device->mul_mat_l[i] = false;
|
||||
}
|
||||
|
||||
if (device->vendor_id == VK_VENDOR_ID_ARM || device->vendor_id == VK_VENDOR_ID_QUALCOMM) {
|
||||
device->mul_mat_l[i] = false;
|
||||
device->mul_mat_id_l[i] = false;
|
||||
}
|
||||
|
||||
|
||||
// Disable mul_mat_id if not enough shared memory is available
|
||||
if (!ggml_vk_matmul_shmem_support(device, s_warptile_mmqid, true, t)) {
|
||||
|
|
@ -5195,6 +5192,15 @@ static vk_device ggml_vk_get_device(size_t idx) {
|
|||
device->mul_mat_id_m[i] = true;
|
||||
device->mul_mat_id_s[i] = true;
|
||||
break;
|
||||
case VK_VENDOR_ID_ARM:
|
||||
case VK_VENDOR_ID_QUALCOMM:
|
||||
device->mul_mat_l[i] = false;
|
||||
device->mul_mat_id_l[i] = false;
|
||||
device->mul_mat_m[i] = true;
|
||||
device->mul_mat_s[i] = true;
|
||||
device->mul_mat_id_m[i] = true;
|
||||
device->mul_mat_id_s[i] = true;
|
||||
break;
|
||||
case VK_VENDOR_ID_APPLE:
|
||||
device->mul_mat_l[i] = false;
|
||||
device->mul_mat_m[i] = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue