]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
llama : support multi-output backend sampling (#25532)
authorGaurav Garg <redacted>
Mon, 10 Aug 2026 13:58:56 +0000 (19:28 +0530)
committerGitHub <redacted>
Mon, 10 Aug 2026 13:58:56 +0000 (16:58 +0300)
commitdd1ea524333b1e697489067d7a4c39c60d32beee
tree24cd26f66d01cb19a758bb0c5ccbae85dc332de1
parentd2f83055d6e3b379b5d34c4837122a918cf402c2
llama : support multi-output backend sampling (#25532)

* Enable backend sampling with token speculation

* Clamp the mask sum before converting it into the sampled index

* Add a numeric context parameter declaring the maximum outputs one sequence

* More fixes

* Don't reuse memory for output views.

* Match dist between CPU and GPU

* Fix CPU and backend sampling mismatches

* Simpify some of the changes

* Fix tests on Vulkan

* More test fixes

* Rebase changes

* Rebase and address review comments

* Address review comments

* Address review comments

* Update src/llama-sampler.cpp

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
24 files changed:
common/common.cpp
common/common.h
common/llguidance.cpp
common/reasoning-budget.cpp
common/sampling.cpp
common/sampling.h
common/speculative.cpp
common/speculative.h
docs/speculative.md
examples/lookup/lookup.cpp
examples/speculative-simple/speculative-simple.cpp
examples/speculative/speculative.cpp
include/llama.h
src/llama-context.cpp
src/llama-cparams.h
src/llama-graph.cpp
src/llama-graph.h
src/llama-sampler.cpp
src/llama-sampler.h
tests/test-arg-parser.cpp
tests/test-backend-sampler.cpp
tests/test-sampling.cpp
tools/server/server-context.cpp
tools/server/tests/unit/test_speculative.py