Skip to content

Reduce model loading time#43

Merged
ggerganov merged 3 commits intoggml-org:masterfrom
maekawatoshiki:master
Mar 13, 2023
Merged

Reduce model loading time#43
ggerganov merged 3 commits intoggml-org:masterfrom
maekawatoshiki:master

Conversation

@maekawatoshiki
Copy link
Copy Markdown
Contributor

@maekawatoshiki maekawatoshiki commented Mar 12, 2023

Hello!

I noticed that the model loader is not using buffered IO, so I added a piece of code for buffering.
I measured the loading time only for llama 7B on my M1 Pro Macbook, but it reduced the time from 1316ms to 749ms.

Comment thread main.cpp Outdated
fin.close();
}

free(f_buf);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f_buf will not be free if this function returns earlier, but I think it does not matter since it's a small amount of memory :)

Comment thread main.cpp Outdated
@maekawatoshiki
Copy link
Copy Markdown
Contributor Author

maekawatoshiki commented Mar 13, 2023

Thank you for your review. Fixed as you mentioned.

@ggerganov ggerganov merged commit 63fd76f into ggml-org:master Mar 13, 2023
rooprob pushed a commit to rooprob/llama.cpp that referenced this pull request Aug 2, 2023
Speed up rmsnorm by using sqrtf/expf
Alcpz pushed a commit to Alcpz/llama.cpp that referenced this pull request Dec 4, 2025
1. Fixed audio-detokenizer.cpp:708 - Changed std::expf(log_abs) to
expf(log_abs)
- The expf function is in the global namespace, not in the std namespace
2. Fixed mtmd-cli.cpp:332 - Changed eval_message(ctx, msgs) to
eval_message(ctx, msgs.back())
- The eval_message function expects a single message reference, not a
vector
    - We pass the last message in the vector (the user prompt)

*Make sure to read the [contributing
guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md)
before submitting a PR*
wine99 pushed a commit to wine99/llama.cpp that referenced this pull request Feb 27, 2026
…er_rebase

hardcoded name handling for rope_freqs.weight
rururush pushed a commit to USTC-ADSL/llama.cpp that referenced this pull request Mar 16, 2026
* wip

* refactor: rewrite dequantize_row_q4_0 by intrinsic

* log for debug

* fix q4 intrinsic

* small opt

* wip

* wip

* add vtcm_quota_size

* add perf log for hexagon-npu backend

* wip

* add log

* sync after a specfic op

* increase worker thread priority

* fix unbalanced thread slice

* small slict to fit in vtcm cache

* limit the supported row element size

* opt 4_0 dequant

* fix q4 dequant

* add power_utils

* add rms_norm

* wip

* enable rms_norm f32

* fix rms_norm with param

* fix compiling flags

* use float

* fix small row size

* vectorized rms norm

* wip

* read 2 vectors

* rename

* add perf log on update

* set empty tensors handle also

* merge some rpc functions

* opt param update

* wip

* print more log

* add struct for update param config

* add npu_device_graph_set_tensor_with_param

* merge tensor and params update

* wip

* wip

* make as template to reuse

* vectorize dequantize_row_q8_0

* opt

* avoid using union to store q data

* wip

* wip

* wip
EzequielDM pushed a commit to EzequielDM/llama.cpp-bad that referenced this pull request Apr 2, 2026
InfernalDread referenced this pull request in InfernalDread/llama.cpp Apr 4, 2026
itme-brain pushed a commit to itme-brain/llama.cpp that referenced this pull request Apr 16, 2026
erazortt pushed a commit to erazortt/llama.cpp that referenced this pull request Apr 17, 2026
ausshir pushed a commit to ausshir/llama.cpp-iso-rocm that referenced this pull request Apr 20, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Use buffering

* Use vector

* Minor

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants