feat: optimize tensor loading time (#790)

* opt tensor loading

* fix build failure

* revert the changes

* allow the use of n_threads

* fix lora loading

* optimize lora loading

* add mutex

* use atomic

* fix build

* fix potential duplicate issue

* avoid duplicate lookup of lora tensor

* fix progeress bar

* remove unused remove_duplicates

---------

Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
rmatif
2025-09-14 16:48:35 +02:00
committed by GitHub
parent 52a97b3ac1
commit 55c2e05d98
4 changed files with 345 additions and 274 deletions

View File

@@ -576,7 +576,7 @@ public:
if (version == VERSION_SVD) {
ignore_tensors.insert("conditioner.embedders.3");
}
bool success = model_loader.load_tensors(tensors, ignore_tensors);
bool success = model_loader.load_tensors(tensors, ignore_tensors, n_threads);
if (!success) {
LOG_ERROR("load tensors from model loader failed");
ggml_free(ctx);