]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
20 months agospeculative : ensure draft and target model vocab matches (#3812)
Kerfuffle [Fri, 27 Oct 2023 21:40:07 +0000 (15:40 -0600)]
speculative : ensure draft and target model vocab matches (#3812)

* speculative: Ensure draft and target model vocab matches

* Tolerate small differences when checking dft vs tgt vocab

20 months agollama : correctly report GGUFv3 format (#3818)
cebtenzzre [Fri, 27 Oct 2023 21:33:53 +0000 (17:33 -0400)]
llama : correctly report GGUFv3 format (#3818)

20 months agosimple : fix batch handling (#3803)
Thibault Terrasson [Fri, 27 Oct 2023 14:37:41 +0000 (16:37 +0200)]
simple : fix batch handling (#3803)

20 months agocuda : improve text-generation and batched decoding performance (#3776)
Georgi Gerganov [Fri, 27 Oct 2023 14:01:23 +0000 (17:01 +0300)]
cuda : improve text-generation and batched decoding performance (#3776)

* cuda : prints wip

* cuda : new cublas gemm branch for multi-batch quantized src0

* cuda : add F32 sgemm branch

* cuda : fine-tune >= VOLTA params + use MMQ only for small batches

* cuda : remove duplicated cuBLAS GEMM code

* cuda : add CUDA_USE_TENSOR_CORES and GGML_CUDA_FORCE_MMQ macros

* build : add compile option to force use of MMQ kernels

20 months agoserver : do not release slot on image input (#3798)
Georgi Gerganov [Thu, 26 Oct 2023 19:53:37 +0000 (22:53 +0300)]
server : do not release slot on image input (#3798)

20 months agobatched-bench : print params at start
Georgi Gerganov [Wed, 25 Oct 2023 07:26:27 +0000 (10:26 +0300)]
batched-bench : print params at start

20 months agolog : disable pid in log filenames
Georgi Gerganov [Wed, 25 Oct 2023 07:09:16 +0000 (10:09 +0300)]
log : disable pid in log filenames

20 months agoserver : add parameter -tb N, --threads-batch N (#3584) (#3768)
cebtenzzre [Tue, 24 Oct 2023 20:10:43 +0000 (16:10 -0400)]
server : add parameter -tb N, --threads-batch N (#3584) (#3768)

Co-authored-by: Michael Coppola <redacted>
Co-authored-by: Michael Coppola <redacted>
20 months agoserver : do not block system prompt update (#3767)
Georgi Gerganov [Tue, 24 Oct 2023 20:08:20 +0000 (23:08 +0300)]
server : do not block system prompt update (#3767)

* server : do not block system prompt update

* server : update state machine logic to process system prompts

* server : minor

20 months agosync : ggml (conv ops + cuda MSVC fixes) (#3765)
Georgi Gerganov [Tue, 24 Oct 2023 18:51:20 +0000 (21:51 +0300)]
sync : ggml (conv ops + cuda MSVC fixes) (#3765)

ggml-ci

20 months agocmake : add missed dependencies (#3763)
John Smith [Tue, 24 Oct 2023 17:48:45 +0000 (01:48 +0800)]
cmake : add missed dependencies (#3763)

20 months agocuda : add batched cuBLAS GEMM for faster attention (#3749)
Georgi Gerganov [Tue, 24 Oct 2023 13:48:37 +0000 (16:48 +0300)]
cuda : add batched cuBLAS GEMM for faster attention (#3749)

* cmake : add helper for faster CUDA builds

* batched : add NGL arg

* ggml : skip nops in compute_forward

* cuda : minor indentation

* cuda : batched cuBLAS GEMMs for src0 F16 and src1 F32 (attention ops)

* Apply suggestions from code review

These changes plus:

```c++
#define cublasGemmBatchedEx hipblasGemmBatchedEx
```

are needed to compile with ROCM. I haven't done performance testing, but it seems to work.

I couldn't figure out how to propose a change for lines outside what the pull changed, also this is the first time trying to create a multi-part review so please forgive me if I mess something up.

* cuda : add ROCm / hipBLAS cublasGemmBatchedEx define

* cuda : add cublasGemmStridedBatchedEx for non-broadcasted cases

* cuda : reduce mallocs in cublasGemmBatchedEx branch

* cuda : add TODO for calling cublas from kernel + using mem pool

---------

Co-authored-by: Kerfuffle <redacted>
20 months agoAdd more tokenizer tests (#3742)
Galunid [Tue, 24 Oct 2023 07:17:17 +0000 (09:17 +0200)]
Add more tokenizer tests (#3742)

* Add more tokenizer tests

* Add starcoder

* Update test vocab files

* Restrict bpe tokenizer tests to unicode planes

* Update comment

* Comment cosmetics

* Remove bloom vocab/test

20 months agometal : handle ggml_scale for n%4 != 0 (close #3754)
Georgi Gerganov [Tue, 24 Oct 2023 06:46:50 +0000 (09:46 +0300)]
metal : handle ggml_scale for n%4 != 0 (close #3754)

ggml-ci

20 months agoRevert "make : add optional CUDA_NATIVE_ARCH (#2482)"
Georgi Gerganov [Mon, 23 Oct 2023 20:46:05 +0000 (23:46 +0300)]
Revert "make : add optional CUDA_NATIVE_ARCH (#2482)"

This reverts commit 96981f37b1e3f450d9e63e571514217bf60f0a7f.

See:

https://github.com/ggerganov/llama.cpp/pull/2482#issuecomment-1775975866

20 months agoissues : separate bug and enhancement template + no default title (#3748)
M. Yusuf Sarıgöz [Mon, 23 Oct 2023 19:57:16 +0000 (22:57 +0300)]
issues : separate bug and enhancement template + no default title (#3748)

20 months agoUpdate special token handling in conversion scripts for gpt2 derived tokenizers ...
Galunid [Mon, 23 Oct 2023 19:46:00 +0000 (21:46 +0200)]
Update special token handling in conversion scripts for gpt2 derived tokenizers (#3746)

We still have the heads up in `README.md` regarding `bpe` tokenizers and this patch is needed for

- a couple of tokenizer tests
- some more `special` and `non-special` added tokens handling (as far as I understand it)

* Update special token handling

* Add mpt

20 months agollama : remove token functions with `context` args in favor of `model` (#3720)
Marcus Dunn [Mon, 23 Oct 2023 19:40:03 +0000 (12:40 -0700)]
llama : remove token functions with `context` args in favor of `model` (#3720)

* added `llama_model_token_*` variants to all the `llama_token_*` functions.

* added `LLAMA_API`

* formatting

Co-authored-by: Georgi Gerganov <redacted>
* removed old `llama_token` functions

* changed 3 more functions to take in model

- `llama_token_get_text`
- `llama_token_get_score`
- `llama_token_get_type`

* added back docs

* fixed main.cpp

* changed token functions to use new model variants

* changed token functions to use new model variants

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agoFix baichuan convert script not detecing model (#3739)
Galunid [Mon, 23 Oct 2023 15:47:03 +0000 (17:47 +0200)]
Fix baichuan convert script not detecing model (#3739)

It seems nobody objects.

20 months agomake : add optional CUDA_NATIVE_ARCH (#2482)
Alex [Sun, 22 Oct 2023 19:56:53 +0000 (15:56 -0400)]
make : add optional CUDA_NATIVE_ARCH (#2482)

Use the environment variable `CUDA_NATIVE_ARCH` if present to set NVCC arch. Otherwise, use `native`.

20 months agoserver : parallel decoding and multimodal (#3677)
Georgi Gerganov [Sun, 22 Oct 2023 19:53:08 +0000 (22:53 +0300)]
server : parallel decoding and multimodal (#3677)

* implementing parallel decoding in server example

* crash fixed

* save dev progress

* refactored sampling function

* completion endpoint working

* multiple client support

* grammar + no stream completion

* cached prompt support

* chat.mjs support cached prompt + some fixes

* server ui now support multiple clients

* unused change reverted

* fixed timings per slot

* add context swap

* add changes to README.md

* llava multimodal integration

* fixed tokens probs

* add multimodal input - alfa

* refactor code + remove unused comments + improved README.md

* fix compilation errors with llvm

* notify the user from server ui that multimodality is unavialable

* some ci fixes

* fix ci make build undefined ref errors

* fix long prompt than ctx proposed in #3639

* fixed premature end due stop word

* context shift fixed

* fix llava implementation

* sync README.md changes

* readme change

* update api like OpenAI

* multimodal support enabled by default

* fix make bui;d errors

* fix multiple clients

* fix zig build

* new sampling API

* latest changes of sampling API

* server : coding-style normalization

* server : coding-style normalization (part 2)

* server : remove beam-search functionality

* server : bug fix in ingest_images

n_tokens is incremented internally by llama_batch_add

* server : use refs + use llama_batch_clear()

* server : snake case

* server : minor sync

* added thread safe pipeline

* server : bach has to be allocated for n_parallel sequences

* server : no need for atomic int - already using mutex

* server : logs + minor code style

* server : fix multibyte handle in partial response (#3706)

* fix image load + view image in chat

* make : silence stb warnings

* clip : link to ggml, not to llama

* server : fix switch fallthrough

* server : fix crash in Debug on macOS (I have no idea why this fixes it!?)

* server : refactor ctx_sampling init + n_ctx + names

* server : bug fix for prompt caching

* Do not save/load image_data to localStorage

* editorconfig : new line in index.html

* server : completion requests remember slot_id

* Update readme to document multimodal in server

* server : minor style

* Update readme to document multimodal in server

* server : hide ctx_sampling->prev behind API (#3696)

* server : apply fix from #3722

* server : fix slot reuse

* server : add comment about changing slot_state to bool

---------

Co-authored-by: FSSRepo <redacted>
Co-authored-by: Damian Stewart <redacted>
Co-authored-by: Steward Garcia <redacted>
Co-authored-by: Jhen-Jie Hong <redacted>
Co-authored-by: M. Yusuf Sarıgöz <redacted>
20 months agoAdd test for MPT tokenization (#3728)
goerch [Sun, 22 Oct 2023 19:21:42 +0000 (21:21 +0200)]
Add test for MPT tokenization (#3728)

* Add test for MPT tokenization

* Revert code motion

* Remove unnecessary restriction in test case

* Clarify logic in conversion

20 months agoreadme : remove unsupported node.js library (#3703)
Ian Scrivener [Sun, 22 Oct 2023 18:16:43 +0000 (05:16 +1100)]
readme : remove unsupported node.js library (#3703)

- https://github.com/Atome-FE/llama-node is quite out of date
- doesn't support recent/current llama.cpp functionality

20 months agollama : validate special token ids are in range when loading GGUF model (#3635)
Kerfuffle [Sun, 22 Oct 2023 18:14:56 +0000 (12:14 -0600)]
llama : validate special token ids are in range when loading GGUF model (#3635)

* Add validation for special token ids to llama.cpp

Small optimization for llama_byte_to_token SPM mode

* Fix BPE newline check, only I could break something so simple

* Killll meeeeee

* Account for GGUF_KEY_KEY only setting when the key exists

* Minor code cleanups.

* Fix convert.py error msg when added tokens are out of range

* Make gguf SpecialVocab vocab size-aware

Update conversion scripts accordingly

* Avoid a string copy

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

Co-authored-by: Georgi Gerganov <redacted>
20 months agomain : escape prompt for cfg_negative_prompt and consecutive inputs in main with...
vvhg1 [Sun, 22 Oct 2023 18:09:51 +0000 (20:09 +0200)]
main : escape prompt for cfg_negative_prompt and consecutive inputs in main with interactive (#3623)

* infill tokens correction

* serverinfill tokens correction

* removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape

* removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape

* only rm when params.escape, rm space if possible which is added back or rm added space token

* only rm when params.escape, rm space if possible which is added back or rm added space token

* Revert "only rm when params.escape, rm space if possible which is added back or rm added space token"

This reverts commit 63ba0b621f21077c0e3bc6ba6a327534123cb738.

* fix interactive prompt escaping and fix server infill leading space handling

* rm unnecessary bool check

* process escapes for neg prompt and interactive consec prompts

* removed unneccessary static string escape

20 months agobatched : add len CLI argument
Georgi Gerganov [Sun, 22 Oct 2023 05:37:20 +0000 (08:37 +0300)]
batched : add len CLI argument

20 months agoCLBlast: Add outer loops over src0 for broadcasting in mulmat
shibe2 [Thu, 12 Oct 2023 12:01:23 +0000 (16:01 +0400)]
CLBlast: Add outer loops over src0 for broadcasting in mulmat

Reduce repeated dequantization of the same data.

20 months agosampling : refactor init to use llama_sampling_params (#3696)
Georgi Gerganov [Fri, 20 Oct 2023 18:07:23 +0000 (21:07 +0300)]
sampling : refactor init to use llama_sampling_params (#3696)

* sampling : refactor init to use llama_sampling_params

* llama : combine repetition, frequency and presence penalties in 1 call

* examples : remove embd-input and gptneox-wip

* sampling : rename penalty params + reduce size of "prev" vector

* sampling : add llama_sampling_print helper

* sampling : hide prev behind API and apply #3661

ggml-ci

20 months agogguf : support big endian platform (#3552)
Qin Yue Chen [Fri, 20 Oct 2023 11:19:40 +0000 (06:19 -0500)]
gguf : support big endian platform (#3552)

* check whether platform is 390x if yes->do not import immintrin.h

* support s390x big endian

* support --bigendian option for s390x
1. verified with baichuan7b-chat with float 16 on s390x
2. verified with baichuan7b-chat
3. verified with chinese-alpaca-2-13b-f16

* update format based on editor-config checker result

* Update convert-baichuan-hf-to-gguf.py

* 1. check in ggml.c if endianess is not match
2. update GGUF version
3. change get_pack_prefix to property
4. update information log

* always use "GGUF" as beginng of GGUF file

* Compare "GGUF" with file header char by char
1.  Set GGUF_MAGIC to "GGUF" string instead of int value
2. Compare "GGUF" char by char to ensure its byte order
3. Move bytes swap code from convert.py to gguf.py write_tensor_data

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agoserver : fix uninitialized sampling context (close #3685)
Georgi Gerganov [Fri, 20 Oct 2023 10:06:10 +0000 (13:06 +0300)]
server : fix uninitialized sampling context (close #3685)

20 months agoggml : fix rope + llama minor optimizations (#3560)
Herman Semenov [Fri, 20 Oct 2023 10:02:12 +0000 (10:02 +0000)]
ggml : fix rope + llama minor optimizations (#3560)

* Minor fixes and fixed memleak

* Using const auto references in range-based loop C++17

20 months agoconvert : restore compat with old Falcon models (#3680)
cebtenzzre [Fri, 20 Oct 2023 05:32:08 +0000 (01:32 -0400)]
convert : restore compat with old Falcon models (#3680)

20 months agomultimodal : add BakLLaVA conversion support (#3682)
M. Yusuf Sarıgöz [Thu, 19 Oct 2023 16:40:41 +0000 (19:40 +0300)]
multimodal : add BakLLaVA conversion support (#3682)

20 months agollava : avoid segfault in case of non-existent mmproj file (#3674)
M. Yusuf Sarıgöz [Thu, 19 Oct 2023 13:59:11 +0000 (16:59 +0300)]
llava : avoid segfault in case of non-existent mmproj file (#3674)

20 months agoreadme : update hot topics
Georgi Gerganov [Wed, 18 Oct 2023 18:44:43 +0000 (21:44 +0300)]
readme : update hot topics

20 months agospeculative : bug fixes
Georgi Gerganov [Wed, 18 Oct 2023 15:49:40 +0000 (18:49 +0300)]
speculative : bug fixes

20 months agospeculative : add tree-based sampling example (#3624)
Georgi Gerganov [Wed, 18 Oct 2023 13:21:57 +0000 (16:21 +0300)]
speculative : add tree-based sampling example (#3624)

* sampling : one sequence per sampling context

ggml-ci

* speculative : add tree-based sampling support

ggml-ci

* speculative : reuse the n_parallel CLI param

* speculative : refactor sampling

* examples : fix build after sampling refactoring

ggml-ci

* batched : fix n_seq_id

* sampling : fix malloc

ggml-ci

* swift : fix build

ggml-ci

* swift : try to fix build

ggml-ci

* prompts : add assistant.txt

* common : add llama_batch_add() and llama_batch_clear() helpers

* speculative : minor refactor

ggml-ci

* minor : comments + rename

ggml-ci

* speculative : fix off-by-one for n_drafted

* speculative : fix the n_drafted fix + p constants

20 months agometal : implement q5_0 and q5_1 kernels (#3648)
Jhen-Jie Hong [Wed, 18 Oct 2023 12:21:48 +0000 (07:21 -0500)]
metal : implement q5_0 and q5_1 kernels (#3648)

* metal : implement dequantize_q5_0

* metal : block_q_n_dot_y for block_q5_0 (broken)

* metal : revert unnecessary change

* metal : implement dequantize_q5_1

* metal : block_q_n_dot_y for q5_1 (broken)

* metal : fix block_q_n_dot_y

* minor : spaces / formatting

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agoopencl : fix element-wise multiplication (#3656)
shibe2 [Wed, 18 Oct 2023 12:09:22 +0000 (16:09 +0400)]
opencl : fix element-wise multiplication (#3656)

20 months agofix embeddings when using CUDA (#3657)
slaren [Tue, 17 Oct 2023 20:24:50 +0000 (22:24 +0200)]
fix embeddings when using CUDA (#3657)

20 months agollama : avoid fprintf in favor of LLAMA_LOG (#3538)
Georgi Gerganov [Tue, 17 Oct 2023 19:34:26 +0000 (22:34 +0300)]
llama : avoid fprintf in favor of LLAMA_LOG (#3538)

20 months agoreadme : update hot-topics & models, detail windows release in usage (#3615)
BarfingLemurs [Tue, 17 Oct 2023 18:13:21 +0000 (14:13 -0400)]
readme : update hot-topics & models, detail windows release in usage (#3615)

* Update README.md

* Update README.md

* Update README.md

* move "Running on Windows" section below "Prepare data and run"

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agoCLBlast: Fix temporary buffer size for f16 conversion (wsize)
shibe2 [Wed, 11 Oct 2023 17:30:06 +0000 (21:30 +0400)]
CLBlast: Fix temporary buffer size for f16 conversion (wsize)

Fix buffer overflow.
Reduce the size to fit just one 2D slice.
Assert sufficient size.

20 months agotrain-text-from-scratch : fix assert failure in ggml-alloc (#3618)
slaren [Tue, 17 Oct 2023 17:00:58 +0000 (19:00 +0200)]
train-text-from-scratch : fix assert failure in ggml-alloc (#3618)

20 months agoeditorconfig : remove trailing spaces
Georgi Gerganov [Tue, 17 Oct 2023 16:52:53 +0000 (19:52 +0300)]
editorconfig : remove trailing spaces

20 months agoserver : documentation of JSON return value of /completion endpoint (#3632)
coezbek [Tue, 17 Oct 2023 16:51:02 +0000 (18:51 +0200)]
server : documentation of JSON return value of /completion endpoint (#3632)

* Added documentation of JSON return value of /completion endpoint

* Update examples/server/README.md

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agosave-load-state : fix example + add ci test (#3655)
Georgi Gerganov [Tue, 17 Oct 2023 16:12:46 +0000 (19:12 +0300)]
save-load-state : fix example + add ci test (#3655)

* save-load-state : fix example (close #3606)

* ci : add test for save-load-state example

ggml-ci

20 months agoreadme : add Aquila2 links (#3610)
ldwang [Tue, 17 Oct 2023 15:52:33 +0000 (23:52 +0800)]
readme : add Aquila2 links (#3610)

Signed-off-by: ldwang <redacted>
Co-authored-by: ldwang <redacted>
20 months agotokenizer : special token handling (#3538)
staviq [Tue, 17 Oct 2023 15:11:01 +0000 (17:11 +0200)]
tokenizer : special token handling (#3538)

* Rewrite special token handling from #1931

* shorten param name, add st verification by type

* use offsets instead of copy by substr

* formatting, remove copying iterator on delete

* llama : normalize code-style

* swift fix

* print pfx/sfx if verb, main: split pfx input sfx

* dont add space when using special tokens

* minor : comment + spacing

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agok-quants : fix quantization ranges (#3646)
Georgi Gerganov [Tue, 17 Oct 2023 06:19:28 +0000 (09:19 +0300)]
k-quants : fix quantization ranges (#3646)

20 months agollava : fix tokenization to not add bos between image embeddings and user prompt...
Georgi Gerganov [Mon, 16 Oct 2023 20:58:00 +0000 (23:58 +0300)]
llava : fix tokenization to not add bos between image embeddings and user prompt (#3645)

* llava : fix tokenization to not add bos after system prompt

* set seed

---------

Co-authored-by: M. Yusuf Sarıgöz <redacted>
20 months agoMPT : support GQA for replit-code-v1.5 (#3627)
cebtenzzre [Sun, 15 Oct 2023 06:32:06 +0000 (02:32 -0400)]
MPT : support GQA for replit-code-v1.5 (#3627)

20 months agoHonor -ngl option for Cuda offloading in llava (#3621)
M. Yusuf Sarıgöz [Sat, 14 Oct 2023 10:52:44 +0000 (13:52 +0300)]
Honor -ngl option for Cuda offloading in llava (#3621)

20 months agollama : remove n_threads from llama_decode_internal (#3614)
Daniel Bevenius [Fri, 13 Oct 2023 10:33:16 +0000 (12:33 +0200)]
llama : remove n_threads from llama_decode_internal (#3614)

This commit removes `n_threads` from the `llama_decode_internal`
functions doc comment as it does not exist anymore.

It looks like this parameter was removed in
Commit 16bc66d9479edd5ee12ec734973554d4493c5dfa ("llama.cpp : split
llama_context_params into model and context params").

Signed-off-by: Daniel Bevenius <redacted>
20 months agoggml : add context enumeration functions (#3605)
slaren [Fri, 13 Oct 2023 10:23:10 +0000 (12:23 +0200)]
ggml : add context enumeration functions (#3605)

finetune : fix assert failure in ggml-alloc

20 months agoCLBlast: Fix matrix-vector multiplication (#3544)
shibe2 [Thu, 12 Oct 2023 19:59:47 +0000 (23:59 +0400)]
CLBlast: Fix matrix-vector multiplication (#3544)

20 months agoexamples: support LLaVA v1.5 (multimodal model) (#3436)
M. Yusuf Sarıgöz [Thu, 12 Oct 2023 15:23:18 +0000 (18:23 +0300)]
examples: support LLaVA v1.5 (multimodal model) (#3436)

* WIP: start implementing LLaVA

* rm scratch buf for now, will revert after cleanup

* LLaVA image encoder is working. will combine with llama

* Add llava inference code, but it's buggy. debugging

* LLaVA is working e2e, needs to optimize memory allocation + cleanup

* Use ggml_allocr + rm unnecessary code

* fix: crlf -> lf

* fix: new line at EoF

* fix: trailing whitespace

* Add readme

* Update readme

* Some cleanup

* Are you happy editorconfig?

* rm unused batch image preprocessing

* rm unused import

* fix: rm designated initializers

* introduce pad-to-square mode for non-square images

* are you happy editorconfig?

* gitignore /llava

* Handle cases where image file does not exist

* add llava target to Makefile

* add support for 13b model variant

* Maybe seed is unlucky?

* Check if apples are compared to apples

* are you happy editorconfig?

* Use temperature = 0.1 by default

* command line: use gpt_params_parse()

* minor

* handle default n_predict

* fix typo

* llava : code formatting, rename files, fix compile warnings

* do not use Wno-cast-qual for MSVC

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agodocs : fix typo GOMP_CPU_AFFINITY (#3597)
uint256_t [Thu, 12 Oct 2023 13:36:16 +0000 (22:36 +0900)]
docs : fix typo GOMP_CPU_AFFINITY (#3597)

20 months agocmake : fix add_compile_options on macOS
Georgi Gerganov [Thu, 12 Oct 2023 11:31:05 +0000 (14:31 +0300)]
cmake : fix add_compile_options on macOS

20 months agotypo : it is `--n-gpu-layers` not `--gpu-layers` (#3592)
Ian Scrivener [Thu, 12 Oct 2023 11:10:50 +0000 (22:10 +1100)]
typo : it is `--n-gpu-layers` not `--gpu-layers` (#3592)

fixed a typo in the MacOS Metal run doco

20 months agoci : check if there is enough VRAM (#3596)
Georgi Gerganov [Thu, 12 Oct 2023 10:44:56 +0000 (13:44 +0300)]
ci : check if there is enough VRAM (#3596)

ggml-ci

20 months agoserver : add completion mode (no chat) (#3582)
Aarni Koskela [Thu, 12 Oct 2023 06:51:53 +0000 (15:51 +0900)]
server : add completion mode (no chat) (#3582)

20 months agoprompts : add mnemonics.txt
Georgi Gerganov [Thu, 12 Oct 2023 06:35:19 +0000 (09:35 +0300)]
prompts : add mnemonics.txt

20 months agoserver : fix kv cache management (#3588)
Georgi Gerganov [Thu, 12 Oct 2023 06:29:04 +0000 (09:29 +0300)]
server : fix kv cache management (#3588)

20 months agomain : fix session loading bug (#3400)
Georgi Gerganov [Wed, 11 Oct 2023 20:55:08 +0000 (23:55 +0300)]
main : fix session loading bug (#3400)

20 months agoserver : add parameter -tb N, --threads-batch N (#3584)
Michael Coppola [Wed, 11 Oct 2023 19:42:22 +0000 (15:42 -0400)]
server : add parameter -tb N, --threads-batch N (#3584)

Co-authored-by: Michael Coppola <redacted>
20 months agocommon : fix mirostat state when using multiple sequences (#3543)
Kerfuffle [Wed, 11 Oct 2023 19:35:46 +0000 (13:35 -0600)]
common : fix mirostat state when using multiple sequences (#3543)

* Fix mirostat state when using multiple sequences

* Fix mirostat by completely refactoring sampling!

* Try to fix zig build.

* Export function to fetch/create default sampler states

Code formatting cleanups and add some comments

Silence a warning about id not being used when logging is disabled

* Apply some renaming suggestions.

Fix comments that were out of sync with the pull.

* Use more consistant naming convention for sampling contexts

20 months agobatched : add bench tool (#3545)
Georgi Gerganov [Wed, 11 Oct 2023 18:25:33 +0000 (21:25 +0300)]
batched : add bench tool (#3545)

* batched : add bench tool

* batched : minor fix table

* batched-bench : add readme + n_kv_max is now configurable

* batched-bench : init warm-up batch

* batched-bench : pass custom set of PP, TG and PL

* batched-bench : add mmq CLI arg

20 months agoexamples : add batched.swift + improve CI for swift (#3562)
Zane Shannon [Wed, 11 Oct 2023 11:14:05 +0000 (04:14 -0700)]
examples : add batched.swift + improve CI for swift (#3562)

20 months agoAdd MPT model to supported models in README.md (#3574)
Galunid [Tue, 10 Oct 2023 23:02:49 +0000 (01:02 +0200)]
Add MPT model to supported models in README.md (#3574)

20 months agoMinor improvements in GPT2 tokenizer (#3567)
goerch [Tue, 10 Oct 2023 16:59:52 +0000 (18:59 +0200)]
Minor improvements in GPT2 tokenizer (#3567)

* Fixing minor bugs in bpe_gpt2_preprocess

* Don't add bos token in test

20 months agoreadme : add bloom (#3570)
Xingchen Song(宋星辰) [Tue, 10 Oct 2023 16:28:50 +0000 (00:28 +0800)]
readme : add bloom (#3570)

20 months agollm : add bloom models (#3553)
Xingchen Song(宋星辰) [Tue, 10 Oct 2023 14:48:21 +0000 (22:48 +0800)]
llm : add bloom models (#3553)

* feat: Support bloom models

* fix(bloom): fix model size

---------

Co-authored-by: Georgi Gerganov <redacted>
20 months agoswift : improvements and fixes (#3564)
Jhen-Jie Hong [Tue, 10 Oct 2023 11:31:13 +0000 (06:31 -0500)]
swift : improvements and fixes (#3564)

* swift : use macOS 12 as minimum requirement

* swift : add missing ggml-backend.c source

* swift : add -O3 -DNDEBUG unsafe flags

20 months agollm : add MPT support (#3417)
Jan Ploski [Tue, 10 Oct 2023 07:50:23 +0000 (09:50 +0200)]
llm : add MPT support (#3417)

* CUDA: added support for ggml_clamp (see also: https://github.com/ggerganov/ggml/issues/545)

* mpt : added an implementation based (mostly) on falcon integration, modified with deltas from ggml/examples/mpt

* mpt : protect against "clip_qkv": null in mpt-7b

* mpt : quick fix to avoid "Strange model" warning when quantizing MPT models

* mpt : addendum to changeset:84e30e8 - leave parameter clamp_kqv out from metadata rather than use 0.0 to indicate "no clamping" (more compliant with the current GGUF spec?)

* mpt : standardized all tensor names to follow GGUF spec

* mpt : addendum to changeset:1be89c40 - use "req" parameter of GGUF_GET_KEY macro instead of duplicate code

* mpt : fixed comment s/gptneox/mpt/

* mpt : remove tabs, trailing whitespace

* mpt : removed ne01 + n_past == ne00 assertion from alibi (cuda/f32) and rope_shift from build_mpt

* mpt : updated convert-mpt-hf-to-gguf.py to reflect changes made to convert-gptneox-hf-to-gguf.py in pr:3252

* comment out n_past instead of marking it unused

* mpt : removed hardcoded +178 from convert script in favor of utilizing hparams["vocab_size"]

* mpt : remove unused tokenizer_json in convert script

* ggml : remove obsolete n_past assert in ggml_alibi

* llama : print clam_kqv and max_alibi_bias hparams

---------

Co-authored-by: Cebtenzzre <redacted>
Co-authored-by: Georgi Gerganov <redacted>
20 months agoinfill. : fix tokenization (#3508)
vvhg1 [Tue, 10 Oct 2023 07:31:21 +0000 (09:31 +0200)]
infill. : fix tokenization (#3508)

* infill tokens correction

* serverinfill tokens correction

* removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape

* removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape

* only rm when params.escape, rm space if possible which is added back or rm added space token

* only rm when params.escape, rm space if possible which is added back or rm added space token

* Revert "only rm when params.escape, rm space if possible which is added back or rm added space token"

This reverts commit 63ba0b621f21077c0e3bc6ba6a327534123cb738.

* fix interactive prompt escaping and fix server infill leading space handling

* rm unnecessary bool check

20 months agoggml-alloc : fix assert in debug builds (#3555)
slaren [Mon, 9 Oct 2023 12:44:58 +0000 (14:44 +0200)]
ggml-alloc : fix assert in debug builds (#3555)

20 months agorefact : fix convert script + zero out KV cache to avoid nans (#3523)
Georgi Gerganov [Mon, 9 Oct 2023 11:32:17 +0000 (14:32 +0300)]
refact : fix convert script + zero out KV cache to avoid nans (#3523)

* refact : fix convert script + zero out KV cache to avoid nans

* ggml : silu(-inf) should never happen

* metal : assert various kernel requirements

20 months agometal : do not use mul_mm kernels when ne00 < 64 (#3542)
Georgi Gerganov [Mon, 9 Oct 2023 11:28:27 +0000 (14:28 +0300)]
metal : do not use mul_mm kernels when ne00 < 64 (#3542)

20 months agosync : ggml (ggml-backend) (#3548)
Georgi Gerganov [Sun, 8 Oct 2023 17:19:14 +0000 (20:19 +0300)]
sync : ggml (ggml-backend) (#3548)

* sync : ggml (ggml-backend)

ggml-ci

* zig : add ggml-backend to the build

20 months agoci : add Zig CI/CD and fix build (#2996)
Matheus C. França [Sun, 8 Oct 2023 13:59:20 +0000 (10:59 -0300)]
ci : add Zig CI/CD and fix build (#2996)

* zig CI/CD and fix build

Signed-off-by: Matheus Catarino França <redacted>
* fix build_compiler

* ci : remove trailing whitespace

---------

Signed-off-by: Matheus Catarino França <redacted>
Co-authored-by: Georgi Gerganov <redacted>
20 months agoapi_like_OAI.py : compat with Microsoft Guidance (#2746)
Ryder Wishart [Sun, 8 Oct 2023 10:55:58 +0000 (03:55 -0700)]
api_like_OAI.py : compat with Microsoft Guidance (#2746)

Check for None in addition to empty string check in all request params

Co-authored-by: Georgi Gerganov <redacted>
20 months agoapi_like_OAI.py : simplify function (#2796)
arcrank [Sun, 8 Oct 2023 10:52:57 +0000 (06:52 -0400)]
api_like_OAI.py : simplify function (#2796)

Simplify function

20 months agok-quants : fix comments about block sizing (#3499)
Johannes Rudolph [Sun, 8 Oct 2023 10:21:19 +0000 (12:21 +0200)]
k-quants : fix comments about block sizing (#3499)

20 months agoci : enable on obj-c changes + fix metal build (#3540)
Georgi Gerganov [Sun, 8 Oct 2023 08:24:50 +0000 (11:24 +0300)]
ci : enable on obj-c changes + fix metal build (#3540)

20 months agozig : fix build by introducing train.cpp (#3539)
Luo Tian [Sun, 8 Oct 2023 08:24:01 +0000 (16:24 +0800)]
zig : fix build by introducing train.cpp (#3539)

20 months agometal : support MTLGPUFamily < Apple7, formatting, style (#3524)
Georgi Gerganov [Sun, 8 Oct 2023 07:01:53 +0000 (10:01 +0300)]
metal : support MTLGPUFamily < Apple7, formatting, style (#3524)

* metal : improve decoding speed for batches of 2-16

* metal : rename kernels mul_mat_ to mul_mv_

* metal : indentations

* minor

* metal : print more GPU info + disable mul_mm for MTLGPUFamiliy < Apple7

20 months agollama : fix missing break in Persimmon arch case statements (#3535)
Kerfuffle [Sun, 8 Oct 2023 05:22:17 +0000 (23:22 -0600)]
llama : fix missing break in Persimmon arch case statements (#3535)

20 months agoFix trying to strip newline from empty prompt and cfg prompt file content (#3534)
Kerfuffle [Sat, 7 Oct 2023 21:31:41 +0000 (15:31 -0600)]
Fix trying to strip newline from empty prompt and cfg prompt file content (#3534)

20 months agogguf.py : fix CI for publishing GGUF package (#3532)
M. Yusuf Sarıgöz [Sat, 7 Oct 2023 19:14:10 +0000 (22:14 +0300)]
gguf.py : fix CI for publishing GGUF package (#3532)

* Fix CI for publishing GGUF package

* Bump version

* fix

* bump version

* bump version

* bump version

21 months agopy : change version of numpy requirement to 1.24.4 (#3515)
Tom C [Sat, 7 Oct 2023 09:56:15 +0000 (02:56 -0700)]
py : change version of numpy requirement to 1.24.4 (#3515)

Co-authored-by: Lyjia <redacted>
21 months agoquantize : fail fast on write errors (#3521)
cebtenzzre [Sat, 7 Oct 2023 08:41:52 +0000 (04:41 -0400)]
quantize : fail fast on write errors (#3521)

21 months agometal : support default.metallib load & reuse code for swift package (#3522)
Jhen-Jie Hong [Sat, 7 Oct 2023 08:40:27 +0000 (03:40 -0500)]
metal : support default.metallib load & reuse code for swift package (#3522)

* metal : support load default.metallib & reuse code for swift package

* metal : use SWIFT_PACKAGE def instead of define GGML_SWIFT

21 months agollm : support Adept Persimmon 8B (#3410)
Phillip Kravtsov [Sat, 7 Oct 2023 07:12:43 +0000 (00:12 -0700)]
llm : support Adept Persimmon 8B (#3410)

* Produces garbage output

* wip: correct tensors up to RoPE

* correct tensors thru RoPE

* Correct outputs through masked & softmax'd KQ

* fp32 works

* Rename adept->persimmon

* Produces correct outputs

* clean up convert scripts

* remove printing logic from ggml.c

* remove prints from llama.cpp & fix merge

* trivial cleanups

* Add offload funcs

* update conversion script to directly take adept artifacts rather than .saftensors file

* Fix norm eps bug

* Support sqr and concat on metal, persimmon-8b-q4 runs correctly

* Small changes from review

* Formatting changes

* Minor changes to conversion script

* Remove old script

* Fix editorconfig formatting

* Fix build

* add overlooked offload code ggml-ci

21 months agoFix for #3454 (#3455)
goerch [Sat, 7 Oct 2023 04:57:01 +0000 (06:57 +0200)]
Fix for #3454 (#3455)

Fix: `sentencepiece` tokenizers with added tokens failed with an incorrect assertion

21 months agoreadme : update models, cuda + ppl instructions (#3510)
BarfingLemurs [Fri, 6 Oct 2023 19:13:36 +0000 (15:13 -0400)]
readme : update models, cuda + ppl instructions (#3510)

21 months agoserver : docs fix default values and add n_probs (#3506)
Mihai [Fri, 6 Oct 2023 18:39:33 +0000 (21:39 +0300)]
server : docs fix default values and add n_probs (#3506)

21 months agokv cache slot search improvements (#3493)
Kerfuffle [Fri, 6 Oct 2023 16:10:13 +0000 (10:10 -0600)]
kv cache slot search improvements (#3493)

* kv cache slot search improvements

* Use n_ctx in kv find slot for consistency

* Ensure kv cache head points to a valid slot in llama_decode internal

* Add some comments to prevent dumb people (like me) from getting confused.

21 months agoprompts : fix editorconfig checks after #3416
Georgi Gerganov [Fri, 6 Oct 2023 13:35:55 +0000 (16:35 +0300)]
prompts : fix editorconfig checks after #3416

21 months agoparallel : add option to load external prompt file (#3416)
pudepiedj [Fri, 6 Oct 2023 13:16:38 +0000 (14:16 +0100)]
parallel : add option to load external prompt file (#3416)

* Enable external file and add datestamp

* Add name of external file at end

* Upload ToK2024

* Delete ToK2024.txt

* Experiments with jeopardy

* Move ParallelQuestions to /proimpts and rename

* Interim commit

* Interim commit

* Final revision

* Remove trailing whitespace

* remove cmake_all.sh

* Remove cmake_all.sh

* Changed .gitignore

* Improved reporting and new question files.

* Corrected typo

* More LLM questions

* Update LLM-questions.txt

* Yet more LLM-questions

* Remove jeopardy results file

* Reinstate original jeopardy.sh

* Update examples/parallel/parallel.cpp

---------

Co-authored-by: Georgi Gerganov <redacted>