vulkan: enable Conv2D for Apple after MoltenVK fixed the bug (#15526)

This commit is contained in:
Ruben Ortlam 2025-08-24 10:48:53 +02:00 committed by GitHub
parent e78cf0d4b1
commit a9c6ffcbfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11853,14 +11853,13 @@ static bool ggml_backend_vk_device_supports_op(ggml_backend_dev_t dev, const ggm
// Op is disabled for Apple because it segfaults at pipeline create time on MoltenVK // Op is disabled for Apple because it segfaults at pipeline create time on MoltenVK
ggml_backend_vk_device_context * ctx = (ggml_backend_vk_device_context *)dev->context; ggml_backend_vk_device_context * ctx = (ggml_backend_vk_device_context *)dev->context;
const vk_device& device = ggml_vk_get_device(ctx->device); const vk_device& device = ggml_vk_get_device(ctx->device);
bool is_Apple = ggml_vk_get_device(ctx->device)->vendor_id == VK_VENDOR_ID_APPLE;
// Channel-contiguous format is not supported yet. // Channel-contiguous format is not supported yet.
return ((op->src[0]->type == GGML_TYPE_F32 || op->src[0]->type == GGML_TYPE_F16) && return ((op->src[0]->type == GGML_TYPE_F32 || op->src[0]->type == GGML_TYPE_F16) &&
op->src[1]->type == GGML_TYPE_F32 && op->src[1]->type == GGML_TYPE_F32 &&
op->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32 &&
ggml_is_contiguous(op->src[0]) && ggml_is_contiguous(op->src[0]) &&
ggml_is_contiguous(op->src[1]) && ggml_is_contiguous(op->src[1]) &&
ggml_is_contiguous(op)) && !is_Apple; ggml_is_contiguous(op));
} }
default: default:
return false; return false;