mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
perf: reduce CPU overhead in graph execution and sampling (#1997)
This commit is contained in:
1 parent
d32b4e893b
commit
275ab58e01
8 files changed
+195
-123
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#define __MODEL_MANAGER_H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
@@ -84,9 +85,15 @@ private:
|
||||
size_t resident_bytes = 0;
|
||||
};
|
||||
|
||||
struct ResolvedTensorStates {
|
||||
std::vector<ggml_tensor*> tensors;
|
||||
std::vector<TensorState*> states;
|
||||
};
|
||||
|
||||
ModelLoader model_loader_;
|
||||
std::vector<std::unique_ptr<TensorState>> tensor_states_;
|
||||
std::map<const ggml_tensor*, TensorState*> tensor_states_by_tensor_;
|
||||
mutable std::list<ResolvedTensorStates> resolved_tensor_states_;
|
||||
std::vector<std::unique_ptr<ParamsStorageBlock>> params_storage_blocks_;
|
||||
std::vector<std::unique_ptr<ComputeStagingBlock>> compute_staging_blocks_;
|
||||
std::map<ggml_backend_t, ggml_backend_buffer_type_t> split_buffer_types_;
|
||||
|
||||
Reference in new issue
Block a user