disable gelu in NPU

This commit is contained in:
hongruichen 2024-10-29 00:54:08 +08:00
parent c42433cf76
commit 5c1e6d4905
1 changed files with 9 additions and 2 deletions

View File

@ -573,8 +573,15 @@ bool ggml_qnn_supports_op(ggml_backend_qnn_device_context *ctx, const ggml_tenso
}
if (op->op == GGML_OP_UNARY) {
if (!kQnnUnaryOpsTable[kGgmlUnaryOpStart + ggml_get_unary_op(op)]) {
QNN_LOG_DEBUG("unsupported unary op %d", ggml_get_unary_op(op));
const auto unary_op = ggml_get_unary_op(op);
if (unary_op == GGML_UNARY_OP_GELU && ctx->device == QNN_BACKEND_NPU) {
// TODO: fix this when NPU supports GELU
QNN_LOG_DEBUG("unsupported unary op GGML_UNARY_OP_GELU for NPU");
return false;
}
if (!kQnnUnaryOpsTable[kGgmlUnaryOpStart + unary_op]) {
QNN_LOG_DEBUG("unsupported unary op %d", unary_op);
return false;
}