respect -fitc from llama-bench instead of using the benchmark context size - #28331
Open
MartinEmrich wants to merge 1 commit into
Open
respect -fitc from llama-bench instead of using the benchmark context size#28331MartinEmrich wants to merge 1 commit into
MartinEmrich wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
While tweaking the optimal settings for running Qwen 3.6 MoE on a small mobile GPU plus System RAM, I was wondering why what
llama-fit-paramsused withllama-benchproduced different results that using-fitcwith llama-bench directly.Disclosure: I used AI (Qwen 3.6, of course via llama-server) for the analysis and the fix. These words here are my own though.
Additional information
Turns out that llama-bench does not use my
-fitc 196608parameter (I wanted to benchmark for) for fitting, but strictly the actual benchmark context size (pp512 plus tg128, makes only 640 tokens). All that-fitcdoes is enable fitting.I then tried absurdly different
-fitc 16384as well as-fitc 1638400parameters to verify, and all produced the same benchmark result (higher, as more layers and parameters fit on the GPU).At the changed code, if
n_ctx_autois false (which is always the case with llama-bench), it now clamps the context size for fit calculation to the passed-fitcparameter viafit_min_ctxif it is bigger (most likely in practice) than the benchmark's token requirements.This way the benchmark runs with the same settings I get from
llama-fit-paramswith the actual context I plan to run llama-server with.Requirements