quant : Optimise memory usage by evicting weights after processing each layer (#22877)

* Evict weights from memory after processing each layer

* Revert changes

* Move unmap to libllama

* Unmap weights offloaded to backend

* Change member's constness

* Remove unmap weights offloaded to backend
This commit is contained in:
Ed Addario
2026-08-18 16:22:32 +02:00
committed by GitHub
parent 0882c7bc89
commit 0596704284
4 changed files with 13 additions and 2 deletions
+3
View File
@@ -194,6 +194,9 @@ struct llama_model_loader {
void get_mapping_range(size_t * first, size_t * last, void ** addr, int idx, ggml_context * ctx) const;
// release a weight's mmap pages
void unmap_weight(const llama_tensor_weight & w) const;
// for backwards compatibility, does not support ggml-backend
void load_data_for(struct ggml_tensor * cur) const;