]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
13 months agoflake.lock: Update (#7232)
Georgi Gerganov [Fri, 24 May 2024 15:59:06 +0000 (18:59 +0300)]
flake.lock: Update (#7232)

Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e?narHash=sha256-yzcRNDoyVP7%2BSCNX0wmuDju1NUCt8Dz9%2BlyUXEI0dbI%3D' (2024-05-02)
  → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9?narHash=sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78%3D' (2024-05-16)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/63c3a29ca82437c87573e4c6919b09a24ea61b0f?narHash=sha256-4cPymbty65RvF1DWQfc%2BBc8B233A1BWxJnNULJKQ1EY%3D' (2024-05-02)
  → 'github:NixOS/nixpkgs/4a6b83b05df1a8bd7d99095ec4b4d271f2956b64?narHash=sha256-%2BNpbZRCRisUHKQJZF3CT%2Bxn14ZZQO%2BKjxIIanH3Pvn4%3D' (2024-05-17)

Co-authored-by: github-actions[bot] <redacted>
13 months agodocker.yml: disable light-intel and server-intel test (#7515)
Brian [Fri, 24 May 2024 13:47:56 +0000 (23:47 +1000)]
docker.yml: disable light-intel and server-intel test (#7515)

* docker.yml: disable light-intel test

* docker.yml: disable server-intel test

13 months agoAdd support for ArcticForCausalLM (#7020)
fairydreaming [Fri, 24 May 2024 12:31:13 +0000 (14:31 +0200)]
Add support for ArcticForCausalLM (#7020)

* common : increase max number of experts to 128

* common : add tensor LLM_TENSOR_FFN_NORM_EXPS for normalization before MoE that runs in parallel to attention + ffn

* gguf-py : add architecture-specific block mappings that override selected general block mappings

* convert-hf : add model conversion support for ArcticForCausalLM

* convert-hf : use added_tokens_decoder from tokenizer_config.json to redefine tokens from SentencePiece model (only for ArcticForCausalLM)

* llama : add inference support for LLM_ARCH_ARCTIC

---------

Co-authored-by: Stanisław Szymczyk <redacted>
13 months agoadd build shared lib in win release package (#7438)
Neo Zhang [Fri, 24 May 2024 02:06:56 +0000 (10:06 +0800)]
add build shared lib in win release package (#7438)

13 months agoreadme : remove trailing space (#7469)
Georgi Gerganov [Thu, 23 May 2024 14:43:18 +0000 (17:43 +0300)]
readme : remove trailing space (#7469)

13 months agoggml : silence UB sanitizer error during iq2_xxs quantization (#0)
Georgi Gerganov [Thu, 23 May 2024 14:17:43 +0000 (17:17 +0300)]
ggml : silence UB sanitizer error during iq2_xxs quantization (#0)

13 months agoFix phi3 chat template confusion with zephyr (#7449)
Tristan Druyen [Thu, 23 May 2024 14:15:15 +0000 (16:15 +0200)]
Fix phi3 chat template confusion with zephyr (#7449)

* Fix phi3 template matching vs zephyr

* Add regression test for new phi3 chat template

* Implement review suggestions

* Fix phi3 jinja test templates & match by <|end|>

* Apply suggestion

Co-authored-by: Xuan Son Nguyen <redacted>
* Add all phi3 template variants in tests

* Remove unneeded message trimming

Co-authored-by: Xuan Son Nguyen <redacted>
* Fix tests to not expect trimmed messages

---------

Co-authored-by: Xuan Son Nguyen <redacted>
13 months agoreadme : add Bunny in supported models [no ci] (#7469)
Raj Hammeer Singh Hada [Thu, 23 May 2024 12:30:13 +0000 (18:00 +0530)]
readme : add Bunny in supported models [no ci] (#7469)

13 months agollama : add getters for n_threads/n_threads_batch (#7464)
Daniel Bevenius [Thu, 23 May 2024 12:29:26 +0000 (14:29 +0200)]
llama : add getters for n_threads/n_threads_batch (#7464)

* llama : add getters for n_threads/n_threads_batch

This commit adds two new functions to the llama API. The functions
can be used to get the number of threads used for generating a single
token and the number of threads used for prompt and batch processing
(multiple tokens).

The motivation for this is that we want to be able to get the number of
threads that the a context is using. The main use case is for a
testing/verification that the number of threads is set correctly.

Signed-off-by: Daniel Bevenius <redacted>
* squash! llama : add getters for n_threads/n_threads_batch

Rename the getters to llama_n_threads and llama_n_threads_batch.

Signed-off-by: Daniel Bevenius <redacted>
---------

Signed-off-by: Daniel Bevenius <redacted>
13 months agoci : use Pythia models instead of OpenLlama (#7470)
Georgi Gerganov [Thu, 23 May 2024 12:28:14 +0000 (15:28 +0300)]
ci : use Pythia models instead of OpenLlama (#7470)

* ci : start using Pythia models over OpenLlama

ggml-ci

* ci : disable q2_k ppl tests

* ci : use convert-hf-to-gguf.py

* ci : update gg_get_model

* ci : fix convert outfile name

ggml-ci

* llama : gptneox arch use F32 attn prec

ggml-ci

13 months agoreadme : add GPT-NeoX + Pythia to the list of supported models (#7491)
Victor Nogueira [Thu, 23 May 2024 12:12:43 +0000 (15:12 +0300)]
readme : add GPT-NeoX + Pythia to the list of supported models (#7491)

13 months agoAdd missing inference support for GPTNeoXForCausalLM (Pythia and GPT-NeoX base models...
fairydreaming [Thu, 23 May 2024 09:49:53 +0000 (11:49 +0200)]
Add missing inference support for GPTNeoXForCausalLM (Pythia and GPT-NeoX base models) (#7461)

* convert-hf : add conversion of bloom-style qkv tensor to gpt-style qkv (code borrowed from BloomModel)

* llama : add inference support for LLM_ARCH_GPTNEOX

* llama : add model types for every Pythia variant and GPT-NeoX

Co-authored-by: Stanisław Szymczyk <redacted>
13 months agollama : rename n_ctx -> cache.size, less confusing (#0)
Georgi Gerganov [Thu, 23 May 2024 09:38:18 +0000 (12:38 +0300)]
llama : rename n_ctx -> cache.size, less confusing (#0)

13 months agolabeler.yml: add embedding label detector [no ci] (#7482)
Brian [Thu, 23 May 2024 07:40:43 +0000 (17:40 +1000)]
labeler.yml: add embedding label detector [no ci] (#7482)

13 months agoggml : remove ggml_flash_attn and ggml_flash_ff (#7463)
Georgi Gerganov [Thu, 23 May 2024 07:00:44 +0000 (10:00 +0300)]
ggml : remove ggml_flash_attn and ggml_flash_ff (#7463)

ggml-ci

13 months agoggml : drop support for QK_K=64 (#7473)
Georgi Gerganov [Thu, 23 May 2024 07:00:21 +0000 (10:00 +0300)]
ggml : drop support for QK_K=64 (#7473)

* ggml : drop support for QK_K=64

ggml-ci

* opencl : restore QK_K=256 define

13 months agoUpdate vulkan rope implementation to support frequency factors (#7475)
0cc4m [Thu, 23 May 2024 06:59:59 +0000 (08:59 +0200)]
Update vulkan rope implementation to support frequency factors (#7475)

13 months agomain : minor (#7462)
Georgi Gerganov [Thu, 23 May 2024 06:43:24 +0000 (09:43 +0300)]
main : minor (#7462)

13 months agoCUDA: fix FA out-of-bounds reads (#7479)
Johannes Gäßler [Wed, 22 May 2024 22:31:20 +0000 (00:31 +0200)]
CUDA: fix FA out-of-bounds reads (#7479)

13 months agoSimpleChat: a simple and dumb web front end for testing /chat/completions and /comple...
HanishKVC [Wed, 22 May 2024 17:53:21 +0000 (23:23 +0530)]
SimpleChat: a simple and dumb web front end for testing /chat/completions and /completions end points and try chat (#7350)

* SimpleChat: Add a skeletal html page

Contains a div placeholder for showing chat messages till now

a text-input for allowing user to enter next chat message/query
to the model.

a submit button to allow sending of the user entered message and
chat till now to the model.

* SimpleChat: A js skeleton with SimpleChat class

Allows maintaining an array of chat message.

Allows adding chat message (from any of the roles be it system,
user, assistant, ...)

Allows showing chat messages till now, in a given div element.

* SimpleChat: request_json, globals, startme

* SimpleChatJS: Roles Class, submitClick

Define Role class with static members corresponding to the roles.

Update startme to

* Get hold of the ui elements.

* Attach a click handler to submit button, which adds the user input
  to xchats array and shows the chat messages till now in chat div
  element.

Trap DOMContentLoaded to trigger startme

* SimpleChat:HTML: Bring in the js file

* SimpleChat: Rather value wrt input text element

* SimpleChat: Also add completions related prompt

* SimpleChat: Use common helper logic wrt json data

* SimpleChat: Move handling of submit request into its own func

* SimpleChat: Try handshake with llm over its web service endpoint

* SimpleChat:JS: Extract model response and show to user

* SimpleChat:JS: Messages/Prompt, indicate working to end user

* SimpleChat: Try keep input element in view

* SimpleChat: Diff user/assistant msgs, Make input wider

Also show a default message to user

Also add some metas

* SimpleChat: Move into its own sub directory to avoid confusion

* SimpleChat:sh: Add simple shell script to run python3 http.server

So one needs to run the llm server locally
then run this script and access it using a local browser

* SimpleChat:JS: Try trap enter key press wrt input text field

So user can either press submit button or press enter key

* SimpleChat: Allow user to select chat or completion mode

* SimpleChat: Dont submit if already submitted and waiting

Also make chat the default selection wrt mode

* SimpleChat:JS: Handle difference in response

Try read the assistance response from appropriate field in the
response got.

Also examples/server seems to return the response in a slightly
different field, so try account for that also.

* SimpleChat:JS: Force completion mode be single message by default

* SimpleChat: Add a simple readme file

* SimpleChat:HTML: Cleanup/structure UI a bit, Add input for system

* SimpleChat:Allow system prompt to be set, if provided before user

* SimpleChat: Ignore empty user input, without trimming

* SimpleChat:Alert user if they provide sysprompt late or change it

* SimpleChat: Move handling systemprompt into its own func

* SimpleChat:HTML: Add a style for system role message

* SimpleChat: Update the readme file

* SimpleChat:CSS: Move style info into its own css file

To keep it simple, clean and seperate so that things are not
unnecessarily cluttered.

* SimpleChat:CSS: Allow for chat div to be scrollable

* SimpleChat:JS: Try ensure the last entry in chat is visible

Needed because now only the chat div is scrollable and not the full
page.

In last commit the chat div size was fixed to 75% vertical height,
so the full page no longer scrolls, so the old bring user-input
element to view wont work, instead now the last element in the
chat div should be brought into view.

* SimpleChat:JS: bottom of element visible, Set focus to user input

As the generated text could be multiple lines and occupy more space
that the full scrollable div's vertical space, make the bottom of
the last element (which can be such a generated text) in the div
visible by scrolling.

Ensure that the user input box has focus

* SimpleChat: Update notes a bit. Try keep browser happy

Avoid browser quirk mode with DOCTYPE.

Help with accessibility a bit by specifying the language explicitly.

Specify the char encoding explicitly, inturn utf-8 is a safe bet,
even with intermixing of languages if reqd in future.

Add a cache-control http-equiv meta tag, which in all probability
will be ignored.

Defer js loading and execution, just for fun and future, not that
critical here as it stands now.

* SimpleChat:HTML:Group user input+btn together; Note about multichat

* SimpleChat:JS: Allow for changing system prompt anytime for future

* SimpleChat:Readme: Note about handle_systemprompt begin/anytime

* SimpleChat:HTML: Add viewport meta for better mobile friendliness

Without this the page content may look too small.

* SimpleChat:HtmlCss: Cleanup UI flow

set margin wrt vmin rather than vw or vh so portrait/landscape ok.

Use flex and flex-grow to put things on the same line as well as
distribute available space as needed. Given two main elements/line
so it remains simple.

In each line have one element with grows and one sits with a basic
comfortably fixed size.

* SimpleChat: textarea for multiline user chat, inturn shift+enter 4 enter

* SimpleChat: Make vertical layout better responsive (flex based)

Also needed to make things cleaner and properly usable whether
landscape or portrait, after changing to multiline textarea rather
than single line user input.

Avoid hardcoding the chat-till-now display area height, instead
make it a flex-growable within a flex column of ui elements within
a fixed vertical area.

* SimpleChat: Rename simplechat.html to index.html, update readme

Instead of providing a seperate shell script, update the readme wrt
how to run/use this web front end.

* SimpleChat: Screen fixed view and scrolling, Printing full

* SimpleChat:JS:CI: Avoid space at end of jsdoc param line

* SimpleChat:JS: MultiChat initial skeleton

Will help maintain multiple independent chats in future

* SimpleChat:JS: Move system prompt begin/anytime into SimpleChat

* SimpleChat:JS:Keep MultiChatUI simple for now

Worry about different chats with different servers for later.

* SimpleChat:JS: Move handle submit into MultiChat, build on same

Create an instance of MultiChatUI and inturn a instance of chat
session, which is what the UI will inturn work on.

* SimpleChat:JS: Move to dictionary of SimpleChat, instead of array

* SimpleChat: Move ui elements into MultiChatUI, Update el IDs

Move ui elements into MultiChatUI, so that current handleUserSubmit
doesnt need to take the element arguments. Also in future, when
user is allowed to switch between different chat sessions, the
UI can be updated as needed by using the elements in UI already
known to MultiChatUI instance.

Rename the element ids' so that they follow a common convention,
as well as one can identify what the element represents in a more
consistant manner.

* SimpleChat:MCUI:Show available chat sessions, try switch btw them

Previous commits brought in / consolidated existing logic into
MultiChatUI class.

Now start adding logic towards multichat support

* show buttons indicating available chat sessions

* on sessin button click, try switch to that session

* SimpleChat:MCUI: Store and use current chat session id

Also

allow to switch chat session optionally, wrt some of the related
helpers.

setup for two chat sessions by default.

* SimpleChat:MCUI: Delay enabling user-input to avoid race

Re-enable user-input, only after response to a user query has been
updated to the chat-div. This ensures that if user tries to switch
chat session, it wont be allowed till chat-request-response flow is
done.

* SimpleChat: Take care of system prompt

Helper to get the latest system prompt and inturn use same to
set the system prompt ui, when switching.

Ensure that system prompt is set if and when enter key is pressed.

* SimpleChat:GetSystemLatest, fix a oversight.

* SimpleChat:MCUI: Allow selected chat-session btn to be highlighted

Also have a general helper for setting class of children.

* SimpleChat:Cleanup corners

Show system prompt in chat space, when it is set by pressing enter,
as a feedback to user.

Alert user, if they try to switch chat session in the middle of
waiting for a response from the ai model.

* SimpleChat:MCUI: Ensure req-resp failure doesnt lock up things

* SimpleChat:MCUI: Support for new chat sessions

Also a general create button helper.

* SimpleChat:MCUI: CreateSessionBtn helper, use wrt NewChat

Also fix a oversight wrt using stale data wrt the list of chat
sessions.

* SimpleChat:MCUI: NewChat btn first before existing chat sessions

* SimpleChat:MCUI:CornerCases:Skip new chat, show only if current

Skip NewChat if user cancels or if one waiting for response from
the ai model.

Dont show a chat with newly got ai model response, if current chat
session has changed, some how. Chat session shouldnt be allowed to
change, if there is a pending response, but still as a additional
sanity check.

* SimpleChat: Update readme, title, show usage if no chat to show

* SimpleChat: Cleanup the log/dialog messages a bit

13 months agobuild : remove zig (#7471)
Georgi Gerganov [Wed, 22 May 2024 17:05:38 +0000 (20:05 +0300)]
build : remove zig (#7471)

13 months agocommon : normalize naming style (#7462)
Georgi Gerganov [Wed, 22 May 2024 17:04:20 +0000 (20:04 +0300)]
common : normalize naming style (#7462)

* common : normalize naming style

ggml-ci

* common : match declaration / definition order

* zig : try to fix build

13 months agoCUDA: fix FA out-of-bounds writes (#7465)
Johannes Gäßler [Wed, 22 May 2024 15:58:25 +0000 (17:58 +0200)]
CUDA: fix FA out-of-bounds writes (#7465)

13 months agophi3 : duplicate rope factors in each layer (#7447)
slaren [Wed, 22 May 2024 14:10:46 +0000 (16:10 +0200)]
phi3 : duplicate rope factors in each layer (#7447)

* phi3 : duplicate rope factors in each layer

phi3 : set phi-3 model type as 14B

model loader : simplify the process for duplicating model tensors

llama-bench : remove default pg test

* replace bool parameters in llama_model_loader with named flags

13 months agovulkan: add workaround for iterator boundary check to fix clang-cl debug build (...
k.h.lai [Wed, 22 May 2024 12:53:21 +0000 (20:53 +0800)]
vulkan: add workaround for iterator boundary check to fix clang-cl debug build (#7426)

13 months agollama : add missing model type names (#7445)
Justine Tunney [Wed, 22 May 2024 11:08:18 +0000 (07:08 -0400)]
llama : add missing model type names (#7445)

13 months agocuda : fix compile warning (#7454)
Georgi Gerganov [Wed, 22 May 2024 09:36:37 +0000 (12:36 +0300)]
cuda : fix compile warning (#7454)

13 months agoCUDA: remove incorrect precision check (#7454)
Johannes Gäßler [Wed, 22 May 2024 08:24:29 +0000 (10:24 +0200)]
CUDA: remove incorrect precision check (#7454)

13 months agocuda : fix rope + add tests (#7452)
Georgi Gerganov [Wed, 22 May 2024 08:01:35 +0000 (11:01 +0300)]
cuda : fix rope + add tests (#7452)

* cuda : fix rope pos data

ggml-ci

* ggml : drop mode & 1 == 1 support for ggml_rope

ggml-ci

* ggml : support freq_factors for f16 rope (CPU)

ggml-ci

* tests : add rope tests using frequency factors

ggml-ci

13 months agollama : add phi3 128K model support (#7225)
liuwei-git [Tue, 21 May 2024 20:28:32 +0000 (04:28 +0800)]
llama : add phi3 128K model support (#7225)

* add phi3 128k support in convert-hf-to-gguf

* add phi3 128k support in cuda

* address build warnings on llama.cpp

* adjust index value in cuda long rope freq factors

* add long rope support in ggml cpu backend

* make freq factors only depend on ctx size

* remove unused rope scaling type 'su' frin gguf converter

* fix flint warnings on convert-hf-to-gguf.py

* set to the short freq factor when context size is small than trained context size

* add one line of comments

* metal : support rope freq_factors

* ggml : update ggml_rope_ext API to support freq. factors

* backends : add dev messages to support rope freq. factors

* minor : style

* tests : update to use new rope API

* backends : fix pragma semicolons

* minor : cleanup

* llama : move rope factors from KV header to tensors

* llama : remove tmp assert

* cuda : fix compile warning

* convert : read/write n_head_kv

* llama : fix uninitialized tensors

---------

Co-authored-by: Georgi Gerganov <redacted>
13 months agometal : handle F16 inf values, fix FA partial offload (#7434)
Georgi Gerganov [Tue, 21 May 2024 20:03:42 +0000 (23:03 +0300)]
metal : handle F16 inf values, fix FA partial offload (#7434)

ggml-ci

13 months ago`grammars`: fix resampling logic regression (#7424)
Olivier Chafik [Tue, 21 May 2024 19:40:00 +0000 (20:40 +0100)]
`grammars`: fix resampling logic regression (#7424)

13 months agoCUDA: fix unused warning in mmq.cu (#7442)
Johannes Gäßler [Tue, 21 May 2024 17:27:12 +0000 (19:27 +0200)]
CUDA: fix unused warning in mmq.cu (#7442)

13 months agotests : test-tokenizer-0.sh print more info (#7402)
Georgi Gerganov [Tue, 21 May 2024 16:53:48 +0000 (19:53 +0300)]
tests : test-tokenizer-0.sh print more info (#7402)

13 months agoexamples: cache hf model when --model not provided (#7353)
Amir [Tue, 21 May 2024 14:13:12 +0000 (17:13 +0300)]
examples: cache hf model when --model not provided (#7353)

* examples: cache hf model when --model not provided

* examples: cache hf model when --model not provided

* examples: cache hf model when --model not provided

* examples: cache hf model when --model not provided

* examples: cache hf model when --model not provided

13 months agoCUDA: deduplicate mmq code (#7397)
Johannes Gäßler [Tue, 21 May 2024 14:02:12 +0000 (16:02 +0200)]
CUDA: deduplicate mmq code (#7397)

13 months agoTokenizer SPM fixes for phi-3 and llama-spm (bugfix) (#7425)
jaime-m-p [Tue, 21 May 2024 12:39:48 +0000 (14:39 +0200)]
Tokenizer SPM fixes for phi-3 and llama-spm (bugfix) (#7425)

* Update brute force test: add_special
* Update brute force test: default values for add_bos_token and add_eos_token
* Enable rtrim when pre-inserting BOS

Co-authored-by: Georgi Gerganov <redacted>
* Revert "server : fix test regexes"

13 months agoTokenizer SPM fixes for phi-3 and llama-spm (#7375)
jaime-m-p [Mon, 20 May 2024 18:15:57 +0000 (20:15 +0200)]
Tokenizer SPM fixes for phi-3 and llama-spm (#7375)

* Update brute force test: special tokens
* Fix added tokens
  - Try to read 'added_tokens.json'.
  - Try to read 'tokenizer_config.json'.
  - Try to read 'tokenizer.json'.
* Fix special tokens rtrim

Co-authored-by: Georgi Gerganov <redacted>
* server : fix test regexes

13 months agollama : remove Persimmon (#7408)
Georgi Gerganov [Mon, 20 May 2024 16:35:28 +0000 (19:35 +0300)]
llama : remove Persimmon (#7408)

* llama : remove Persimmon

* requirements : remove

13 months agoperplexity: update README FP16 results [no ci] (#7413)
Johannes Gäßler [Mon, 20 May 2024 16:15:38 +0000 (18:15 +0200)]
perplexity: update README FP16 results [no ci] (#7413)

13 months agorpc : track allocated buffers (#7411)
Radoslav Gerganov [Mon, 20 May 2024 13:36:55 +0000 (16:36 +0300)]
rpc : track allocated buffers (#7411)

* rpc : track allocated buffers

ref: #7407

* rpc : pack rpc_tensor tightly

13 months agoserver : fix temperature + disable some tests (#7409)
Georgi Gerganov [Mon, 20 May 2024 12:10:03 +0000 (15:10 +0300)]
server : fix temperature + disable some tests (#7409)

* server : fix temperature

* server : disable tests relying on parallel determinism

* ci : change server Debug -> RelWithDebInfo

13 months ago[SYCL] Update SYCL upscale operation (#7321)
AidanBeltonS [Mon, 20 May 2024 11:08:23 +0000 (12:08 +0100)]
[SYCL] Update SYCL upscale operation (#7321)

* Update SYCL upscale operation

* Formatting

* Remove messages

13 months agoUpdate README.md (#7410)
Bingan [Mon, 20 May 2024 09:55:34 +0000 (17:55 +0800)]
Update README.md (#7410)

13 months agoggml-opencl, llama: using reserve() if count already known (#7272)
Herman Semenov [Mon, 20 May 2024 07:33:21 +0000 (07:33 +0000)]
ggml-opencl, llama: using reserve() if count already known (#7272)

13 months agoggml : add loongarch lsx and lasx support (#6454)
junchao-loongson [Mon, 20 May 2024 07:19:21 +0000 (15:19 +0800)]
ggml : add loongarch lsx and lasx support (#6454)

* add loongarch lsx and lasx optimize code

* Add loongarch compilation support to makefile

* revert stb_image.h

* opt bytes_from_nibbles_32 and sum_i16_pairs_float

* fix undeclared

* format code

* update

* update 2

---------

Co-authored-by: Jinyang He <redacted>
13 months agoserver : tuning tests (#7388)
Georgi Gerganov [Mon, 20 May 2024 07:16:41 +0000 (10:16 +0300)]
server : tuning tests (#7388)

* server : don't pass temperature as string

* server : increase timeout

* tests : fix the fix 0.8f -> 0.8

ggml-ci

* tests : set explicit temperature

13 months agoserver : return error on too large embedding input (#7389)
Georgi Gerganov [Mon, 20 May 2024 05:56:05 +0000 (08:56 +0300)]
server : return error on too large embedding input (#7389)

13 months agotests : fix --keep_split -> --keep-split (#7374)
Georgi Gerganov [Mon, 20 May 2024 05:55:09 +0000 (08:55 +0300)]
tests : fix --keep_split -> --keep-split (#7374)

13 months agoAdd provisions for windows support for BF16 code including CMake provision for enabli...
Srihari-mcw [Mon, 20 May 2024 02:18:39 +0000 (19:18 -0700)]
Add provisions for windows support for BF16 code including CMake provision for enabling AVX512_BF16 (#7258)

13 months agollama : remove MPI backend (#7395)
slaren [Sun, 19 May 2024 23:17:03 +0000 (01:17 +0200)]
llama : remove MPI backend (#7395)

13 months agoquantize : fix --keep-split check (#7374)
Fred Douglas [Sun, 19 May 2024 16:37:04 +0000 (11:37 -0500)]
quantize : fix --keep-split check (#7374)

13 months agoVulkan Embedding Fix (#7360)
0cc4m [Sun, 19 May 2024 15:19:53 +0000 (17:19 +0200)]
Vulkan Embedding Fix (#7360)

* Fix empty Vulkan host buffers

Add fp32 fp16 matmul shader

Fix matmul shader alignment

* Remove deprecated tensor->backend uses

* Fix Vulkan validation errors on embedding models with no offloaded layers

* Fix Vulkan llava segfault when not offloading layers

13 months agoggml : fix another case of quants nans (#7387)
slaren [Sun, 19 May 2024 15:08:46 +0000 (17:08 +0200)]
ggml : fix another case of quants nans (#7387)

13 months agoggml: implement quantized KV cache for FA (#7372)
Johannes Gäßler [Sun, 19 May 2024 14:46:13 +0000 (16:46 +0200)]
ggml: implement quantized KV cache for FA (#7372)

13 months agoserver: add test for token probs (#7347)
Johannes Gäßler [Sun, 19 May 2024 14:26:02 +0000 (16:26 +0200)]
server: add test for token probs (#7347)

13 months agoserver: fix seed being reported back (#7382)
Johannes Gäßler [Sun, 19 May 2024 14:06:33 +0000 (16:06 +0200)]
server: fix seed being reported back (#7382)

13 months agoAdd StableLM2 pre-tokenizer (#7349)
Anas Ahouzi [Sun, 19 May 2024 12:46:46 +0000 (14:46 +0200)]
Add StableLM2 pre-tokenizer (#7349)

* Add StableLM pre-tokenizer

* Fix space

* Fix trailing whitespace

13 months agocuda : clear error after buffer allocation failure (#7376)
slaren [Sun, 19 May 2024 12:19:37 +0000 (14:19 +0200)]
cuda : clear error after buffer allocation failure (#7376)

13 months agolabeler.yml: Use settings from ggerganov/llama.cpp [no ci] (#7363)
Brian [Sun, 19 May 2024 10:51:03 +0000 (20:51 +1000)]
labeler.yml: Use settings from ggerganov/llama.cpp [no ci] (#7363)

https://github.com/actions/labeler#using-configuration-path-input-together-with-the-actionscheckout-action
Recommends the use of checkout action to use the correct repo context
when applying settings for PR labels

e.g.

    steps:
    - uses: actions/checkout@v4 # Uploads repository content to the runner
      with:
        repository: "owner/repositoryName" # The one of the available inputs, visit https://github.com/actions/checkout#readme to find more
    - uses: actions/labeler@v5
      with:
        configuration-path: 'path/to/the/uploaded/configuration/file'

13 months agocmake : update android comments (#7341)
Georgi Gerganov [Sun, 19 May 2024 08:01:01 +0000 (11:01 +0300)]
cmake : update android comments (#7341)

13 months agoCapture CUDA logging output (#7298)
fraxy-v [Sat, 18 May 2024 22:44:42 +0000 (01:44 +0300)]
Capture CUDA logging output (#7298)

* logging: output capture in cuda module

* fix compile error

* fix: vsnprintf terminates with 0, string use not correct

* post review

* Update llama.cpp

Co-authored-by: slaren <redacted>
* Update llama.cpp

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

Co-authored-by: slaren <redacted>
13 months agoci : re-enable sanitizer runs (#7358)
Georgi Gerganov [Sat, 18 May 2024 15:55:54 +0000 (18:55 +0300)]
ci : re-enable sanitizer runs (#7358)

* Revert "ci : temporary disable sanitizer builds (#6128)"

This reverts commit 4f6d1337ca5a409dc74aca8c479b7c34408a69c0.

* ci : trigger

13 months agoandroid : use "ci-android" branch for CI (#7341)
Georgi Gerganov [Sat, 18 May 2024 10:40:39 +0000 (13:40 +0300)]
android : use "ci-android" branch for CI (#7341)

* android : use "ci-android" branch for CI

* ggml : disable SIMD exp and silu for 32-bit ARM

ggml-ci

* android : do not fetch, use add_subdirectory instead

* cmake : provide binary dir

13 months agoCUDA: deduplicate FlashAttention code (#7352)
Johannes Gäßler [Sat, 18 May 2024 10:36:25 +0000 (12:36 +0200)]
CUDA: deduplicate FlashAttention code (#7352)

13 months agoserver: correct --threads documentation [no ci] (#7362)
Johannes Gäßler [Sat, 18 May 2024 09:10:47 +0000 (11:10 +0200)]
server: correct --threads documentation [no ci] (#7362)

13 months agocuda : add half2 __shfl_xor() for ROCm 5.5 (#7263)
Engininja2 [Sat, 18 May 2024 08:05:17 +0000 (02:05 -0600)]
cuda : add half2 __shfl_xor() for ROCm 5.5 (#7263)

13 months agollama : add support for larger Granite Code Models (20B, 34B) (#7324)
Steffen Röcker [Sat, 18 May 2024 08:04:55 +0000 (10:04 +0200)]
llama : add support for larger Granite Code Models (20B, 34B) (#7324)

Tie the weights for ARCH_STARCODER to support the larger Granite code models.
Partially addresses ggerganov/issues/7116

There still remains to be a few things to fix.
Currently requires `--override-kv tokenizer.ggml.add_bos_token=bool:false`

13 months agoperplexity : ndot progress and show stats with < 100 tasks (#7348)
strawberrymelonpanda [Sat, 18 May 2024 07:57:08 +0000 (00:57 -0700)]
perplexity : ndot progress and show stats with < 100 tasks (#7348)

Fix floating point error with ndot printing, allow end stats on lower task numbers if multiple-choice tasks.

13 months agoUpdate and fix Vulkan soft_max and argsort implementations (#7237)
0cc4m [Sat, 18 May 2024 06:10:58 +0000 (08:10 +0200)]
Update and fix Vulkan soft_max and argsort implementations (#7237)

* Update and fix Vulkan softmax implementation

* Update and fix Vulkan argsort implementation

13 months agogithub-actions-labeler: initial commit (#7330)
Brian [Sat, 18 May 2024 06:04:23 +0000 (16:04 +1000)]
github-actions-labeler: initial commit (#7330)

* github-actions-labeler: initial commit [no ci]

* github actions: remove priority auto labeling [no ci]

13 months agoconvert : fix set_vocab_sentencepiece (#6866)
Georgi Gerganov [Sat, 18 May 2024 05:46:20 +0000 (08:46 +0300)]
convert : fix set_vocab_sentencepiece (#6866)

* convert : fix set_vocab_sentencepiece

* Update convert-hf-to-gguf.py

13 months agoggml : fix quants nans when all the group weights are very close to zero (#7313)
slaren [Sat, 18 May 2024 00:39:54 +0000 (02:39 +0200)]
ggml : fix quants nans when all the group weights are very close to zero (#7313)

13 months agocmake : fix typo in AMDGPU_TARGETS (#7356)
Engininja2 [Sat, 18 May 2024 00:39:25 +0000 (18:39 -0600)]
cmake : fix typo in AMDGPU_TARGETS (#7356)

13 months agoUnicode codepoint flags for custom regexs (#7245)
jaime-m-p [Fri, 17 May 2024 23:09:13 +0000 (01:09 +0200)]
Unicode codepoint flags for custom regexs (#7245)

* Replace CODEPOINT_TYPE_* with codepoint_flags
* Update and bugfix brute force random test
* Deterministic brute force random test
* Unicode normalization NFD
* Get rid of BOM

13 months agoCUDA: faster large batch FA without tensor cores (#7314)
Johannes Gäßler [Fri, 17 May 2024 16:54:52 +0000 (18:54 +0200)]
CUDA: faster large batch FA without tensor cores (#7314)

13 months agoROCm: use native CMake HIP support (#5966)
Gavin Zhao [Fri, 17 May 2024 15:03:03 +0000 (11:03 -0400)]
ROCm: use native CMake HIP support (#5966)

Supercedes #4024 and #4813.

CMake's native HIP support has become the
recommended way to add HIP code into a project (see
[here](https://rocm.docs.amd.com/en/docs-6.0.0/conceptual/cmake-packages.html#using-hip-in-cmake)).
This PR makes the following changes:

1. The environment variable `HIPCXX` or CMake option
`CMAKE_HIP_COMPILER` should be used to specify the HIP
compiler. Notably this shouldn't be `hipcc`, but ROCm's clang,
which usually resides in `$ROCM_PATH/llvm/bin/clang`. Previously
this was control by `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER`.
Note that since native CMake HIP support is not yet available on
Windows, on Windows we fall back to the old behavior.

2. CMake option `CMAKE_HIP_ARCHITECTURES` is used to control the
GPU architectures to build for. Previously this was controled by
`GPU_TARGETS`.

3. Updated the Nix recipe to account for these new changes.

4. The GPU targets to build against in the Nix recipe is now
consistent with the supported GPU targets in nixpkgs.

5. Added CI checks for HIP on both Linux and Windows. On Linux, we test
both the new and old behavior.

The most important part about this PR is the separation of the
HIP compiler and the C/C++ compiler. This allows users to choose
a different C/C++ compiler if desired, compared to the current
situation where when building for ROCm support, everything must be
compiled with ROCm's clang.

~~Makefile is unchanged. Please let me know if we want to be
consistent on variables' naming because Makefile still uses
`GPU_TARGETS` to control architectures to build for, but I feel
like setting `CMAKE_HIP_ARCHITECTURES` is a bit awkward when you're
calling `make`.~~ Makefile used `GPU_TARGETS` but the README says
to use `AMDGPU_TARGETS`. For consistency with CMake, all usage of
`GPU_TARGETS` in Makefile has been updated to `AMDGPU_TARGETS`.

Thanks to the suggestion of @jin-eld, to maintain backwards
compatibility (and not break too many downstream users' builds), if
`CMAKE_CXX_COMPILER` ends with `hipcc`, then we still compile using
the original behavior and emit a warning that recommends switching
to the new HIP support. Similarly, if `AMDGPU_TARGETS` is set but
`CMAKE_HIP_ARCHITECTURES` is not, then we forward `AMDGPU_TARGETS`
to `CMAKE_HIP_ARCHITECTURES` to ease the transition to the new
HIP support.

Signed-off-by: Gavin Zhao <redacted>
13 months agorpc : set SO_REUSEADDR for the server socket (#7320)
Radoslav Gerganov [Fri, 17 May 2024 14:25:44 +0000 (17:25 +0300)]
rpc : set SO_REUSEADDR for the server socket (#7320)

ref: #7293

13 months agoAdded a single test function script and fix debug-test.sh to be more robust (#7279)
Brian [Fri, 17 May 2024 12:40:14 +0000 (22:40 +1000)]
Added a single test function script and fix debug-test.sh to be more robust (#7279)

* run-single-test.sh: added a single test function script and fix debug-test.sh to be more robust

* debug-test.sh: combined execute and gdb test mode via -g flag

* debug-test.sh: refactor

* debug-test: refactor for clarity

* debug-test.sh: comment style changes

* debug-test.sh: fix gdb

13 months agopy : convert-hf-to-gguf-update improvements (#7340)
Aarni Koskela [Fri, 17 May 2024 12:11:45 +0000 (15:11 +0300)]
py : convert-hf-to-gguf-update improvements (#7340)

* convert-hf-to-gguf-update: automate updating

* convert-hf-to-gguf-update: improve download

* share requests session for performance
* create directories only when needed, don't skip downloads when empty directory encountered
* be more graceful about errors

13 months agollama : use n_embd_head_v when reshaping kqv (#7327)
fairydreaming [Fri, 17 May 2024 11:24:38 +0000 (13:24 +0200)]
llama : use n_embd_head_v when reshaping kqv (#7327)

* llama : use n_embd_head_v instead of n_embd_head_k when reshaping kqv

* llama : use n_embd_v_gqa and n_embd_head_v instead of n_embd_k_gqa and n_embd_head_k when making a view of cached value vectors.

---------

Co-authored-by: Stanisław Szymczyk <redacted>
13 months agotokenization: add warning for double BOS (#7332)
Johannes Gäßler [Fri, 17 May 2024 07:59:57 +0000 (09:59 +0200)]
tokenization: add warning for double BOS (#7332)

13 months agoggml-quants, llama : removed excess checks (#7274)
Herman Semenov [Fri, 17 May 2024 07:08:49 +0000 (07:08 +0000)]
ggml-quants, llama : removed excess checks (#7274)

13 months agoconvert : fix Qwen/Qwen-7b conversion (#7308)
amd-lalithnc [Fri, 17 May 2024 07:01:58 +0000 (12:31 +0530)]
convert : fix Qwen/Qwen-7b conversion (#7308)

13 months agoserver : add support for the RPC backend (#7305)
Radoslav Gerganov [Fri, 17 May 2024 07:00:17 +0000 (10:00 +0300)]
server : add support for the RPC backend (#7305)

ref: #7292

13 months agoggml : rewrite silu and softmax for cpu (#7154)
Justine Tunney [Fri, 17 May 2024 06:58:52 +0000 (02:58 -0400)]
ggml : rewrite silu and softmax for cpu (#7154)

This change upstreams llamafile's vectorized expf() functions. This lets
us compute softmax and silu more accurately than the short[65536] lookup
table that GGML previously used to make this operation go faster. We can
support aarch64 and sse2+ with the worst case rounding error of 2ulp. It
makes make -j8 tests && ./tests/test-backend-ops -o SOFT_MAX -b CPU perf
go 1.5x faster for SSE2+FMA, 1.9x faster for AVX2+FMA and 2.1x on AVX512

13 months ago[Server] Added --verbose option to README [no ci] (#7335)
Leon Knauer [Fri, 17 May 2024 00:11:03 +0000 (02:11 +0200)]
[Server] Added --verbose option to README [no ci] (#7335)

13 months agoRevert "server bench: fix bench not waiting for model load (#7284)" (#7334)
Pierrick Hymbert [Thu, 16 May 2024 18:43:45 +0000 (20:43 +0200)]
Revert "server bench: fix bench not waiting for model load (#7284)" (#7334)

This reverts commit 583fd6b000ec9ad1b465b5c98524f4a0ae388077.

13 months agorpc : get available mem for the CPU backend
Radoslav Gerganov [Wed, 15 May 2024 13:04:40 +0000 (16:04 +0300)]
rpc : get available mem for the CPU backend

This can be overridden with the -m command line option

ref: #7293

13 months agorpc : add command line arg for specifying backend memory
Radoslav Gerganov [Wed, 15 May 2024 12:29:07 +0000 (15:29 +0300)]
rpc : add command line arg for specifying backend memory

ref: #7293

13 months agoconvert : get general.name from model dir, not its parent (#5615)
Jared Van Bortel [Thu, 16 May 2024 06:15:23 +0000 (02:15 -0400)]
convert : get general.name from model dir, not its parent (#5615)

Co-authored-by: Brian <redacted>
13 months agogrammar, json, llama: replace push on emplace if it possible (#7273)
Herman Semenov [Thu, 16 May 2024 06:14:24 +0000 (06:14 +0000)]
grammar, json, llama: replace push on emplace if it possible (#7273)

13 months agodoc: add references to hugging face GGUF-my-repo quantisation web tool. (#7288)
Vaibhav Srivastav [Thu, 16 May 2024 05:38:43 +0000 (07:38 +0200)]
doc: add references to hugging face GGUF-my-repo quantisation web tool. (#7288)

* chore: add references to the quantisation space.

* fix grammer lol.

* Update README.md

Co-authored-by: Julien Chaumond <redacted>
* Update README.md

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

Co-authored-by: Julien Chaumond <redacted>
Co-authored-by: Georgi Gerganov <redacted>
13 months agoci: fix bin/Release path for windows-arm64 builds (#7317)
Max Krasnyansky [Thu, 16 May 2024 05:36:43 +0000 (22:36 -0700)]
ci: fix bin/Release path for windows-arm64 builds (#7317)

Switch to Ninja Multi-Config CMake generator to resurect bin/Release path
that broke artifact packaging in CI.

13 months agoAdd support for properly optimized Windows ARM64 builds with LLVM and MSVC (#7191)
Max Krasnyansky [Thu, 16 May 2024 02:47:36 +0000 (19:47 -0700)]
Add support for properly optimized Windows ARM64 builds with LLVM and MSVC (#7191)

* logging: add proper checks for clang to avoid errors and warnings with VA_ARGS

* build: add CMake Presets and toolchian files for Windows ARM64

* matmul-int8: enable matmul-int8 with MSVC and fix Clang warnings

* ci: add support for optimized Windows ARM64 builds with MSVC and LLVM

* matmul-int8: fixed typos in q8_0_q8_0 matmuls

Co-authored-by: Georgi Gerganov <redacted>
* matmul-int8: remove unnecessary casts in q8_0_q8_0

---------

Co-authored-by: Georgi Gerganov <redacted>
13 months agoreadme : remove stray double quote (#7310)
Daniel Bevenius [Wed, 15 May 2024 21:41:03 +0000 (23:41 +0200)]
readme : remove stray double quote (#7310)

Signed-off-by: Daniel Bevenius <redacted>
13 months agoggml : use dynamic thread scheduling for matrix multiplication (#6915)
kunnis [Wed, 15 May 2024 17:59:12 +0000 (12:59 -0500)]
ggml : use dynamic thread scheduling for matrix multiplication (#6915)

* Just reordering some structs.

* Adding in the calls to mm_pause

* Passing around the state

* Renaming and moving a bunch of variables around.

* Extracting the logic to it's own function.

* Moving some variable definitions into the chunk function.

* Moving some variables around

* moving src1_cont inside

* Moving row_size

* adding the current_chunk

* Reorg the code.

* Formatting to match the orig patch

* starting to setup the chunking variables

* Starting the buildup of the loop

* The yield shouldn't be necessary.

* adding the looping structure based on the chunk configuration.

* Add in the re-chunking code.

* Making it much more likely to rechunk.

* disable resizing if numa is enabled.

* Updating comments with what we've learned.

* Fix formatting

* Couple more formatting fixes.

* More style fixes.

* Fix Warnings

* Going with unused because there's conditional logic that needs it.

* Update ggml.c

* Update ggml.c

---------

13 months agoAvoid unnecessarily disabling CUDA graphs (#7302)
agray3 [Wed, 15 May 2024 13:44:49 +0000 (14:44 +0100)]
Avoid unnecessarily disabling CUDA graphs (#7302)

As discussed in PR #6766, CUDA graphs were being disabled in the presence of long prompts.
This fixes the issue by avoiding the consective update counter from incrementing unnecessarily
for tokens in which cuda graphs are disabled due to batch size > 1.

13 months agoggml : tag ggml_tensor::backend as deprecated (#7290)
slaren [Wed, 15 May 2024 13:08:48 +0000 (15:08 +0200)]
ggml : tag ggml_tensor::backend as deprecated (#7290)

13 months agoAdd missing " (#7303)
AidanBeltonS [Wed, 15 May 2024 12:26:30 +0000 (13:26 +0100)]
Add missing " (#7303)