]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
4 months agoHIP: Prepare reduction operators for wave 64
uvos [Wed, 29 Jan 2025 18:12:42 +0000 (19:12 +0100)]
HIP: Prepare reduction operators for wave 64

4 months agoCUDA/HIP: add warp_size to cuda_device_info
uvos [Wed, 29 Jan 2025 16:46:23 +0000 (17:46 +0100)]
CUDA/HIP: add warp_size to cuda_device_info

4 months agosync: minja (#11499)
Olivier Chafik [Thu, 30 Jan 2025 10:30:27 +0000 (10:30 +0000)]
sync: minja (#11499)

4 months agovocab : correctly identify LF token for GPT-2 style BPE tokenizer (#11496)
mgroeber9110 [Thu, 30 Jan 2025 10:10:59 +0000 (11:10 +0100)]
vocab : correctly identify LF token for GPT-2 style BPE tokenizer (#11496)

4 months agoserver : use lambda instead of std::bind (#11507)
Daniel Bevenius [Thu, 30 Jan 2025 10:05:00 +0000 (11:05 +0100)]
server : use lambda instead of std::bind (#11507)

This commit replaces the two usages of `std::bind` in favor of lambdas for
the callback functions for `callback_new_task` and
`callback_update_slots`.

The motivation for this changes is consistency with the rest of the code
in server.cpp (lambdas are used for all other callbacks/handlers). Also
lambdas are more readable (perhaps this is subjective) but also they are
recommended over `std::bind` in modern C++.

Ref: https://github.com/LithoCoders/dailycpp/blob/master/EffectiveModernC%2B%2B/chapter6/Item34_Prefer_lambdas_to_std::bind.md

4 months agoserver : (docs) added response format for /apply-template [no ci] (#11503)
Isaac McFadyen [Thu, 30 Jan 2025 09:11:53 +0000 (04:11 -0500)]
server : (docs) added response format for /apply-template [no ci] (#11503)

4 months agoreadme : reference examples relative links (#11505)
Guspan Tanadi [Thu, 30 Jan 2025 05:58:02 +0000 (12:58 +0700)]
readme : reference examples relative links (#11505)

4 months agoserver : update json snippets in README.md [no ci] (#11492)
Daniel Bevenius [Thu, 30 Jan 2025 04:48:14 +0000 (05:48 +0100)]
server : update json snippets in README.md [no ci] (#11492)

This commit updates some of JSON snippets in README.md file and
removes the `json` language tag from the code blocks.

The motivation for this changes is that if there is invalid json in a
code snippet these are highlighted in red which can make it somewhat
difficult to read and can be a little distracting.

4 months agoserver : add /apply-template endpoint for additional use cases of Minja functionality...
Nigel Bosch [Wed, 29 Jan 2025 18:45:44 +0000 (12:45 -0600)]
server : add /apply-template endpoint for additional use cases of Minja functionality (#11489)

* add /apply-template endpoint to server

* remove unnecessary line

* add /apply-template documentation

* return only "prompt" field in /apply-template

* use suggested idea instead of my overly verbose way

4 months agovulkan: implement initial support for IQ2 and IQ3 quantizations (#11360)
Rémy Oudompheng [Wed, 29 Jan 2025 17:29:39 +0000 (18:29 +0100)]
vulkan: implement initial support for IQ2 and IQ3 quantizations (#11360)

* vulkan: initial support for IQ3_S

* vulkan: initial support for IQ3_XXS

* vulkan: initial support for IQ2_XXS

* vulkan: initial support for IQ2_XS

* vulkan: optimize Q3_K by removing branches

* vulkan: implement dequantize variants for coopmat2

* vulkan: initial support for IQ2_S

* vulkan: vertically realign code

* port failing dequant callbacks from mul_mm

* Fix array length mismatches

* vulkan: avoid using workgroup size before it is referenced

* tests: increase timeout for Vulkan llvmpipe backend

---------

Co-authored-by: Jeff Bolz <redacted>
4 months agoserver : update auto gen files comments [no ci] (#11484)
Daniel Bevenius [Wed, 29 Jan 2025 15:34:18 +0000 (16:34 +0100)]
server : update auto gen files comments [no ci] (#11484)

* server : update auto gen files comments

This commit updates the 'auto generated files' comments in server.cpp
and removes `deps.sh` from the comment.

The motivation for this change is that `deps.sh` was removed in
Commit 91c36c269bca75b2d08119c653512cd20b4ea2ba ("server : (web ui)
Various improvements, now use vite as bundler (#10599)").

* squash! server : update auto gen files comments [no ci]

Move comments about file generation to README.md.

* squash! server : update auto gen files comments [no ci]

Remove the comments in server.cpp that mention that information
can be found in the README.md file.

4 months agovulkan: Catch pipeline creation failure and print an error message (#11436)
Jeff Bolz [Wed, 29 Jan 2025 15:26:50 +0000 (09:26 -0600)]
vulkan: Catch pipeline creation failure and print an error message (#11436)

* vulkan: Catch pipeline creation failure and print an error message

Also, fix some warnings from my on-demand compile change.

* vulkan: fix pipeline creation logging

4 months agoParse https://ollama.com/library/ syntax (#11480)
Eric Curtin [Wed, 29 Jan 2025 11:23:10 +0000 (12:23 +0100)]
Parse https://ollama.com/library/ syntax (#11480)

People search for ollama models using the web ui, this change
allows one to copy the url from the browser and for it to be
compatible with llama-run.

Signed-off-by: Eric Curtin <redacted>
4 months agosync : ggml
Georgi Gerganov [Wed, 29 Jan 2025 09:25:29 +0000 (11:25 +0200)]
sync : ggml

4 months agoggml : add option to not print stack on abort (ggml/1081)
William Tambellini [Thu, 23 Jan 2025 19:59:08 +0000 (11:59 -0800)]
ggml : add option to not print stack on abort (ggml/1081)

* Add option to not print stack on abort

Add option/envvar to disable stack printing on abort.
Also link some unittests with Threads to fix link errors on
ubuntu/g++11.

* Update ggml/src/ggml.c

---------

Co-authored-by: Diego Devesa <redacted>
4 months agoggml-cpu : fix ggml_graph_compute_thread did not terminate on abort. (ggml/1065)
issixx [Fri, 17 Jan 2025 12:29:08 +0000 (21:29 +0900)]
ggml-cpu : fix ggml_graph_compute_thread did not terminate on abort. (ggml/1065)

some threads kept looping and failed to terminate properly after an abort during CPU execution.

Co-authored-by: issi <redacted>
4 months agoembedding : enable --no-warmup option (#11475)
Daniel Bevenius [Wed, 29 Jan 2025 08:38:54 +0000 (09:38 +0100)]
embedding : enable --no-warmup option (#11475)

This commit enables the `--no-warmup` option for the llama-embeddings.

The motivation for this change is to allow the user to disable the
warmup when running the the program.

4 months agollama: fix missing k_cache store for rwkv6qwen2 (#11445)
Molly Sophia [Wed, 29 Jan 2025 04:07:21 +0000 (12:07 +0800)]
llama: fix missing k_cache store for rwkv6qwen2 (#11445)

Signed-off-by: Molly Sophia <redacted>
4 months agocmake: add hints for locating ggml on Windows using Llama find-package (#11466)
Emreerdog [Tue, 28 Jan 2025 23:22:06 +0000 (02:22 +0300)]
cmake: add hints for locating ggml on Windows using Llama find-package (#11466)

4 months agoserver : Fixed wrong function name in llamacpp server unit test (#11473)
peidaqi [Tue, 28 Jan 2025 23:03:42 +0000 (16:03 -0700)]
server : Fixed wrong function name in llamacpp server unit test (#11473)

The test_completion_stream_with_openai_library() function is actually with stream=False by default, and test_completion_with_openai_library() with stream=True

4 months agoci : fix build CPU arm64 (#11472)
Xuan-Son Nguyen [Tue, 28 Jan 2025 23:02:56 +0000 (00:02 +0100)]
ci : fix build CPU arm64 (#11472)

* ci : fix build CPU arm64

* failed, trying ubuntu 22

* vulkan: ubuntu 24

* vulkan : jammy --> noble

4 months agoHIP: Supress transformation warning in softmax.cu
uvos [Tue, 28 Jan 2025 22:06:32 +0000 (23:06 +0100)]
HIP: Supress transformation warning in softmax.cu

loops with bounds not known at compile time can not be unrolled.
when ncols_template == 0, the bounds of the loop are not constexpr, thus llvm cant unroll the loops here.

4 months agoHIP: Only call rocblas_initialize on rocblas versions with the multiple instantation...
Nikita Sarychev [Tue, 28 Jan 2025 15:42:20 +0000 (07:42 -0800)]
HIP: Only call rocblas_initialize on rocblas versions with the multiple instantation bug (#11080)

This disables the workaround on rocblas fixed versions (>=4.0.0) to eliminate the runtime cost and unnecessary VRAM allocation of loading all tensile objects.

4 months agoAdd github protocol pulling and http:// (#11465)
Eric Curtin [Tue, 28 Jan 2025 14:45:41 +0000 (15:45 +0100)]
Add github protocol pulling and http:// (#11465)

As pulling protocols to llama-run

Signed-off-by: Eric Curtin <redacted>
4 months agodocker: allow installing pip packages system-wide (#11437)
Nuno [Tue, 28 Jan 2025 14:17:25 +0000 (15:17 +0100)]
docker: allow installing pip packages system-wide (#11437)

Signed-off-by: rare-magma <redacted>
4 months agocmake : don't fail on `GGML_CPU=OFF` (#11457)
someone13574 [Tue, 28 Jan 2025 14:15:34 +0000 (09:15 -0500)]
cmake : don't fail on `GGML_CPU=OFF` (#11457)

4 months agodocker: add perplexity and bench commands to full image (#11438)
Nuno [Tue, 28 Jan 2025 10:42:32 +0000 (11:42 +0100)]
docker: add perplexity and bench commands to full image (#11438)

Signed-off-by: rare-magma <redacted>
4 months agoSYCL : SOFTMAX F16 mask support and other fixes (#11261)
Akarshan Biswas [Tue, 28 Jan 2025 09:56:58 +0000 (15:26 +0530)]
SYCL : SOFTMAX F16 mask support and other fixes (#11261)

Implemented ggml_sycl_op_soft_max() F16 src1(mask) support for which a pragma deprecation warning was added during #5021.
To do this, had to decouple it from ggml_sycl_op_flatten which always considered src1 to be of fp32 type(many OP functions are dependent on it).

* SYCL: SOFTMAX F16 mask support and other fixes

* test-backend-ops: Add F16 mask test cases

4 months agoHandle missing model in CLI parameters for llama-run (#11399)
Michael Engel [Tue, 28 Jan 2025 08:32:40 +0000 (09:32 +0100)]
Handle missing model in CLI parameters for llama-run (#11399)

The HTTP client in llama-run only prints an error in case the download of
a resource failed. If the model name in the CLI parameter list is missing,
this causes the application to crash.
In order to prevent this, a check for the required model parameter has been
added and errors for resource downloads get propagated to the caller.

Signed-off-by: Michael Engel <redacted>
5 months agoAdd new hf protocol for ollama (#11449)
Eric Curtin [Mon, 27 Jan 2025 18:36:10 +0000 (19:36 +0100)]
Add new hf protocol for ollama (#11449)

https://huggingface.co/docs/hub/en/ollama

Signed-off-by: Eric Curtin <redacted>
5 months agoAMD: parse the architecture as supplied by gcnArchName (#11244)
Haus1 [Mon, 27 Jan 2025 13:58:17 +0000 (08:58 -0500)]
AMD: parse the architecture as supplied by gcnArchName (#11244)

The value provided by minor doesn't include stepping for AMD, parse the value returned by gcnArchName instead to retrieve an accurate ID.

5 months agollama : minor fixes for up llama load model speed (#11448)
lexasub [Mon, 27 Jan 2025 13:42:09 +0000 (17:42 +0400)]
llama : minor fixes for up llama load model speed (#11448)

* impl::load change map bpe_ranks to onordered map for reduce time of impl::load on 30%

* llama_model_loader::init_mapping - replace new llama_mmap to std::make_unique<llama_mmap> for clean code & reduce (/2) time of running init_mappings

* Update src/llama-vocab.cpp

---------

Co-authored-by: lexasub <redacted>
Co-authored-by: Diego Devesa <redacted>
5 months agollama: refactor llama_decode_impl (#11381)
Johannes Gäßler [Mon, 27 Jan 2025 11:07:12 +0000 (12:07 +0100)]
llama: refactor llama_decode_impl (#11381)

5 months agometal: Handle null returned from MTLCreateSystemDefaultDevice() (#11441)
Ihar Hrachyshka [Mon, 27 Jan 2025 07:41:59 +0000 (02:41 -0500)]
metal: Handle null returned from MTLCreateSystemDefaultDevice() (#11441)

This fixes segmentation fault error when running tests when no metal
devices are available (for example, when not linked with Core Graphics
framework or otherwise).

5 months agodocker : fix ARM build and Vulkan build (#11434)
Xuan Son Nguyen [Sun, 26 Jan 2025 21:45:32 +0000 (22:45 +0100)]
docker : fix ARM build and Vulkan build (#11434)

* ci : do not fail-fast for docker

* build arm64/amd64 separatedly

* fix pip

* no fast fail

* vulkan: try jammy

5 months agometal : use residency sets (#11427)
Georgi Gerganov [Sun, 26 Jan 2025 18:06:16 +0000 (20:06 +0200)]
metal : use residency sets (#11427)

* metal : use residency sets

ggml-ci

* metal : restore commandBufferWithUnretainedReferences calls [no ci]

* metal : release descriptors

ggml-ci

* metal : check env GGML_METAL_NO_RESIDENCY

ggml-ci

* metal : fix build + clean-up

ggml-ci

5 months agodocker: add missing vulkan library to base layer and update to 24.04 (#11422)
Nuno [Sun, 26 Jan 2025 17:22:43 +0000 (18:22 +0100)]
docker: add missing vulkan library to base layer and update to 24.04 (#11422)

Signed-off-by: rare-magma <redacted>
5 months agocmake: add ggml find package (#11369)
bandoti [Sun, 26 Jan 2025 16:07:48 +0000 (12:07 -0400)]
cmake: add ggml find package (#11369)

* Add initial ggml cmake package

* Add build numbers to ggml find-package

* Expand variables with GGML_ prefix

* Guard against adding to cache variable twice

* Add git to msys2 workflow

* Handle ggml-cpu-* variants

* Link ggml/ggml-base libraries to their targets

* Replace main-cmake-pkg with simple-cmake-pkg

* Interface features require c_std_90

* Fix typo

* Removed unnecessary bracket from status message

* Update examples/simple-cmake-pkg/README.md

Co-authored-by: Georgi Gerganov <redacted>
* Update examples/simple-cmake-pkg/README.md

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

Co-authored-by: Georgi Gerganov <redacted>
5 months agorpc: fix register position (#11424)
Frank Mai [Sun, 26 Jan 2025 15:20:34 +0000 (23:20 +0800)]
rpc: fix register position (#11424)

Signed-off-by: thxCode <redacted>
5 months agoreadme : update hot topics
Georgi Gerganov [Sun, 26 Jan 2025 12:30:15 +0000 (14:30 +0200)]
readme : update hot topics

5 months agobuild: apply MSVC /bigobj option to c/cpp files only (#11423)
Jeff Bolz [Sun, 26 Jan 2025 02:10:03 +0000 (20:10 -0600)]
build: apply MSVC /bigobj option to c/cpp files only (#11423)

5 months agovulkan: compile shaders on-demand (#11406)
Jeff Bolz [Sat, 25 Jan 2025 21:29:57 +0000 (15:29 -0600)]
vulkan: compile shaders on-demand (#11406)

Reduce first-run startup time and memory consumption.

Should fix #11339.

5 months agoHip: disable VMM on hip as it seams that it dosent work in some configurations (...
uvos [Sat, 25 Jan 2025 20:01:12 +0000 (21:01 +0100)]
Hip: disable VMM on hip as it seams that it dosent work in some configurations (#11420)

5 months agobuild: add /bigobj to MSVC build (#11407)
Jeff Bolz [Sat, 25 Jan 2025 17:26:37 +0000 (11:26 -0600)]
build: add /bigobj to MSVC build (#11407)

5 months agodocker : add GGML_CPU_ARM_ARCH arg to select ARM architecture to build for (#11419)
Diego Devesa [Sat, 25 Jan 2025 16:22:41 +0000 (17:22 +0100)]
docker : add GGML_CPU_ARM_ARCH arg to select ARM architecture to build for (#11419)

5 months agoserver : fix cleaning up stream task (#11418)
Xuan Son Nguyen [Sat, 25 Jan 2025 15:36:44 +0000 (16:36 +0100)]
server : fix cleaning up stream task (#11418)

* server : fix cleaning up stream task

* one more spot

5 months agodocker : fix CPU ARM build (#11403)
Diego Devesa [Sat, 25 Jan 2025 14:22:29 +0000 (15:22 +0100)]
docker : fix CPU ARM build (#11403)

* docker : fix CPU ARM build

* add CURL to other builds

5 months agoci : fix line breaks on windows builds (#11409)
Georgi Gerganov [Sat, 25 Jan 2025 11:36:48 +0000 (13:36 +0200)]
ci : fix line breaks on windows builds (#11409)

* ci : fix line breaks on windows builds

* cont : another try

* ci : fix powershell line breaks

5 months agoCANN: Add Ascend CANN build ci (#10217)
jiahao su [Fri, 24 Jan 2025 23:26:01 +0000 (07:26 +0800)]
CANN: Add Ascend CANN build ci (#10217)

* CANN: Add Ascend CANN build ci

* Update build.yml

* Modify cann image version

* Update build.yml

* Change to run on x86 system

* Update build.yml

* Update build.yml

* Modify format error

* Update build.yml

* Add 'Ascend NPU' label restrictions

* Exclude non PR event

Co-authored-by: Yuanhao Ji <redacted>
* Update build.yml

---------

Co-authored-by: Yuanhao Ji <redacted>
5 months agohip : Add hipGraph and VMM support to ROCM (#11362)
uvos [Fri, 24 Jan 2025 23:02:23 +0000 (00:02 +0100)]
hip : Add hipGraph and VMM support to ROCM (#11362)

* Add hipGraph support

* Enable VMM on rocm

5 months agoCUDA: fix FP16 cuBLAS GEMM (#11396)
Johannes Gäßler [Fri, 24 Jan 2025 20:02:43 +0000 (21:02 +0100)]
CUDA: fix FP16 cuBLAS GEMM (#11396)

5 months agorocBLAS: Avoid fp32->fp16->fp32 conversion on cdna (#11356)
uvos [Fri, 24 Jan 2025 16:50:49 +0000 (17:50 +0100)]
rocBLAS: Avoid fp32->fp16->fp32 conversion on cdna (#11356)

5 months agorelease : pack /lib in the packages (#11392)
Georgi Gerganov [Fri, 24 Jan 2025 16:41:30 +0000 (18:41 +0200)]
release : pack /lib in the packages (#11392)

* release : pack /lib and /include in the packages

* cmake : put libs in /bin

* TMP : push artifacts

* Revert "TMP : push artifacts"

This reverts commit 4decf2c4dfc5cdf5d96ea44c03c8f9801ab41262.

* ci : fix HIP cmake compiler options to be on first line

* ci : restore the original HIP commands

* ci : change ubuntu build from latest to 20.04

* ci : try to fix macos build rpaths

* ci : remove obsolete MacOS build

* TMP : push artifacts

* ci : change back to ubuntu latest

* ci : macos set build rpath to "@loader_path"

* ci : fix typo

* ci : change ubuntu package to 22.04

* Revert "TMP : push artifacts"

This reverts commit 537b09e70ffc604c414ee78acf3acb4c940ec597.

5 months agodocs : Update readme to build targets for local docker build (#11368)
Jafar Uruç [Fri, 24 Jan 2025 13:30:13 +0000 (13:30 +0000)]
docs : Update readme to build targets for local docker build (#11368)

5 months agoCPU/CUDA: fix (GQA) mul mat back, add CUDA support (#11380)
Johannes Gäßler [Fri, 24 Jan 2025 11:38:31 +0000 (12:38 +0100)]
CPU/CUDA: fix (GQA) mul mat back, add CUDA support (#11380)

5 months agocmake : avoid -march=native when reproducible build is wanted (#11366)
Bernhard M. Wiedemann [Fri, 24 Jan 2025 11:21:35 +0000 (12:21 +0100)]
cmake : avoid -march=native when reproducible build is wanted (#11366)

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Without this patch, compiling on different machines produced different binaries, which made verification of results difficult.

Fixes: #11317
This patch was done while working on reproducible builds for openSUSE.

5 months agoUpdate llama-run README.md (#11386)
Eric Curtin [Fri, 24 Jan 2025 09:39:24 +0000 (09:39 +0000)]
Update llama-run README.md (#11386)

For consistency

Signed-off-by: Eric Curtin <redacted>
5 months agoserver : (webui) put DeepSeek R1 CoT in a collapsible <details> element (#11364)
stduhpf [Fri, 24 Jan 2025 08:02:38 +0000 (09:02 +0100)]
server : (webui) put DeepSeek R1 CoT in a collapsible <details> element (#11364)

* webui : put DeepSeek R1 CoT in a collapsible <details> element

* webui: refactor split

* webui: don't use regex to split cot and response

* webui: format+qol

* webui: no loading icon if the model isn't generating

* ui fix, add configs

* add jsdoc types

* only filter </think> for assistant msg

* build

* update build

---------

Co-authored-by: Xuan Son Nguyen <redacted>
5 months agotests: fix some mul_mat test gaps (#11375)
Jeff Bolz [Thu, 23 Jan 2025 20:51:24 +0000 (14:51 -0600)]
tests: fix some mul_mat test gaps (#11375)

Now that we have batched mat-vec mul Vulkan shaders for up to n==8,
these tests weren't actually exercising the mat-mat mul path. Test
n==9 as well. Also, change to use all_types.

5 months agoUpdate documentation (#11373)
Eric Curtin [Thu, 23 Jan 2025 20:04:31 +0000 (20:04 +0000)]
Update documentation (#11373)

To show -n, -ngl, --ngl is acceptable.

Signed-off-by: Eric Curtin <redacted>
5 months agoAdd -ngl (#11372)
Eric Curtin [Thu, 23 Jan 2025 16:16:18 +0000 (16:16 +0000)]
Add -ngl (#11372)

Most other llama.cpp cli tools accept -ngl with a single dash.

Signed-off-by: Eric Curtin <redacted>
5 months agoserver : add more clean up when cancel_tasks is called (#11340)
Xuan Son Nguyen [Thu, 23 Jan 2025 12:56:05 +0000 (13:56 +0100)]
server : add more clean up when cancel_tasks is called (#11340)

* server : add more clean up when cancel_tasks is called

* fix recv_with_timeout

* std::remove_if

* fix std::remove_if

5 months agoTreat hf.co/ prefix the same as hf:// (#11350)
Eric Curtin [Thu, 23 Jan 2025 10:38:20 +0000 (10:38 +0000)]
Treat hf.co/ prefix the same as hf:// (#11350)

ollama uses hf.co/ to specify huggingface prefix, like RamaLama
uses hf://

Treat them similarly.

Signed-off-by: Eric Curtin <redacted>
5 months agoVulkan-run-test: fix mmq_wg_denoms (#11343)
amd-dwang [Thu, 23 Jan 2025 07:14:28 +0000 (15:14 +0800)]
Vulkan-run-test: fix mmq_wg_denoms (#11343)

There should be a copy-and-paste error here.

*mmq_wg_denoms should be used together with *warptile_mmq, instead of
wg_denoms.

5 months agovulkan: sort shaders for more deterministic binary (#11315)
Jeff Bolz [Thu, 23 Jan 2025 07:07:50 +0000 (01:07 -0600)]
vulkan: sort shaders for more deterministic binary (#11315)

Fixes #11306.

5 months agovulkan: fix diag_mask_inf (#11323)
Jeff Bolz [Thu, 23 Jan 2025 07:01:17 +0000 (01:01 -0600)]
vulkan: fix diag_mask_inf (#11323)

With robustbufferaccess disabled, this shader was showing OOB stores. There
is a bounds check in the code, but the workgrouop dimensions were reversed vs
CUDA and it was running the wrong number of threads. So fix the workgroup
dimensions and disable robustness for this pipeline.

5 months agomain : update README documentation for batch size (#11353)
Diego Devesa [Wed, 22 Jan 2025 18:22:20 +0000 (19:22 +0100)]
main : update README documentation for batch size (#11353)

* main : update README documentation for batch size

* fix formatting

* minor

5 months agoreadme : add plugin links (#11355)
Georgi Gerganov [Wed, 22 Jan 2025 17:44:26 +0000 (19:44 +0200)]
readme : add plugin links (#11355)

5 months agoserver : fix draft context not being released (#11354)
Diego Devesa [Wed, 22 Jan 2025 16:44:40 +0000 (17:44 +0100)]
server : fix draft context not being released (#11354)

5 months ago`minja`: sync at https://github.com/google/minja/commit/0f5f7f2b3770eb682fbc11763266d...
Olivier Chafik [Wed, 22 Jan 2025 16:16:27 +0000 (16:16 +0000)]
`minja`: sync at https://github.com/google/minja/commit/0f5f7f2b3770eb682fbc11763266d45204173686 (#11352)

5 months agoAdding logprobs to /v1/completions (#11344)
Jiří Podivín [Wed, 22 Jan 2025 11:51:32 +0000 (12:51 +0100)]
Adding logprobs to /v1/completions (#11344)

Signed-off-by: Jiri Podivin <redacted>
5 months ago`common`: utils to split / join / repeat strings (from json converter) (#11342)
Olivier Chafik [Wed, 22 Jan 2025 09:51:44 +0000 (09:51 +0000)]
`common`: utils to split / join / repeat strings (from json converter) (#11342)

* Factor string_join, string_split, string_repeat into common

* json: refactor to surface a versatile builder

* Update common.cpp

5 months agollava : support Minicpm-omni (#11289)
tc-mb [Wed, 22 Jan 2025 07:35:48 +0000 (15:35 +0800)]
llava : support Minicpm-omni (#11289)

* init

* add readme

* update readme

* no use make

* update readme

* update fix code

* fix editorconfig-checker

* no change convert py

* use clip_image_u8_free

5 months agoAdd Jinja template support (#11016)
Olivier Chafik [Tue, 21 Jan 2025 13:18:51 +0000 (13:18 +0000)]
Add Jinja template support (#11016)

* Copy minja from https://github.com/google/minja/commit/58f0ca6dd74bcbfbd4e71229736640322b31c7f9

* Add --jinja and --chat-template-file flags

* Add missing <optional> include

* Avoid print in get_hf_chat_template.py

* No designated initializers yet

* Try and work around msvc++ non-macro max resolution quirk

* Update test_chat_completion.py

* Wire LLM_KV_TOKENIZER_CHAT_TEMPLATE_N in llama_model_chat_template

* Refactor test-chat-template

* Test templates w/ minja

* Fix deprecation

* Add --jinja to llama-run

* Update common_chat_format_example to use minja template wrapper

* Test chat_template in e2e test

* Update utils.py

* Update test_chat_completion.py

* Update run.cpp

* Update arg.cpp

* Refactor common_chat_* functions to accept minja template + use_jinja option

* Attempt to fix linkage of LLAMA_CHATML_TEMPLATE

* Revert LLAMA_CHATML_TEMPLATE refactor

* Normalize newlines in test-chat-templates for windows tests

* Forward decl minja::chat_template to avoid eager json dep

* Flush stdout in chat template before potential crash

* Fix copy elision warning

* Rm unused optional include

* Add missing optional include to server.cpp

* Disable jinja test that has a cryptic windows failure

* minja: fix vigogne (https://github.com/google/minja/pull/22)

* Apply suggestions from code review

Co-authored-by: Xuan Son Nguyen <redacted>
Co-authored-by: Georgi Gerganov <redacted>
* Finish suggested renamings

* Move chat_templates inside server_context + remove mutex

* Update --chat-template-file w/ recent change to --chat-template

* Refactor chat template validation

* Guard against missing eos/bos tokens (null token otherwise throws in llama_vocab::impl::token_get_attr)

* Warn against missing eos / bos tokens when jinja template references them

* rename: common_chat_template[s]

* reinstate assert on chat_templates.template_default

* Update minja to https://github.com/google/minja/commit/b8437df626ac6cd0ce3b333b3c74ed1129c19f25

* Update minja to https://github.com/google/minja/pull/25

* Update minja from https://github.com/google/minja/pull/27

* rm unused optional header

---------

Co-authored-by: Xuan Son Nguyen <redacted>
Co-authored-by: Georgi Gerganov <redacted>
5 months agoexport-lora : fix tok_embd tensor (#11330)
Xuan Son Nguyen [Tue, 21 Jan 2025 13:07:12 +0000 (14:07 +0100)]
export-lora : fix tok_embd tensor (#11330)

5 months agorpc : better caching of the base buffer pointer (#11331)
Radoslav Gerganov [Tue, 21 Jan 2025 13:06:41 +0000 (15:06 +0200)]
rpc : better caching of the base buffer pointer (#11331)

There is no need to use map, just store the base pointer in the buffer
context.

5 months agolinenoise.cpp refactoring (#11301)
Eric Curtin [Tue, 21 Jan 2025 09:32:35 +0000 (09:32 +0000)]
linenoise.cpp refactoring (#11301)

More RAII mainly

Signed-off-by: Eric Curtin <redacted>
5 months agometal : fix out-of-bounds write (#11314)
Georgi Gerganov [Tue, 21 Jan 2025 06:48:13 +0000 (08:48 +0200)]
metal : fix out-of-bounds write (#11314)

ggml-ci

5 months agocommon : add -hfd option for the draft model (#11318)
Georgi Gerganov [Mon, 20 Jan 2025 20:29:43 +0000 (22:29 +0200)]
common : add -hfd option for the draft model (#11318)

* common : add -hfd option for the draft model

* cont : fix env var

* cont : more fixes

5 months agovulkan: fix coopmat2 validation failures (#11284)
Jeff Bolz [Mon, 20 Jan 2025 16:38:32 +0000 (10:38 -0600)]
vulkan: fix coopmat2 validation failures (#11284)

mul mat and flash attention shaders were loading f32 types directly into
A/B matrices, which happens to work but is technically invalid usage.
For FA, we can load it as an Accumulator matrix and convert and this
is not in the inner loop and is cheap enough. For mul mat, it's more
efficient to do this conversion in a separate pass and have the input(s)
be f16.

coopmat2 requires SPIR-V 1.6 (related using to LocalSizeId). LocalSizeId
requires maintenance4 be enabled, and SPIR-V 1.6 requires Vulkan 1.3.

5 months agoexamples : fix add_special conditions (#11311)
Georgi Gerganov [Mon, 20 Jan 2025 14:36:08 +0000 (16:36 +0200)]
examples : fix add_special conditions (#11311)

5 months agommap: add include for cerrno (#11296)
Christopher Nielsen [Mon, 20 Jan 2025 14:02:43 +0000 (09:02 -0500)]
mmap: add include for cerrno (#11296)

ggml-ci

Co-authored-by: Xuan Son Nguyen <redacted>
5 months agocmake: fix shell command quoting in build-info script (#11309)
Michael Podvitskiy [Mon, 20 Jan 2025 14:02:15 +0000 (15:02 +0100)]
cmake: fix shell command quoting in build-info script (#11309)

5 months agollama : add support for Deepseek-R1-Qwen distill model (#11310)
Xuan Son Nguyen [Mon, 20 Jan 2025 13:35:07 +0000 (14:35 +0100)]
llama : add support for Deepseek-R1-Qwen distill model (#11310)

* llama : add support for Deepseek-R1-Qwen distill model

* coding style

5 months agocont : fix whitespaces (#11305)
Georgi Gerganov [Mon, 20 Jan 2025 07:29:32 +0000 (09:29 +0200)]
cont : fix whitespaces (#11305)

5 months agollama : re-add LLM_ARCH_PHIMOE (#11305)
Kyle Bruene [Mon, 20 Jan 2025 07:21:01 +0000 (01:21 -0600)]
llama : re-add LLM_ARCH_PHIMOE (#11305)

Phi 3.5 MoE was partially removed during a refactor. The code was originally in llama.cpp and should be in llama-model.cpp after the refactor.

5 months agotests : increase timeout when sanitizers are enabled (#11300)
Georgi Gerganov [Sun, 19 Jan 2025 18:22:30 +0000 (20:22 +0200)]
tests : increase timeout when sanitizers are enabled (#11300)

* tests : increase timeout when sanitizers are enabled

* tests : add DEFAULT_HTTP_TIMEOUT

5 months agosimple-chat : fix BOS being added to each message (#11278)
Georgi Gerganov [Sun, 19 Jan 2025 16:12:09 +0000 (18:12 +0200)]
simple-chat : fix BOS being added to each message (#11278)

5 months agoSYCL: Introducing memory host pool (#11251)
Nicolò Scipione [Sun, 19 Jan 2025 13:33:34 +0000 (14:33 +0100)]
SYCL: Introducing memory host pool (#11251)

* Implement host pool for matrix_info

Creating a new memory pool on the host to store memory location for
matrix_info needed to launch gemm_batch from oneMKL/oneMath.
Removing complex support in gemm_batch since it is not used in llama.cpp

* Remove unnecessary headers and cast

* Reorder member variable to avoid warning on initialization

* Formatting

* Remove unused variable

* Address PR review feedback - remove warning

---------

Signed-off-by: nscipione <redacted>
5 months agoAdding linenoise.cpp to llama-run (#11252)
Eric Curtin [Sat, 18 Jan 2025 14:42:31 +0000 (14:42 +0000)]
Adding linenoise.cpp to llama-run (#11252)

This is a fork of linenoise that is C++17 compatible. I intend on
adding it to llama-run so we can do things like traverse prompt
history via the up and down arrows:

https://github.com/ericcurtin/linenoise.cpp

Signed-off-by: Eric Curtin <redacted>
5 months agocmake : add sanitizer flags for llama.cpp (#11279)
Georgi Gerganov [Sat, 18 Jan 2025 14:18:15 +0000 (16:18 +0200)]
cmake : add sanitizer flags for llama.cpp (#11279)

* cmake : add sanitizer flags for llama.cpp

ggml-ci

* tests : fix compile warnings

ggml-ci

* cmake : move sanitizer flags to llama_add_compile_flags

ggml-ci

* cmake : move llama.cpp compile flags to top level lists

ggml-ci

* cmake : apply only sanitizer flags at top level

ggml-ci

* tests : fix gguf context use in same_tensor_data

* gguf-test: tensor data comparison

* dummy : trigger ggml-ci

* unicode : silence gcc warnings

ggml-ci

* ci : use sanitizer builds only in Debug mode

ggml-ci

* cmake : add status messages [no ci]

---------

Co-authored-by: Johannes Gäßler <redacted>
5 months agoserver : implement cancellable request (#11285)
Xuan Son Nguyen [Sat, 18 Jan 2025 13:12:05 +0000 (14:12 +0100)]
server : implement cancellable request (#11285)

* server : implement cancellable request

* fix typo

* httplib 0.18.5

* fix i underflow

5 months agoscripts : restore hf.sh (#11288)
Georgi Gerganov [Sat, 18 Jan 2025 11:18:32 +0000 (13:18 +0200)]
scripts : restore hf.sh (#11288)

ggml-ci

5 months agotts : add guide tokens support (#11186)
LostRuins Concedo [Sat, 18 Jan 2025 10:20:57 +0000 (18:20 +0800)]
tts : add guide tokens support (#11186)

* Added the ability to use guide tokens for OuteTTS, greatly improving TTS recitation accuracy over long input sequences.

* applied linting suggestions, updated to latest llama_vocab changes, added a safety check, added newline to guide token start

5 months agovulkan: fix coopmat2 flash attention for non-contiguous inputs (#11281)
Jeff Bolz [Sat, 18 Jan 2025 08:26:50 +0000 (02:26 -0600)]
vulkan: fix coopmat2 flash attention for non-contiguous inputs (#11281)

Add code similar to mul_mm_cm2 to force alignment of strides, to avoid
a performance regression.

Add noncontiguous FA tests in test-backend-ops.

Fixes #11268.

5 months agollama.android: add field formatChat to control whether to parse special tokens when...
codezjx [Fri, 17 Jan 2025 12:57:56 +0000 (20:57 +0800)]
llama.android: add field formatChat to control whether to parse special tokens when send message (#11270)

5 months agorpc : early register backend devices (#11262)
Radoslav Gerganov [Fri, 17 Jan 2025 08:57:09 +0000 (10:57 +0200)]
rpc : early register backend devices (#11262)

Early register RPC devices and do not propagate RPC specifics in the
llama model structures.

ref: #10609

5 months agovocab : fix double-eos check (#11273)
Georgi Gerganov [Fri, 17 Jan 2025 07:28:00 +0000 (09:28 +0200)]
vocab : fix double-eos check (#11273)

ggml-ci

5 months agollama : fix deprecation message: vocabable -> vocab (#11269)
David Renshaw [Fri, 17 Jan 2025 07:12:01 +0000 (02:12 -0500)]
llama : fix deprecation message: vocabable -> vocab (#11269)

5 months agoREADME : added kalavai to infrastructure list (#11216)
musoles [Fri, 17 Jan 2025 00:10:49 +0000 (00:10 +0000)]
README : added kalavai to infrastructure list (#11216)