Skip to content

common : move common_chat_parse_* to chat-parser.cpp to reduce compile time (#17329)#17481

Merged
ngxson merged 2 commits intoggml-org:masterfrom
dranger003:move-common_chat_parse
Nov 28, 2025
Merged

common : move common_chat_parse_* to chat-parser.cpp to reduce compile time (#17329)#17481
ngxson merged 2 commits intoggml-org:masterfrom
dranger003:move-common_chat_parse

Conversation

@dranger003
Copy link
Contributor

chat.cpp takes ~15-20s to compile due to the minja header-only library.
Contributors adding support for new models primarily modify the
common_chat_parse_* functions, which don't require minja.

By moving these functions to chat-parser.cpp (which doesn't include
minja headers), incremental compile time for parser changes drops to ~5s.

Closes #17329
Alternative to #17416

@ngxson ngxson merged commit 03914c7 into ggml-org:master Nov 28, 2025
119 of 131 checks passed
@dranger003 dranger003 deleted the move-common_chat_parse branch December 6, 2025 18:31
SamuelOliveirads pushed a commit to SamuelOliveirads/llama.cpp that referenced this pull request Dec 29, 2025
* Add alternative log functions

* chat: fix int overflow, prevent size calculation in float/double (ggml-org#17357)

* chat: fix int overflow, prevent size calculation in float/double

* Update common/chat.cpp

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* common : move all common_chat_parse_* to chat-parser.cpp. (ggml-org#17481)

# Conflicts:
#	common/chat.cpp

* server: split server.cpp code into server/common/task/queue/context

* Fix compiler warning

* Clean up code

* common: use native MultiByteToWideChar

* move server prompt to server task

* Clean code

* delete utils.hpp

---------

Co-authored-by: firecoperana <firecoperana>
Co-authored-by: Xuan-Son Nguyen <son@huggingface.co>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: DAN™ <dranger003@gmail.com>
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
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.

Refactor: reduce compile time of common/chat.cpp

2 participants