update ggml_backend_*_supports_op
of unsupported backends
This commit is contained in:
parent
a02a190756
commit
19aba1dbbe
5 changed files with 51 additions and 4 deletions
|
@ -1747,6 +1747,15 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev,
|
||||||
if (*ext_factor != 0) {
|
if (*ext_factor != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int mode = ((const int32_t *) op->op_params)[2];
|
||||||
|
if (mode & GGML_ROPE_TYPE_MROPE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mode & GGML_ROPE_TYPE_VISION) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case GGML_OP_UPSCALE: {
|
case GGML_OP_UPSCALE: {
|
||||||
|
|
|
@ -1419,8 +1419,18 @@ static bool ggml_backend_kompute_device_supports_op(ggml_backend_dev_t dev, cons
|
||||||
case GGML_OP_SOFT_MAX:
|
case GGML_OP_SOFT_MAX:
|
||||||
case GGML_OP_RMS_NORM:
|
case GGML_OP_RMS_NORM:
|
||||||
case GGML_OP_NORM:
|
case GGML_OP_NORM:
|
||||||
case GGML_OP_ROPE:
|
|
||||||
return true;
|
return true;
|
||||||
|
case GGML_OP_ROPE:
|
||||||
|
{
|
||||||
|
const int mode = ((const int32_t *) op->op_params)[2];
|
||||||
|
if (mode & GGML_ROPE_TYPE_MROPE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mode & GGML_ROPE_TYPE_VISION) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
case GGML_OP_DUP:
|
case GGML_OP_DUP:
|
||||||
case GGML_OP_CPY:
|
case GGML_OP_CPY:
|
||||||
case GGML_OP_CONT:
|
case GGML_OP_CONT:
|
||||||
|
|
|
@ -1125,8 +1125,18 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_device_contex
|
||||||
return has_simdgroup_reduction && (op->ne[0] % 4 == 0);
|
return has_simdgroup_reduction && (op->ne[0] % 4 == 0);
|
||||||
case GGML_OP_ARGMAX:
|
case GGML_OP_ARGMAX:
|
||||||
case GGML_OP_NORM:
|
case GGML_OP_NORM:
|
||||||
case GGML_OP_ROPE:
|
|
||||||
return true;
|
return true;
|
||||||
|
case GGML_OP_ROPE:
|
||||||
|
{
|
||||||
|
const int mode = ((const int32_t *) op->op_params)[2];
|
||||||
|
if (mode & GGML_ROPE_TYPE_MROPE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mode & GGML_ROPE_TYPE_VISION) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
case GGML_OP_IM2COL:
|
case GGML_OP_IM2COL:
|
||||||
return op->src[0]->type == GGML_TYPE_F16;
|
return op->src[0]->type == GGML_TYPE_F16;
|
||||||
case GGML_OP_POOL_1D:
|
case GGML_OP_POOL_1D:
|
||||||
|
|
|
@ -4488,7 +4488,16 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
|
||||||
case GGML_OP_SOFT_MAX:
|
case GGML_OP_SOFT_MAX:
|
||||||
return true;
|
return true;
|
||||||
case GGML_OP_ROPE:
|
case GGML_OP_ROPE:
|
||||||
|
{
|
||||||
|
const int mode = ((const int32_t *) op->op_params)[2];
|
||||||
|
if (mode & GGML_ROPE_TYPE_MROPE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mode & GGML_ROPE_TYPE_VISION) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return ggml_is_contiguous(op->src[0]);
|
return ggml_is_contiguous(op->src[0]);
|
||||||
|
}
|
||||||
case GGML_OP_IM2COL:
|
case GGML_OP_IM2COL:
|
||||||
// TODO: add support for the new F32 operations
|
// TODO: add support for the new F32 operations
|
||||||
return op->src[0]->type == GGML_TYPE_F16;
|
return op->src[0]->type == GGML_TYPE_F16;
|
||||||
|
|
|
@ -7687,7 +7687,16 @@ static bool ggml_backend_vk_device_supports_op(ggml_backend_dev_t dev, const ggm
|
||||||
case GGML_OP_REPEAT:
|
case GGML_OP_REPEAT:
|
||||||
return ggml_type_size(op->type) == sizeof(float) && ggml_type_size(op->src[0]->type) == sizeof(float);
|
return ggml_type_size(op->type) == sizeof(float) && ggml_type_size(op->src[0]->type) == sizeof(float);
|
||||||
case GGML_OP_ROPE:
|
case GGML_OP_ROPE:
|
||||||
|
{
|
||||||
|
const int mode = ((const int32_t *) op->op_params)[2];
|
||||||
|
if (mode & GGML_ROPE_TYPE_MROPE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mode & GGML_ROPE_TYPE_VISION) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return ggml_is_contiguous(op->src[0]);
|
return ggml_is_contiguous(op->src[0]);
|
||||||
|
}
|
||||||
case GGML_OP_NONE:
|
case GGML_OP_NONE:
|
||||||
case GGML_OP_RESHAPE:
|
case GGML_OP_RESHAPE:
|
||||||
case GGML_OP_VIEW:
|
case GGML_OP_VIEW:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue