perf: optimize H3 inference and segmented weight prefetch (#2240)

This commit is contained in:
leejet authored and GitHub committed 2026-10-30 00:38:14 +08:00
1 parent e7b7ec6d6f
commit 37bc88b5e9
17 files changed
+367 -210

No files matched your search

+3
View File
@@ -18,6 +18,7 @@ namespace sd {
ggml_backend_buffer_t buffer = nullptr;
ggml_tensor* tensor = nullptr;
~CachedTensor();
static std::unique_ptr<CachedTensor> allocate(ggml_backend_t backend, const std::string& name, ggml_tensor* source);
static std::unique_ptr<CachedTensor> copy(ggml_backend_t backend,
const std::string& name,
ggml_tensor* source,
@@ -59,6 +60,8 @@ namespace sd {
size_t resident_bytes(ggml_backend_dev_t device) const;
size_t estimate_output_bytes(ggml_cgraph* graph,
const ggml_graph_cut::Segment& segment) const;
static bool can_bind_output(ggml_backend_t backend, const ggml_tensor* tensor);
bool bind_outputs(const std::unordered_set<const ggml_tensor*>& outputs);
ggml_status capture(ggml_cgraph* graph, const ggml_graph_cut::Segment& segment, const char* log_desc);
void prune(const std::unordered_set<std::string>& keep_names);
void clear() { tensors_.clear(); }