]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
19 months agoserver : OAI API compatibility (#4198)
Georgi Gerganov [Sat, 25 Nov 2023 09:29:06 +0000 (11:29 +0200)]
server : OAI API compatibility (#4198)

* Add openai-compatible POST /v1/chat/completions API endpoint to server example

* fix code style

* Update server README.md

* Improve server README.md

* Fix server.cpp code style according to review

* server : some style changes

* server : indentation

* server : enable special tokens during tokenization by default

* server : minor code style

* server : change random string generator

* straightforward /v1/models endpoint

---------

Co-authored-by: kir-gadjello <redacted>
Co-authored-by: Tobi Lütke <redacted>
19 months agollama : set metal log callback correctly (#4204)
slaren [Fri, 24 Nov 2023 17:10:01 +0000 (18:10 +0100)]
llama : set metal log callback correctly (#4204)

19 months agoggml-cuda : support stablelm rope (#4156)
slaren [Fri, 24 Nov 2023 17:04:31 +0000 (18:04 +0100)]
ggml-cuda : support stablelm rope (#4156)

* ggml-cuda : support stablelm rope

* remove unused freq_base kernel parameter

* add n_dims parameter to llm_build_k_shift, default to n_rot via overload

* llama : fix llm_build_k_shift args

---------

Co-authored-by: Georgi Gerganov <redacted>
19 months agoconvert : fix tensors using grad in some models (#4173)
Galunid [Fri, 24 Nov 2023 14:02:49 +0000 (15:02 +0100)]
convert : fix tensors using grad in some models (#4173)

19 months agomain.swift : fix eos checking (#4197)
eastriver [Fri, 24 Nov 2023 09:25:10 +0000 (18:25 +0900)]
main.swift : fix eos checking (#4197)

llama_token_eos(const struct llama_model *) is currently getting struct llama_context type variable context as a parameter.

19 months agoreadme : use PATH for Windows ROCm (#4195)
Aaryaman Vasishta [Fri, 24 Nov 2023 07:52:39 +0000 (16:52 +0900)]
readme : use PATH for Windows ROCm (#4195)

* Update README.md to use PATH for Windows ROCm

* Update README.md

* Update README.md

19 months agoFix incorrect format strings and uninitialized variables. (#4133)
Haohui Mai [Thu, 23 Nov 2023 21:56:53 +0000 (13:56 -0800)]
Fix incorrect format strings and uninitialized variables. (#4133)

* Fix incorrect format strings and uninitialized variables.

* Address comments

* Add the missing include statement

19 months agollama : KV cache view API + better KV cache management (#4170)
Georgi Gerganov [Thu, 23 Nov 2023 17:07:56 +0000 (19:07 +0200)]
llama : KV cache view API + better KV cache management (#4170)

* llama : keep track of used KV cells + better KV cache management

* llama : zero KV cache used upon clear

ggml-ci

* llama : allow exporting a view of the KV cache (#4180)

* Allow exporting a view of the KV cache

* Allow dumping the sequences per cell in common

* Track max contiguous cells value and position as well

* Fix max contiguous empty cells index calculation

Make dump functions deal with lengths or sequences counts > 10 better

* Fix off by one error in dump_kv_cache_view

* Add doc comments for KV cache view functions

Eliminate cell sequence struct; use llama_seq_id directly

Minor cleanups

* common : add -dkvc arg for enabling kv cache dumps

---------

Co-authored-by: Kerfuffle <redacted>
19 months agoreadme : update hot topics
Georgi Gerganov [Thu, 23 Nov 2023 11:51:22 +0000 (13:51 +0200)]
readme : update hot topics

19 months agoexamples : fix typo in parallel example doc comment (#4181)
Daniel Bevenius [Thu, 23 Nov 2023 11:34:20 +0000 (12:34 +0100)]
examples : fix typo in parallel example doc comment (#4181)

Signed-off-by: Daniel Bevenius <redacted>
19 months agodocs : add llama-star arch idea
Georgi Gerganov [Thu, 23 Nov 2023 09:35:04 +0000 (11:35 +0200)]
docs : add llama-star arch idea

19 months agostablelm : simplify + speedup generation (#4153)
Galunid [Tue, 21 Nov 2023 15:22:30 +0000 (16:22 +0100)]
stablelm : simplify + speedup generation (#4153)

19 months agofinetune - update readme to mention llama support only (#4148)
Galunid [Mon, 20 Nov 2023 18:30:00 +0000 (19:30 +0100)]
finetune - update readme to mention llama support only (#4148)

19 months agoreadme : update ROCm Windows instructions (#4122)
Aaryaman Vasishta [Mon, 20 Nov 2023 15:02:46 +0000 (00:02 +0900)]
readme : update ROCm Windows instructions (#4122)

* Update README.md

* Update README.md

Co-authored-by: Jared Van Bortel <redacted>
---------

Co-authored-by: Jared Van Bortel <redacted>
19 months agomain : Add ChatML functionality to main example (#4046)
Seb C [Mon, 20 Nov 2023 13:56:59 +0000 (00:26 +1030)]
main : Add ChatML functionality to main example (#4046)

Co-authored-by: Sebastian Cramond <redacted>
19 months agoci : add flake8 to github actions (python linting) (#4129)
Galunid [Mon, 20 Nov 2023 10:35:47 +0000 (11:35 +0100)]
ci : add flake8 to github actions (python linting) (#4129)

Disabled rules:

* E203 Whitespace before ':' - disabled because we often use 'C' Style where values are aligned

* E211 Whitespace before '(' (E211) - disabled because we often use 'C' Style where values are aligned

* E221 Multiple spaces before operator - disabled because we often use 'C' Style where values are aligned

* E225 Missing whitespace around operator - disabled because it's broken so often it seems like a standard

* E231 Missing whitespace after ',', ';', or ':' - disabled because we often use 'C' Style where values are aligned

* E241 Multiple spaces after ',' - disabled because we often use 'C' Style where values are aligned

* E251 Unexpected spaces around keyword / parameter equals - disabled because it's broken so often it seems like a standard

* E261 At least two spaces before inline comment - disabled because it's broken so often it seems like a standard

* E266 Too many leading '#' for block comment - sometimes used as "section" separator

* E501 Line too long - disabled because it's broken so often it seems like a standard

* E701 Multiple statements on one line (colon) - broken only in convert.py when defining abstract methods (we can use# noqa instead)

* E704 Multiple statements on one line - broken only in convert.py when defining abstract methods (we can use# noqa instead)

19 months agospeculative : fix prompt tokenization in speculative example (#4025)
Branden Butler [Mon, 20 Nov 2023 09:50:04 +0000 (03:50 -0600)]
speculative : fix prompt tokenization in speculative example (#4025)

* Support special tokens and not adding BOS to prompt in speculative

* Adapt to new should_add_bos function

* Ensure tgt and dft have same add_bos setting

19 months agoRevert "finetune : add --n-gpu-layers flag info to --help (#4128)"
Georgi Gerganov [Sun, 19 Nov 2023 17:16:07 +0000 (19:16 +0200)]
Revert "finetune : add --n-gpu-layers flag info to --help (#4128)"

This reverts commit 05e8301e4593e2a67b4bae24f093dd12ce5cc7c2.

19 months agofinetune : add --n-gpu-layers flag info to --help (#4128)
Clark Saben [Sun, 19 Nov 2023 16:56:38 +0000 (11:56 -0500)]
finetune : add --n-gpu-layers flag info to --help (#4128)

19 months agoserver : relay error messages (#4131)
SoftwareRenderer [Sun, 19 Nov 2023 16:54:10 +0000 (11:54 -0500)]
server : relay error messages (#4131)

19 months agocommon : comma should be semicolon (#4137)
kchro3 [Sun, 19 Nov 2023 16:52:57 +0000 (08:52 -0800)]
common : comma should be semicolon (#4137)

19 months agogitignore : tokenize
Georgi Gerganov [Sun, 19 Nov 2023 16:50:49 +0000 (18:50 +0200)]
gitignore : tokenize

19 months agogguf-py : export chat templates (#4125)
slaren [Sun, 19 Nov 2023 10:10:52 +0000 (11:10 +0100)]
gguf-py : export chat templates (#4125)

* gguf-py : export chat templates

* llama.cpp : escape new lines in gguf kv info prints

* gguf-py : bump version

* gguf-py : check chat_template type

* gguf-py : initialize chat_template

19 months agotokenize example: Respect normal add BOS token behavior (#4126)
Kerfuffle [Sat, 18 Nov 2023 21:48:17 +0000 (14:48 -0700)]
tokenize example: Respect normal add BOS token behavior (#4126)

Allow building with Makefile

19 months agoscripts : Remove missed baichuan convert script (#4127)
Galunid [Sat, 18 Nov 2023 20:08:33 +0000 (21:08 +0100)]
scripts : Remove missed baichuan convert script (#4127)

19 months agoClean up ggml-cuda.cu warnings when compiling with clang (for ROCM) (#4124)
Kerfuffle [Sat, 18 Nov 2023 15:11:18 +0000 (08:11 -0700)]
Clean up ggml-cuda.cu warnings when compiling with clang (for ROCM) (#4124)

* ggml-cuda.cu: Clean up warnings when compiling with clang

* ggml-cuda.cu: Move static items into anonymous namespace

* ggml-cuda.cu: Fix use of namespace start macro

* Revert "ggml-cuda.cu: Fix use of namespace start macro"

This reverts commit 26c11490266c096e3e5731e05270a8f73a5b2874.

* Revert "ggml-cuda.cu: Move static items into anonymous namespace"

This reverts commit e29757e0f7535d1ac314300f0324684cc785e06c.

19 months agollama : increase max nodes (#4115)
slaren [Fri, 17 Nov 2023 19:39:11 +0000 (20:39 +0100)]
llama : increase max nodes (#4115)

19 months agobuild : support ppc64le build for make and CMake (#3963)
Roger Meier [Fri, 17 Nov 2023 16:11:23 +0000 (17:11 +0100)]
build : support ppc64le build for make and CMake (#3963)

* build: support ppc64le build for make and CMake

* build: keep __POWER9_VECTOR__ ifdef and extend with __powerpc64__

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

Co-authored-by: Georgi Gerganov <redacted>
19 months agotokenize : fix trailing whitespace
Georgi Gerganov [Fri, 17 Nov 2023 16:01:38 +0000 (18:01 +0200)]
tokenize : fix trailing whitespace

19 months agoexamples : add tokenize (#4039)
zakkor [Fri, 17 Nov 2023 15:36:44 +0000 (17:36 +0200)]
examples : add tokenize (#4039)

19 months agoconvert : use 'model' value if it exists. This allows karpathy/tinyllamas to load...
Don Mahurin [Fri, 17 Nov 2023 15:32:34 +0000 (07:32 -0800)]
convert : use 'model' value if it exists. This allows karpathy/tinyllamas to load (#4089)

Co-authored-by: Don Mahurin <@>
19 months agopy : Falcon HF compatibility (#4104)
John [Fri, 17 Nov 2023 15:24:30 +0000 (16:24 +0100)]
py : Falcon HF compatibility (#4104)

Falcon HF compatibility

19 months agocommon : improve yaml log escaping (#4080)
Jannis Schönleber [Fri, 17 Nov 2023 15:24:07 +0000 (16:24 +0100)]
common : improve yaml log escaping (#4080)

* logging: improve escaping in yaml output

* logging: include review feedback

19 months agollava : fix compilation warning that fread return value is not used (#4069)
Huawei Lin [Fri, 17 Nov 2023 15:22:56 +0000 (10:22 -0500)]
llava : fix compilation warning that fread return value is not used (#4069)

19 months agopy : remove superfluous import statements (#4076)
Jiří Podivín [Fri, 17 Nov 2023 15:20:53 +0000 (16:20 +0100)]
py : remove superfluous import statements (#4076)

Signed-off-by: Jiri Podivin <redacted>
Co-authored-by: Jiri Podivin <redacted>
19 months agotrain : move number of gpu layers argument parsing to common/train.cpp (#4074)
Jiří Podivín [Fri, 17 Nov 2023 15:19:16 +0000 (16:19 +0100)]
train : move number of gpu layers argument parsing to common/train.cpp (#4074)

- introduces help entry for the argument
 - cuts '--gpu-layers' form in order to simplify usage and documentation.

Signed-off-by: Jiri Podivin <redacted>
Co-authored-by: Jiri Podivin <redacted>
19 months agollama : add functions to get the model's metadata (#4013)
slaren [Fri, 17 Nov 2023 15:17:37 +0000 (16:17 +0100)]
llama : add functions to get the model's metadata (#4013)

* llama : add functions to get the model's metadata

* format -> std::to_string

* better documentation

19 months agofinetune : speed-up ggml_compute_forward_out_prod_f32 via BLAS (#4079)
gwjr [Fri, 17 Nov 2023 14:48:19 +0000 (14:48 +0000)]
finetune : speed-up ggml_compute_forward_out_prod_f32 via BLAS (#4079)

* Remove logically superfluous assertions and order by dimension

* Use cblas_sgemm() to implement ggml_compute_forward_out_prod()

* Remove ggml_compute_forward_out_prod_use_blas(), fix compiling errors on cmake/zig, remove trailing whitespace

* Add openBLAS support for sgemm() in compute_forward_out_prod()

19 months agofinetune : zero the loraB initial vectors (#4082)
Andrew Godfrey [Fri, 17 Nov 2023 10:23:11 +0000 (02:23 -0800)]
finetune : zero the loraB initial vectors (#4082)

* finetune : zero the loraB initial vectors

Without this, the first iteration is starting out far from the base model, instead of exactly on it.
Zeroing loraB is what the paper recommends. loralib also zeroes at least one of the init vector pairs
(though it departs from the paper in using a different distribution for the other vector, in some cases).

* tabs to spaces

* Use ggml_set_zero instead of adding a new function

19 months agocuda : get_row_rounding F32 (#4095)
Andrew Godfrey [Fri, 17 Nov 2023 08:01:15 +0000 (00:01 -0800)]
cuda : get_row_rounding F32 (#4095)

* Fix #4017

* Update ggml-cuda.cu

Co-authored-by: Jared Van Bortel <redacted>
* Update ggml-cuda.cu

Co-authored-by: Jared Van Bortel <redacted>
---------

Co-authored-by: Jared Van Bortel <redacted>
19 months agollama : fix data units (#4101)
Georgi Gerganov [Fri, 17 Nov 2023 08:00:15 +0000 (10:00 +0200)]
llama : fix data units (#4101)

* llama : fix data units

ggml-ci

* Revert "llama : fix data units"

This reverts commit f5feac831fe225ed7f3db938d115732a49dccfc4.

* llama : disambiguate data units

ggml-ci

19 months agoRespect tokenizer.ggml.add_bos_token value when tokenizing (#4040)
Kerfuffle [Fri, 17 Nov 2023 02:14:37 +0000 (19:14 -0700)]
Respect tokenizer.ggml.add_bos_token value when tokenizing (#4040)

* gguf-py: gguf-dump: Respect --no-tensor flag in JSON mode.

* Respect add_bos_token GGUF metadata value

* gguf-py: Try to fix SpecialVocab giving up too easily for the Nth time

19 months agogguf : fix potential infinite loops while parsing (#4100)
texmex76 [Thu, 16 Nov 2023 15:01:48 +0000 (16:01 +0100)]
gguf : fix potential infinite loops while parsing (#4100)

Co-authored-by: Bernhard Gstrein <redacted>
19 months agollama : restore prefix space in llama tokenizer (#4081)
Jared Van Bortel [Wed, 15 Nov 2023 16:34:47 +0000 (11:34 -0500)]
llama : restore prefix space in llama tokenizer (#4081)

19 months agoggml-cuda : increase max graph size (#4084)
slaren [Wed, 15 Nov 2023 12:58:13 +0000 (13:58 +0100)]
ggml-cuda : increase max graph size (#4084)

19 months agoFix MacOS Sonoma model quantization (#4052)
Michael Potter [Tue, 14 Nov 2023 17:34:41 +0000 (09:34 -0800)]
Fix MacOS Sonoma model quantization (#4052)

Co-authored-by: Jared Van Bortel <redacted>
Co-authored-by: Georgi Gerganov <redacted>
19 months agostablelm : StableLM support (#3586)
Galunid [Tue, 14 Nov 2023 10:17:12 +0000 (11:17 +0100)]
stablelm : StableLM support (#3586)

* Add support for stablelm-3b-4e1t
* Supports GPU offloading of (n-1) layers

19 months agoconvert.py: also look for plain model.safetensors (#4043)
afrideva [Tue, 14 Nov 2023 01:03:40 +0000 (17:03 -0800)]
convert.py: also look for plain model.safetensors  (#4043)

* add safetensors to convert.py help message

* Check for single-file safetensors model

* Update convert.py "model" option help message

* revert convert.py help message change

19 months agollava : fix regression for square images in #3613 (#4056)
M. Yusuf Sarıgöz [Mon, 13 Nov 2023 15:20:52 +0000 (18:20 +0300)]
llava : fix regression for square images in #3613 (#4056)

19 months agoggml : sync (im2col, GPU conv, 32-bit arm compat) (#4060)
Georgi Gerganov [Mon, 13 Nov 2023 14:55:52 +0000 (16:55 +0200)]
ggml : sync (im2col, GPU conv, 32-bit arm compat) (#4060)

ggml-ci

19 months agoreadme : update hot topics
Georgi Gerganov [Mon, 13 Nov 2023 12:18:08 +0000 (14:18 +0200)]
readme : update hot topics

19 months agosync : ggml (backend v2) (#3912)
Georgi Gerganov [Mon, 13 Nov 2023 12:16:23 +0000 (14:16 +0200)]
sync : ggml (backend v2) (#3912)

* sync : ggml (backend v2) (wip)

* sync : migrate examples and llama.cpp to dynamic graphs (wip)

* sync : update tests + fix max op params to 64

ggml-ci

* sync : ggml-cuda

ggml-ci

* llama : fix save/load state context size

ggml-ci

* sync : try to fix build on tvOS

* sync : pass custom graph sizes in training examples

* sync : update graph copies to new ggml API

* sync : update sync-ggml.sh with new files

* scripts : fix header in sync script

* train : fix context size calculations

* llama : increase inference graph size up to 4096 nodes

* train : allocate grads for backward graphs

* train : allocate grads for gb_tmp

19 months agoAdd ReLU and SQR CUDA ops to (partially) fix Persimmon offloading (#4041)
Kerfuffle [Mon, 13 Nov 2023 08:58:15 +0000 (01:58 -0700)]
Add ReLU and SQR CUDA ops to (partially) fix Persimmon offloading (#4041)

* Add ReLU and SQR CUDA ops to fix Persimmon offloading

* Persimmon loader: More helpful error on CUDA/ROCM when offloading too many layers

19 months agogguf-py: gguf_writer: Use bytearray to build metadata (#4051)
Kerfuffle [Sun, 12 Nov 2023 23:39:37 +0000 (16:39 -0700)]
gguf-py: gguf_writer: Use bytearray to build metadata (#4051)

* gguf-py: gguf_writer: Use BytesIO to build metadata

* Use bytearray instead

Bump gguf-py package version

19 months agoFix some documentation typos/grammar mistakes (#4032)
Richard Kiss [Sun, 12 Nov 2023 06:04:58 +0000 (22:04 -0800)]
Fix some documentation typos/grammar mistakes (#4032)

* typos

* Update examples/parallel/README.md

Co-authored-by: Kerfuffle <redacted>
---------

Co-authored-by: Kerfuffle <redacted>
19 months agoFix gguf-convert-endian script (#4037)
M. Yusuf Sarıgöz [Sat, 11 Nov 2023 15:35:31 +0000 (18:35 +0300)]
Fix gguf-convert-endian script (#4037)

* Fix gguf-convert-endian script

* Bump version and update description

19 months agoserver : fix crash when prompt exceeds context size (#3996)
Alexey Parfenov [Sat, 11 Nov 2023 05:48:21 +0000 (05:48 +0000)]
server : fix crash when prompt exceeds context size (#3996)

19 months agogguf-py: Refactor and allow reading/modifying existing GGUF files (#3981)
Kerfuffle [Sat, 11 Nov 2023 05:04:50 +0000 (22:04 -0700)]
gguf-py: Refactor and allow reading/modifying existing GGUF files (#3981)

* gguf-py: Refactor and add file reading support

* Replay changes from #3871

Credit to @cebtenzzre for that pull

* Various type annotation fixes.

* sort imports with isort (again)

* Fix missing return statement in add_tensor

* style cleanup with flake8

* fix NamedTuple and Enum usage

* Fix an issue with state init in GGUFReader

Move examples to an examples/ directory

Clean up examples

Add an example of modifying keys in a GGUF file

Update documentation with info on examples

Try to support people importing gguf/gguf.py directly

* Damagage is not a word.

* Clean up gguf-py/examples/modify_gguf.py whitespace

Co-authored-by: Jared Van Bortel <redacted>
* Update gguf-py/examples/modify_gguf.py formatting

Co-authored-by: Jared Van Bortel <redacted>
* Update gguf-py/gguf/gguf_reader.py type hint

Co-authored-by: Jared Van Bortel <redacted>
* Make examples executable, formatting changes

* Add more information to GGUFReader and examples comments

* Include a gguf Python package version bump

* Add convert-gguf-endian.py script

* cleanup

* gguf-py : bump minor version

* Reorganize scripts

* Make GGUFReader endian detection less arbitrary

* Add JSON dumping support to gguf-dump.py

Which I kind of regret now

* A few for gguf-dump.py cleanups

* Murder accidental tuple in gguf-py/scripts/gguf-dump.py

Co-authored-by: Jared Van Bortel <redacted>
* cleanup

* constants : remove unneeded type annotations

* fix python 3.8 compat

* Set up gguf- scripts in pyproject.toml

* And include scripts/__init__.py, derp

* convert.py: We can't currently support Q8_0 on big endian.

* gguf-py: SpecialVocab: Always try available sources for special token ids

gguf-py: SpecialVocab: Try to load merges from merges.txt if not in tokenizer.json

gguf-py: SpecialVocab: Add 'add_bos_token' type bools to GGUF metadata
u

* cleanup

* Promote add_X_token to GGUF metadata for BOS and EOS

---------

Co-authored-by: Jared Van Bortel <redacted>
Co-authored-by: Jared Van Bortel <redacted>
19 months agoserver : allow continue edit on completion mode (#3950)
Jhen-Jie Hong [Fri, 10 Nov 2023 22:49:33 +0000 (06:49 +0800)]
server : allow continue edit on completion mode (#3950)

* server : allow continue edit on completion mode

* server : handle abort case in runCompletion

* server : style improvement

19 months agoUnbreak persimmon after #3837 (#4010)
Galunid [Fri, 10 Nov 2023 13:24:54 +0000 (14:24 +0100)]
Unbreak persimmon after #3837 (#4010)

19 months agoscripts: Generalize convert scripts (#3838)
Galunid [Thu, 9 Nov 2023 10:09:29 +0000 (11:09 +0100)]
scripts: Generalize convert scripts (#3838)

* Replace convert-*-hf-to-gguf.py files with convert-hf-to-gguf.py

19 months agoserver : add min_p param (#3877)
Mihai [Thu, 9 Nov 2023 02:00:34 +0000 (04:00 +0200)]
server : add min_p param (#3877)

* Update server.cpp with min_p after it was introduced in https://github.com/ggerganov/llama.cpp/pull/3841

* Use spaces instead of tabs

* Update index.html.hpp after running deps.sh

* Fix test - fix line ending

19 months agoggml-alloc : fix backend assignments of views (#3982)
slaren [Wed, 8 Nov 2023 12:15:14 +0000 (13:15 +0100)]
ggml-alloc : fix backend assignments of views (#3982)

19 months agogguf : track writer state, free unneeded tensors, cleanup (#3871)
Jared Van Bortel [Tue, 7 Nov 2023 17:43:04 +0000 (12:43 -0500)]
gguf : track writer state, free unneeded tensors, cleanup (#3871)

19 months agomake : do not add linker flags when compiling static llava lib (#3977)
Georgi Gerganov [Tue, 7 Nov 2023 17:25:32 +0000 (19:25 +0200)]
make : do not add linker flags when compiling static llava lib (#3977)

19 months agoggml : fix backward rope after YaRN (#3974)
xaedes [Tue, 7 Nov 2023 08:04:51 +0000 (09:04 +0100)]
ggml : fix backward rope after YaRN (#3974)

* fix backward process of rope

rope backward process was broken after YaRN RoPE (#2268) implementation, due to missing changes in backward functions.

the code for the backward process is nearly identically to the forward process:
the only difference is the sign of the sin-values.

to avoid future regressions remove the near-duplicate backward functions and reuse the forward code:

for this a new function argument `bool forward` was added to `ggml_compute_forward_rope_f32` and `ggml_compute_forward_rope_f16`.
the sin-values will be negated when forward is false.

* fix finetune rope call to use correct default attn_factor of 1.0f

* remove unused `ggml_rope_xpos_back`

it is better to have only one `ggml_rope_back` function that accepts all rope parameters, so that `ggml_compute_backward` can propagate all parameters without having to switch between different rope_back variants.

* fix comments explaining the sinus sign in ggml_forward_rope

* add missing function arguments in declaration

* fix function argument type in declaration

19 months agoUse params when loading models in llava-cli (#3976)
Matthew Tejo [Tue, 7 Nov 2023 07:43:59 +0000 (23:43 -0800)]
Use params when loading models in llava-cli (#3976)

llava-cli was loading models with default params and ignoring settings
from the cli. This switches to a generic function to load the params
from the cli options.

19 months agocuda : supports running on CPU for GGML_USE_CUBLAS=ON build (#3946)
Meng Zhang [Tue, 7 Nov 2023 06:49:08 +0000 (22:49 -0800)]
cuda : supports running on CPU for GGML_USE_CUBLAS=ON build (#3946)

* protyping the idea that supports running on CPU for a GGML_USE_CUBLAS=on build

* doc: add comments to ggml_cublas_loaded()

* fix defined(...)

19 months agollava : expose as a shared library for downstream projects (#3613)
Damian Stewart [Mon, 6 Nov 2023 21:36:23 +0000 (22:36 +0100)]
llava : expose as a shared library for downstream projects (#3613)

* wip llava python bindings compatibility

* add external llava API

* add base64 in-prompt image support

* wip refactor image loading

* refactor image load out of llava init

* cleanup

* further cleanup; move llava-cli into its own file and rename

* move base64.hpp into common/

* collapse clip and llava libraries

* move llava into its own subdir

* wip

* fix bug where base64 string was not removed from the prompt

* get libllava to output in the right place

* expose llava methods in libllama.dylib

* cleanup memory usage around clip_image_*

* cleanup and refactor *again*

* update headerdoc

* build with cmake, not tested (WIP)

* Editorconfig

* Editorconfig

* Build with make

* Build with make

* Fix cyclical depts on Windows

* attempt to fix build on Windows

* attempt to fix build on Windows

* Upd TODOs

* attempt to fix build on Windows+CUDA

* Revert changes in cmake

* Fix according to review comments

* Support building as a shared library

* address review comments

---------

Co-authored-by: M. Yusuf Sarıgöz <redacted>
Co-authored-by: Jared Van Bortel <redacted>
20 months agoggml-cuda : fix f16 mul mat (#3961)
slaren [Sun, 5 Nov 2023 17:45:16 +0000 (18:45 +0100)]
ggml-cuda : fix f16 mul mat (#3961)

* ggml-cuda : fix f16 mul mat

ggml-ci

* silence common.cpp warning (bonus)

20 months agoAllow common process_escapes to handle \x sequences (#3928)
Kerfuffle [Sun, 5 Nov 2023 17:06:06 +0000 (10:06 -0700)]
Allow common process_escapes to handle \x sequences (#3928)

* Allow common process_escapes to handle \x sequences

* Fix edge case when second hex digit is NUL

20 months agoserver : fix typo for --alias shortcut from -m to -a (#3958)
Thái Hoàng Tâm [Sun, 5 Nov 2023 16:15:27 +0000 (23:15 +0700)]
server : fix typo for --alias shortcut from -m to -a (#3958)

20 months agocuda : fix disabling device with --tensor-split 1,0 (#3951)
Jared Van Bortel [Sun, 5 Nov 2023 15:08:57 +0000 (10:08 -0500)]
cuda : fix disabling device with --tensor-split 1,0 (#3951)

Co-authored-by: slaren <redacted>
20 months agollama : mark LLM_ARCH_STARCODER as full offload supported (#3945)
Meng Zhang [Sun, 5 Nov 2023 12:40:08 +0000 (04:40 -0800)]
llama : mark LLM_ARCH_STARCODER as full offload supported (#3945)

as done in https://github.com/ggerganov/llama.cpp/pull/3827

20 months agocmake : MSVC instruction detection (fixed up #809) (#3923)
Eve [Sun, 5 Nov 2023 08:03:09 +0000 (08:03 +0000)]
cmake : MSVC instruction detection (fixed up #809) (#3923)

* Add detection code for avx

* Only check hardware when option is ON

* Modify per code review sugguestions

* Build locally will detect CPU

* Fixes CMake style to use lowercase like everywhere else

* cleanup

* fix merge

* linux/gcc version for testing

* msvc combines avx2 and fma into /arch:AVX2 so check for both

* cleanup

* msvc only version

* style

* Update FindSIMD.cmake

---------

Co-authored-by: Howard Su <redacted>
Co-authored-by: Jeremy Dunn <redacted>
20 months agoci : use intel sde when ci cpu doesn't support avx512 (#3949)
Eve [Sun, 5 Nov 2023 07:46:44 +0000 (07:46 +0000)]
ci : use intel sde when ci cpu doesn't support avx512 (#3949)

20 months agocuda : revert CUDA pool stuff (#3944)
slaren [Sun, 5 Nov 2023 07:12:13 +0000 (08:12 +0100)]
cuda : revert CUDA pool stuff (#3944)

* Revert "cuda : add ROCM aliases for CUDA pool stuff (#3918)"

This reverts commit 629f917cd6b96ba1274c49a8aab163b1b189229d.

* Revert "cuda : use CUDA memory pool with async memory allocation/deallocation when available (#3903)"

This reverts commit d6069051de7165a4e06662c89257f5d2905bb156.

ggml-ci

20 months agogguf-py: Support 01.AI Yi models (#3943)
Kerfuffle [Sat, 4 Nov 2023 22:20:34 +0000 (16:20 -0600)]
gguf-py: Support 01.AI Yi models (#3943)

20 months agometal : round up to 16 to fix MTLDebugComputeCommandEncoder assertion (#3938)
Peter Sugihara [Fri, 3 Nov 2023 19:18:18 +0000 (12:18 -0700)]
metal : round up to 16 to fix MTLDebugComputeCommandEncoder assertion (#3938)

20 months agoggml-metal: fix yarn rope (#3937)
Xiao-Yong Jin [Fri, 3 Nov 2023 18:00:31 +0000 (13:00 -0500)]
ggml-metal: fix yarn rope (#3937)

20 months agoggml-cuda : move row numbers to x grid dim in mmv kernels (#3921)
slaren [Fri, 3 Nov 2023 11:13:09 +0000 (12:13 +0100)]
ggml-cuda : move row numbers to x grid dim in mmv kernels (#3921)

20 months agospeculative : change default p_accept to 0.5 + CLI args (#3919)
Georgi Gerganov [Fri, 3 Nov 2023 07:41:17 +0000 (09:41 +0200)]
speculative : change default p_accept to 0.5 + CLI args (#3919)

ggml-ci

20 months agocommon : YAYF (yet another YARN fix) (#3925)
Georgi Gerganov [Fri, 3 Nov 2023 07:24:00 +0000 (09:24 +0200)]
common : YAYF (yet another YARN fix) (#3925)

ggml-ci

20 months agollama : change yarn_ext_factor placeholder to -1 (#3922)
cebtenzzre [Fri, 3 Nov 2023 06:31:58 +0000 (02:31 -0400)]
llama : change yarn_ext_factor placeholder to -1 (#3922)

20 months agocuda : add ROCM aliases for CUDA pool stuff (#3918)
Kerfuffle [Thu, 2 Nov 2023 19:58:22 +0000 (13:58 -0600)]
cuda : add ROCM aliases for CUDA pool stuff (#3918)

20 months agocmake : fix relative path to git submodule index (#3915)
Andrei [Thu, 2 Nov 2023 19:40:31 +0000 (15:40 -0400)]
cmake : fix relative path to git submodule index (#3915)

20 months agoreadme : add notice about #3912
Georgi Gerganov [Thu, 2 Nov 2023 18:44:12 +0000 (20:44 +0200)]
readme : add notice about #3912

20 months agocuda : fix const ptrs warning causing ROCm build issues (#3913)
Georgi Gerganov [Thu, 2 Nov 2023 18:32:11 +0000 (20:32 +0200)]
cuda : fix const ptrs warning causing ROCm build issues (#3913)

20 months agocuda : use CUDA memory pool with async memory allocation/deallocation when available...
Oleksii Maryshchenko [Thu, 2 Nov 2023 17:10:39 +0000 (18:10 +0100)]
cuda : use CUDA memory pool with async memory allocation/deallocation when available (#3903)

* Using cuda memory pools for async alloc/dealloc.

* If cuda device doesnt support memory pool than use old implementation.

* Removed redundant cublasSetStream

---------

Co-authored-by: Oleksii Maryshchenko <redacted>
20 months agogguf : print error for GGUFv1 files (#3908)
Georgi Gerganov [Thu, 2 Nov 2023 14:22:30 +0000 (16:22 +0200)]
gguf : print error for GGUFv1 files (#3908)

20 months agocmake : disable LLAMA_NATIVE by default (#3906)
slaren [Thu, 2 Nov 2023 12:10:33 +0000 (13:10 +0100)]
cmake : disable LLAMA_NATIVE by default (#3906)

20 months agogguf : remove special-case code for GGUFv1 (#3901)
Georgi Gerganov [Thu, 2 Nov 2023 09:20:21 +0000 (11:20 +0200)]
gguf : remove special-case code for GGUFv1 (#3901)

ggml-ci

20 months agollm : prevent from 1-D tensors being GPU split (#3697)
Georgi Gerganov [Thu, 2 Nov 2023 07:54:18 +0000 (09:54 +0200)]
llm : prevent from 1-D tensors being GPU split (#3697)

20 months agobuild : link against build info instead of compiling against it (#3879)
cebtenzzre [Thu, 2 Nov 2023 06:50:16 +0000 (02:50 -0400)]
build : link against build info instead of compiling against it (#3879)

* cmake : fix build when .git does not exist

* cmake : simplify BUILD_INFO target

* cmake : add missing dependencies on BUILD_INFO

* build : link against build info instead of compiling against it

* zig : make build info a .cpp source instead of a header

Co-authored-by: Matheus C. França <redacted>
* cmake : revert change to CMP0115

---------

Co-authored-by: Matheus C. França <redacted>
20 months agocuda : check if this fixes Pascal card regression (#3882)
Georgi Gerganov [Thu, 2 Nov 2023 06:35:10 +0000 (08:35 +0200)]
cuda : check if this fixes Pascal card regression (#3882)

20 months agometal : fix build errors and kernel sig after #2268 (#3898)
Georgi Gerganov [Thu, 2 Nov 2023 06:33:37 +0000 (08:33 +0200)]
metal : fix build errors and kernel sig after #2268 (#3898)

20 months agocuda : fix RoPE after #2268 (#3897)
cebtenzzre [Thu, 2 Nov 2023 05:49:44 +0000 (01:49 -0400)]
cuda : fix RoPE after #2268 (#3897)

20 months agollama : fix llama_context_default_params after #2268 (#3893)
cebtenzzre [Wed, 1 Nov 2023 23:29:14 +0000 (19:29 -0400)]
llama : fix llama_context_default_params after #2268 (#3893)

20 months agoggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel (#3891)
slaren [Wed, 1 Nov 2023 22:10:09 +0000 (23:10 +0100)]
ggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel (#3891)

* ggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel

* fix warnings

20 months agollama : implement YaRN RoPE scaling (#2268)
cebtenzzre [Wed, 1 Nov 2023 22:04:33 +0000 (18:04 -0400)]
llama : implement YaRN RoPE scaling (#2268)

Co-authored-by: cebtenzzre <redacted>
Co-authored-by: Jeffrey Quesnelle <redacted>