mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 11:26:34 +00:00
refactor: move model-specific operators and fusions into backend extensions (#2253)
This commit is contained in:
1 parent
c6dfa9def1
commit
45a63ac460
68 files changed
+12173
-151
No files matched your search
@@ -1077,8 +1077,8 @@ namespace Rope {
|
||||
if (backend != nullptr && x->type == GGML_TYPE_F32 && pe->type == GGML_TYPE_F32 &&
|
||||
x->ne[0] % 2 == 0 && pe->ne[0] == 2 && pe->ne[1] == 2 &&
|
||||
pe->ne[2] == x->ne[0] / 2 && pe->ne[3] == x->ne[2]) {
|
||||
auto out = ggml_rope_apply(ctx, x, pe, rope_interleaved);
|
||||
if (ggml_backend_supports_op(backend, out)) {
|
||||
auto out = sd_ggml_rope_apply(ctx, backend, x, pe, rope_interleaved);
|
||||
if (out && ggml_backend_supports_op(backend, out)) {
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,8 +180,8 @@ namespace MiniMaxH3 {
|
||||
GGML_ASSERT(rot_dim <= x->ne[0]);
|
||||
#ifndef SD_USE_UPSTREAM_GGML
|
||||
if (runner_ctx->backend != nullptr && x->type == GGML_TYPE_F32 && pe->type == GGML_TYPE_F32) {
|
||||
auto out = ggml_rope_apply(ctx, x, pe, false);
|
||||
if (ggml_backend_supports_op(runner_ctx->backend, out)) {
|
||||
auto out = sd_ggml_rope_apply(ctx, runner_ctx->backend, x, pe, false);
|
||||
if (out && ggml_backend_supports_op(runner_ctx->backend, out)) {
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user