perf: reduce fused compute buffers (#2290)

This commit is contained in:
leejet authored and GitHub committed 2026-11-08 12:28:44 +08:00
1 parent 9234ad822a
commit 5f8c19f98d
11 files changed
+425 -87

No files matched your search

+4 -1
View File
@@ -277,7 +277,10 @@ namespace SD_CUDA_NAMESPACE {
}
static ggml_status rope_prepare(ggml_backend_t, ggml_tensor* const* nodes, int count, void**, size_t* workspace, void*) {
*workspace = ggml_nbytes(nodes[count - 1]);
const auto* dst = nodes[count - 1];
// Owning casts are fresh outputs; copies into existing storage retain view_src.
const bool fresh_output = !dst->data && !dst->buffer && !dst->view_src;
*workspace = fresh_output ? 0 : ggml_nbytes(dst);
return GGML_STATUS_SUCCESS;
}