]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
21 months agogguf : basic type checking in gguf_get_* (#3346)
Cebtenzzre [Thu, 28 Sep 2023 18:30:31 +0000 (14:30 -0400)]
gguf : basic type checking in gguf_get_* (#3346)

21 months agogguf : make token scores and types optional (#3347)
Cebtenzzre [Thu, 28 Sep 2023 18:30:15 +0000 (14:30 -0400)]
gguf : make token scores and types optional (#3347)

21 months agoci : disable freeBSD builds due to lack of VMs (#3381)
Georgi Gerganov [Thu, 28 Sep 2023 16:36:36 +0000 (19:36 +0300)]
ci : disable freeBSD builds due to lack of VMs (#3381)

21 months agollama : custom attention mask + parallel decoding + no context swaps (#3228)
Georgi Gerganov [Thu, 28 Sep 2023 16:04:36 +0000 (19:04 +0300)]
llama : custom attention mask + parallel decoding + no context swaps (#3228)

* tests : verify that RoPE is "additive"

* llama : replace ggml_diag_mask_inf with ggml_add (custom -inf mask)

* ggml : ggml_rope now takes a vector with positions instead of n_past

* metal : add rope_f16 kernel + optimize cpy kernels

* llama : unified KV cache + batch inference API

* llama : add new llama_decode() API that works with llama_batch

* llama : add cell_max heuristic for more efficient kv_cache

* llama : extend llama_kv_cache API

* llama : more robust cell_max heuristic + wip shift

* metal : disable concurrency optimization

* llama : add llama_kv_cache_shift_seq + no more context swaps

* llama : apply K-cache roping for Falcon and Baichuan

* speculative : fix KV cache management

* parallel : example for serving multiple users in parallel

* parallel : disable hot-plug to avoid cache fragmentation

* fixes : speculative KV cache + llama worst-case graph

* llama : extend batch API to select which logits to output

* llama : fix worst case graph build

* ggml-cuda : update rope implementation for parallel decoding (#3254)

* ggml-cuda : update rope implementation for parallel decoding

* better solution for p0 computation

* fix rope

* simpler rope implementation

---------

Co-authored-by: Georgi Gerganov <redacted>
* make : add parallel to build + fix static functions in llama.cpp

* simple : fix token counting

* parallel : various improvements

* llama : fix cell_max logic + rename functions

* parallel : try smaller batches when the KV cache is fragmented

* parallel : fix sequence termination criteria

* llama : silence errors KV cache errors

* parallel : remove new line from prompt

* parallel : process system prompt once + configurable paramters + llama API

* parallel : remove question with short answers

* parallel : count cache misses

* parallel : print misses on each request

* parallel : minor

* llama : fix n_kv to never become 0

* parallel : rename hot-plug to continuous-batching

* llama : improve llama_batch API + simplify parallel example

* simple : add parallel decoding support

* simple : improve comments + free batch

* ggml-cuda : add rope f16, restore performance with parallel decoding (#3272)

* ggml-cuda : add rope f16, restore performance

* offload KQ_mask with all models

* fix rope shift

---------

Co-authored-by: Georgi Gerganov <redacted>
* llama : disable MPI for now

ggml-ci

* train : make KQ_pos memory buffer permanent via dummy scale op

* ggml : revert change to ggml_cpy, add ggml_cont_Nd instead (#3275)

ggml-ci

* parallel : fix bug (extra BOS) + smaller token_prev array

* parallel : fix cases where the input prompts can overflow the batch

* parallel : add disabled experimental batch chunking in powers of two

* llama : llama.h formatting + comments

* simple : add README.md

* llama : fix kv cache heuristic when context is less than 32

* parallel : fix crash when `-n -1`

* llama : simplify returns if/else branches

* metal : use mm kernels for batch size > 2

* examples : utilize new llama_get_logits_ith()

* examples : add example for batched decoding

* examples : do not eval prompt 2 times (close #3348)

* server : clear the KV cache beyond n_past before llama_decode

* server : avoid context swaps by shifting the KV cache

---------

Co-authored-by: slaren <redacted>
21 months agodocs : mark code as Bash (#3375)
Kevin Ji [Thu, 28 Sep 2023 13:11:32 +0000 (09:11 -0400)]
docs : mark code as Bash (#3375)

21 months agoreadme : add Mistral AI release 0.1 (#3362)
Pierre Alexandre SCHEMBRI [Thu, 28 Sep 2023 12:13:37 +0000 (14:13 +0200)]
readme : add Mistral AI release 0.1 (#3362)

21 months agoggml-cuda : perform cublas fp16 matrix multiplication as fp16 (#3370)
slaren [Thu, 28 Sep 2023 10:08:28 +0000 (12:08 +0200)]
ggml-cuda : perform cublas fp16 matrix multiplication as fp16 (#3370)

* ggml-cuda : perform cublas fp16 matrix multiplication as fp16

* try to fix rocm build

* restrict fp16 mat mul to volta and up

21 months agoconvert : remove bug in convert.py permute function (#3364)
Zhang Peiyuan [Wed, 27 Sep 2023 18:45:20 +0000 (02:45 +0800)]
convert : remove bug in convert.py permute function (#3364)

21 months agomake-ggml.py : compatibility with more models and GGUF (#3290)
Richard Roberson [Wed, 27 Sep 2023 16:25:12 +0000 (10:25 -0600)]
make-ggml.py : compatibility with more models and GGUF (#3290)

* Resync my fork with new llama.cpp commits

* examples : rename to use dash instead of underscore

* New model conversions

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agogguf : fix a few general keys (#3341)
Cebtenzzre [Wed, 27 Sep 2023 16:18:07 +0000 (12:18 -0400)]
gguf : fix a few general keys (#3341)

21 months agometal : reusing llama.cpp logging (#3152)
Rickard Hallerbäck [Wed, 27 Sep 2023 15:48:33 +0000 (17:48 +0200)]
metal : reusing llama.cpp logging (#3152)

* metal : reusing llama.cpp logging

* cmake : build fix

* metal : logging callback

* metal : logging va_args memory fix

* metal : minor cleanup

* metal : setting function like logging macro to capital letters

* llama.cpp : trailing whitespace fix

* ggml : log level enum used by llama

* Makefile : cleanup ggml-metal recipe

* ggml : ggml_log_callback typedef

* ggml : minor

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agobuild : add ACCELERATE_NEW_LAPACK to fix warning on macOS Sonoma (#3342)
Jag Chadha [Wed, 27 Sep 2023 15:34:32 +0000 (11:34 -0400)]
build : add ACCELERATE_NEW_LAPACK to fix warning on macOS Sonoma (#3342)

21 months agoreadme : add some recent perplexity and bpw measurements to READMES, link for k-quant...
BarfingLemurs [Wed, 27 Sep 2023 15:30:36 +0000 (11:30 -0400)]
readme : add some recent perplexity and bpw measurements to READMES, link for k-quants (#3340)

* Update README.md

* Update README.md

* Update README.md with k-quants bpw measurements

21 months agocmake : fix build-info.h on MSVC (#3309)
DAN™ [Mon, 25 Sep 2023 22:45:33 +0000 (18:45 -0400)]
cmake : fix build-info.h on MSVC (#3309)

21 months agodocs: Fix typo CLBlast_DIR var. (#3330)
2f38b454 [Mon, 25 Sep 2023 18:24:52 +0000 (02:24 +0800)]
docs: Fix typo CLBlast_DIR var. (#3330)

21 months agonix : add cuda, use a symlinked toolkit for cmake (#3202)
Erik Scholz [Mon, 25 Sep 2023 11:48:30 +0000 (13:48 +0200)]
nix : add cuda, use a symlinked toolkit for cmake (#3202)

21 months agollama-bench : add README (#3317)
slaren [Sat, 23 Sep 2023 19:48:24 +0000 (21:48 +0200)]
llama-bench : add README (#3317)

* llama-bench : add README

* minor edit

21 months agoexamples : fix RoPE defaults to match PR #3240 (#3315)
Cebtenzzre [Sat, 23 Sep 2023 09:28:50 +0000 (05:28 -0400)]
examples : fix RoPE defaults to match PR #3240 (#3315)

21 months agoscripts : use `/usr/bin/env` in shebang (#3313)
Kevin Ji [Sat, 23 Sep 2023 03:52:23 +0000 (23:52 -0400)]
scripts : use `/usr/bin/env` in shebang (#3313)

21 months agoUpdate README.md (#3289)
Lee Drake [Thu, 21 Sep 2023 19:00:24 +0000 (13:00 -0600)]
Update README.md (#3289)

* Update README.md

* Update README.md

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

Co-authored-by: slaren <redacted>
21 months agoggml-opencl.cpp: Make private functions static (#3300)
shibe2 [Thu, 21 Sep 2023 18:10:26 +0000 (22:10 +0400)]
ggml-opencl.cpp: Make private functions static (#3300)

21 months agozig : fix for updated c lib (#3259)
Edward Taylor [Thu, 21 Sep 2023 09:08:20 +0000 (21:08 +1200)]
zig : fix for updated c lib (#3259)

21 months agoembedding : update README.md (#3224)
yuiseki [Thu, 21 Sep 2023 08:57:40 +0000 (17:57 +0900)]
embedding : update README.md (#3224)

21 months agoCUDA: use only 1 thread if fully offloaded (#2915)
Johannes Gäßler [Thu, 21 Sep 2023 08:43:53 +0000 (10:43 +0200)]
CUDA: use only 1 thread if fully offloaded (#2915)

21 months agoreadme : update hot topics
Georgi Gerganov [Wed, 20 Sep 2023 17:48:22 +0000 (20:48 +0300)]
readme : update hot topics

21 months agollama : allow gguf RoPE keys to be overridden with defaults (#3240)
Cebtenzzre [Wed, 20 Sep 2023 16:12:47 +0000 (12:12 -0400)]
llama : allow gguf RoPE keys to be overridden with defaults (#3240)

21 months agobenchmark-matmult : do not use integer abs() on a float (#3277)
Cebtenzzre [Wed, 20 Sep 2023 16:06:08 +0000 (12:06 -0400)]
benchmark-matmult : do not use integer abs() on a float (#3277)

21 months agoflake : Restore default package's buildInputs (#3262)
kang [Wed, 20 Sep 2023 13:48:22 +0000 (22:48 +0900)]
flake : Restore default package's buildInputs (#3262)

21 months agoCI: FreeBSD fix (#3258)
Alon [Wed, 20 Sep 2023 12:06:36 +0000 (15:06 +0300)]
CI: FreeBSD fix (#3258)

* - freebsd ci: use qemu

21 months agoexamples : fix benchmark-matmult (#1554)
Georgi Gerganov [Wed, 20 Sep 2023 07:02:39 +0000 (10:02 +0300)]
examples : fix benchmark-matmult (#1554)

The precision for Q4_0 has degraded since #1508

21 months agomake : restore build-info.h dependency for several targets (#3205)
Cebtenzzre [Mon, 18 Sep 2023 14:03:53 +0000 (10:03 -0400)]
make : restore build-info.h dependency for several targets (#3205)

21 months agoci : switch cudatoolkit install on windows to networked (#3236)
Erik Scholz [Mon, 18 Sep 2023 00:21:47 +0000 (02:21 +0200)]
ci : switch cudatoolkit install on windows to networked (#3236)

21 months agoCUDA: fix peer access logic (#3231)
Johannes Gäßler [Sun, 17 Sep 2023 21:35:20 +0000 (23:35 +0200)]
CUDA: fix peer access logic (#3231)

21 months agoCUDA: enable peer access between devices (#2470)
Johannes Gäßler [Sun, 17 Sep 2023 14:37:53 +0000 (16:37 +0200)]
CUDA: enable peer access between devices (#2470)

21 months agollama.cpp : show model size and BPW on load (#3223)
slaren [Sun, 17 Sep 2023 12:33:28 +0000 (14:33 +0200)]
llama.cpp : show model size and BPW on load (#3223)

21 months agoCUDA: fix scratch malloced on non-main device (#3220)
Johannes Gäßler [Sun, 17 Sep 2023 12:16:22 +0000 (14:16 +0200)]
CUDA: fix scratch malloced on non-main device (#3220)

21 months agoEnable BUILD_SHARED_LIBS=ON on all Windows builds (#3215)
IsaacDynamo [Sat, 16 Sep 2023 17:35:25 +0000 (19:35 +0200)]
Enable BUILD_SHARED_LIBS=ON on all Windows builds (#3215)

21 months agoEnable build with CUDA 11.0 (make) (#3132)
Vlad [Sat, 16 Sep 2023 14:55:43 +0000 (17:55 +0300)]
Enable build with CUDA 11.0 (make) (#3132)

* CUDA 11.0 fixes

* Cleaner CUDA/host flags separation

Also renamed GGML_ASSUME into GGML_CUDA_ASSUME

21 months agoFixing the last deviations from sentencepiece indicated by test-tokenizer-1 (#3170)
goerch [Sat, 16 Sep 2023 11:41:33 +0000 (13:41 +0200)]
Fixing the last deviations from sentencepiece indicated by test-tokenizer-1 (#3170)

* Fix für #2721

* Reenable tokenizer test for LLaMa

* Add `console.cpp` dependency

* Fix dependency to `common`

* Fixing wrong fix.

* Make console usage platform specific

Work on compiler warnings.

* Adapting makefile

* Remove trailing whitespace

* Adapting the other parts of the makefile

* Fix typo.

* Fixing the last deviations from sentencepiece indicated by test-tokenizer-1

* Simplify logic

* Add missing change...

* Fix ugly compiler warning

* llama_tokenize should accept strings containing NUL now

* Adding huichen's test case

21 months agoexamples : add compiler version and target to build info (#2998)
Cebtenzzre [Fri, 15 Sep 2023 20:59:49 +0000 (16:59 -0400)]
examples : add compiler version and target to build info (#2998)

21 months agocheck C++ code with -Wmissing-declarations (#3184)
Cebtenzzre [Fri, 15 Sep 2023 19:38:27 +0000 (15:38 -0400)]
check C++ code with -Wmissing-declarations (#3184)

21 months agofix build numbers by setting fetch-depth=0 (#3197)
Cebtenzzre [Fri, 15 Sep 2023 19:18:15 +0000 (15:18 -0400)]
fix build numbers by setting fetch-depth=0 (#3197)

21 months agollama : add support for StarCoder model architectures (#3187)
Meng Zhang [Fri, 15 Sep 2023 19:02:13 +0000 (03:02 +0800)]
llama : add support for StarCoder model architectures (#3187)

* add placeholder of starcoder in gguf / llama.cpp

* support convert starcoder weights to gguf

* convert MQA to MHA

* fix ffn_down name

* add LLM_ARCH_STARCODER to llama.cpp

* set head_count_kv = 1

* load starcoder weight

* add max_position_embeddings

* set n_positions to max_positioin_embeddings

* properly load all starcoder params

* fix head count kv

* fix comments

* fix vram calculation for starcoder

* store mqa directly

* add input embeddings handling

* add TBD

* working in cpu, metal buggy

* cleanup useless code

* metal : fix out-of-bounds access in soft_max kernels

* llama : make starcoder graph build more consistent with others

* refactor: cleanup comments a bit

* add other starcoder models: 3B, 7B, 15B

* support-mqa-directly

* fix: remove max_position_embeddings, use n_train_ctx

* Update llama.cpp

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

Co-authored-by: Georgi Gerganov <redacted>
* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <redacted>
* fix: switch to space from tab

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agocommon : do not use GNU zero-length __VA_ARGS__ extension (#3195)
Cebtenzzre [Fri, 15 Sep 2023 18:02:01 +0000 (14:02 -0400)]
common : do not use GNU zero-length __VA_ARGS__ extension (#3195)

21 months agometal : fix bug in soft_max kernels (out-of-bounds access) (#3194)
Georgi Gerganov [Fri, 15 Sep 2023 17:17:24 +0000 (20:17 +0300)]
metal : fix bug in soft_max kernels (out-of-bounds access) (#3194)

21 months agoconvert : make ftype optional in simple scripts (#3185)
Cebtenzzre [Fri, 15 Sep 2023 16:29:02 +0000 (12:29 -0400)]
convert : make ftype optional in simple scripts (#3185)

21 months agosync : ggml (Metal F32 support + reduce ggml-alloc size) (#3192)
Georgi Gerganov [Fri, 15 Sep 2023 16:06:03 +0000 (19:06 +0300)]
sync : ggml (Metal F32 support + reduce ggml-alloc size) (#3192)

* sync : ggml (Metal F32 support + reduce ggml-alloc size)

ggml-ci

* llama-bench : fix ggml_cpu_has_metal() duplicate function

ggml-ci

21 months agocmake : fix building shared libs for clang (rocm) on windows (#3176)
Engininja2 [Fri, 15 Sep 2023 12:24:30 +0000 (06:24 -0600)]
cmake : fix building shared libs for clang (rocm) on windows (#3176)

21 months agoflake : use pkg-config instead of pkgconfig (#3188)
Evgeny Kurnevsky [Fri, 15 Sep 2023 08:10:22 +0000 (10:10 +0200)]
flake : use pkg-config instead of pkgconfig (#3188)

pkgconfig is an alias, it got removed from nixpkgs:
https://github.com/NixOS/nixpkgs/blob/295a5e1e2bacd6e246db8b2bb35d2a9415883224/pkgs/top-level/aliases.nix#L1408

21 months agometal : relax conditions on fast matrix multiplication kernel (#3168)
Georgi Gerganov [Fri, 15 Sep 2023 08:09:24 +0000 (11:09 +0300)]
metal : relax conditions on fast matrix multiplication kernel (#3168)

* metal : relax conditions on fast matrix multiplication kernel

* metal : revert the concurrnecy change because it was wrong

* llama : remove experimental stuff

21 months agocmake : fix llama.h location when built outside of root directory (#3179)
Andrei [Fri, 15 Sep 2023 08:07:40 +0000 (04:07 -0400)]
cmake : fix llama.h location when built outside of root directory (#3179)

21 months agoci : Cloud-V for RISC-V builds (#3160)
Ali Tariq [Fri, 15 Sep 2023 08:06:56 +0000 (13:06 +0500)]
ci : Cloud-V for RISC-V builds (#3160)

* Added Cloud-V File

* Replaced Makefile with original one

---------

Co-authored-by: moiz.hussain <redacted>
21 months agollama : remove mtest (#3177)
Roland [Fri, 15 Sep 2023 07:28:45 +0000 (03:28 -0400)]
llama : remove mtest (#3177)

* Remove mtest

* remove from common/common.h and examples/main/main.cpp

21 months agollama : make quantize example up to 2.7x faster (#3115)
Cebtenzzre [Fri, 15 Sep 2023 01:09:53 +0000 (21:09 -0400)]
llama : make quantize example up to 2.7x faster (#3115)

21 months agoflake : allow $out/include to already exist (#3175)
jneem [Thu, 14 Sep 2023 18:54:47 +0000 (13:54 -0500)]
flake : allow $out/include to already exist (#3175)

21 months agocmake : compile ggml-rocm with -fpic when building shared library (#3158)
Andrei [Thu, 14 Sep 2023 17:38:16 +0000 (13:38 -0400)]
cmake : compile ggml-rocm with -fpic when building shared library (#3158)

21 months agoflake : include llama.h in nix output (#3159)
Asbjørn Olling [Thu, 14 Sep 2023 17:25:00 +0000 (19:25 +0200)]
flake : include llama.h in nix output (#3159)

21 months agomake : fix clang++ detection, move some definitions to CPPFLAGS (#3155)
Cebtenzzre [Thu, 14 Sep 2023 17:22:47 +0000 (13:22 -0400)]
make : fix clang++ detection, move some definitions to CPPFLAGS (#3155)

* make : fix clang++ detection

* make : fix compiler definitions outside of CPPFLAGS

21 months agoCI: add FreeBSD & simplify CUDA windows (#3053)
Alon [Thu, 14 Sep 2023 17:21:25 +0000 (20:21 +0300)]
CI: add FreeBSD & simplify CUDA windows (#3053)

* add freebsd to ci

* bump actions/checkout to v3
* bump cuda 12.1.0 -> 12.2.0
* bump Jimver/cuda-toolkit version

* unify and simplify "Copy and pack Cuda runtime"
* install only necessary cuda sub packages

21 months agofalcon : use stated vocab size (#2914)
akawrykow [Thu, 14 Sep 2023 17:19:42 +0000 (10:19 -0700)]
falcon : use stated vocab size (#2914)

21 months agocmake : add relocatable Llama package (#2960)
bandoti [Thu, 14 Sep 2023 17:04:40 +0000 (14:04 -0300)]
cmake : add relocatable Llama package (#2960)

* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace

21 months agodocker : add gpu image CI builds (#3103)
dylan [Thu, 14 Sep 2023 16:47:00 +0000 (09:47 -0700)]
docker : add gpu image CI builds (#3103)

Enables the GPU enabled container images to be built and pushed
alongside the CPU containers.

Co-authored-by: canardleteer <redacted>
21 months agogguf-py : support identity operation in TensorNameMap (#3095)
Kerfuffle [Thu, 14 Sep 2023 16:32:26 +0000 (10:32 -0600)]
gguf-py : support identity operation in TensorNameMap (#3095)

Make try_suffixes keyword param optional.

21 months agofeature : support Baichuan serial models (#3009)
jameswu2014 [Thu, 14 Sep 2023 16:32:10 +0000 (00:32 +0800)]
feature : support Baichuan serial models (#3009)

21 months agospeculative : add heuristic algorithm (#3006)
Leng Yue [Thu, 14 Sep 2023 16:14:44 +0000 (09:14 -0700)]
speculative : add heuristic algorithm (#3006)

* Add heuristic algo for speculative

* Constrain minimum n_draft to 2

* speculative : improve heuristic impl

* speculative : be more rewarding upon guessing max drafted tokens

* speculative : fix typos

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agowhisper : tokenizer fix + re-enable tokenizer test for LLaMa (#3096)
goerch [Wed, 13 Sep 2023 13:19:44 +0000 (15:19 +0200)]
whisper : tokenizer fix + re-enable tokenizer test for LLaMa (#3096)

* Fix für #2721

* Reenable tokenizer test for LLaMa

* Add `console.cpp` dependency

* Fix dependency to `common`

* Fixing wrong fix.

* Make console usage platform specific

Work on compiler warnings.

* Adapting makefile

* Remove trailing whitespace

* Adapting the other parts of the makefile

* Fix typo.

21 months agocmake : add a compiler flag check for FP16 format (#3086)
Tristan Ross [Wed, 13 Sep 2023 13:08:52 +0000 (06:08 -0700)]
cmake : add a compiler flag check for FP16 format (#3086)

21 months agoCUDA: mul_mat_q RDNA2 tunings (#2910)
Johannes Gäßler [Wed, 13 Sep 2023 09:20:24 +0000 (11:20 +0200)]
CUDA: mul_mat_q RDNA2 tunings (#2910)

* CUDA: mul_mat_q RDNA2 tunings

* Update ggml-cuda.cu

Co-authored-by: Henri Vasserman <redacted>
---------

Co-authored-by: Henri Vasserman <redacted>
21 months agospeculative: add --n-gpu-layers-draft option (#3063)
FK [Wed, 13 Sep 2023 06:50:46 +0000 (08:50 +0200)]
speculative: add --n-gpu-layers-draft option (#3063)

21 months agoarm64 support for windows (#3007)
Eric Sommerlade [Wed, 13 Sep 2023 01:54:20 +0000 (02:54 +0100)]
arm64 support for windows (#3007)

Co-authored-by: Cebtenzzre <redacted>
21 months agoCUDA: fix LoRAs (#3130)
Johannes Gäßler [Tue, 12 Sep 2023 22:15:33 +0000 (00:15 +0200)]
CUDA: fix LoRAs (#3130)

21 months agoCUDA: fix mul_mat_q not used for output tensor (#3127)
Johannes Gäßler [Mon, 11 Sep 2023 20:58:41 +0000 (22:58 +0200)]
CUDA: fix mul_mat_q not used for output tensor (#3127)

21 months agoCUDA: lower GPU latency + fix Windows performance (#3110)
Johannes Gäßler [Mon, 11 Sep 2023 17:55:51 +0000 (19:55 +0200)]
CUDA: lower GPU latency + fix Windows performance (#3110)

21 months agocmake : support build for iOS/tvOS (#3116)
Jhen-Jie Hong [Mon, 11 Sep 2023 11:49:06 +0000 (19:49 +0800)]
cmake : support build for iOS/tvOS (#3116)

* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs

21 months agoCUDA: add device number to error messages (#3112)
Johannes Gäßler [Mon, 11 Sep 2023 11:00:24 +0000 (13:00 +0200)]
CUDA: add device number to error messages (#3112)

21 months agometal : PP speedup (#3084)
Kawrakow [Mon, 11 Sep 2023 07:30:11 +0000 (09:30 +0200)]
metal : PP speedup (#3084)

* Minor speed gains for all quantization types

* metal: faster kernel_scale via float4

* Various other speedups for "small" kernels

* metal: faster soft_max vial float4

* metal: faster diagonal infinity

Although, to me it looks like one should simply
fuse scale + diagnonal infinity + soft_max on the
KQtensor.

* Another faster f16 x f32 matrix multiply kernel

* Reverting the diag infinity change

It does work for PP, but somehow it fails for TG.
Need to look more into it.

* metal: add back faster diagonal infinity

This time more carefully

* metal : minor (readibility)

---------

Co-authored-by: Iwan Kawrakow <redacted>
Co-authored-by: Georgi Gerganov <redacted>
21 months agoconvert: remove most of the n_mult usage in convert.py (#3098)
Erik Scholz [Sun, 10 Sep 2023 15:06:53 +0000 (17:06 +0200)]
convert: remove most of the n_mult usage in convert.py (#3098)

21 months agometal : support for Swift (#3078)
kchro3 [Sat, 9 Sep 2023 09:12:10 +0000 (02:12 -0700)]
metal : support for Swift (#3078)

* Metal support for Swift

* update

* add a toggle for arm/arm64

* set minimum versions for all platforms

* update to use newLibraryWithURL

* bump version

Co-authored-by: Jhen-Jie Hong <redacted>
---------

Co-authored-by: Jhen-Jie Hong <redacted>
21 months agometal : support build for iOS/tvOS (#3089)
Jhen-Jie Hong [Sat, 9 Sep 2023 08:46:04 +0000 (16:46 +0800)]
metal : support build for iOS/tvOS (#3089)

21 months agoflake : add train-text-from-scratch to flake.nix (#3042)
takov751 [Fri, 8 Sep 2023 16:06:26 +0000 (17:06 +0100)]
flake : add train-text-from-scratch to flake.nix (#3042)

21 months agoreadme : fix typo (#3043)
Ikko Eltociear Ashimine [Fri, 8 Sep 2023 16:04:32 +0000 (01:04 +0900)]
readme : fix typo (#3043)

* readme : fix typo

acceleation -> acceleration

* Update README.md

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agometal : Q3_K speedup (#2995)
Kawrakow [Fri, 8 Sep 2023 16:01:04 +0000 (18:01 +0200)]
metal : Q3_K speedup (#2995)

* Slightly faster Q3_K and Q5_K on metal

* Another Q3_K speedup on metal

Combined with previous commit, we are now +9.6% for TG.
PP is not affected as this happens via the matrix multiplication
templates.

* Slowly progressing on Q3_K on metal

We are now 13% faster than master

* nother small improvement for Q3_K on metal

---------

Co-authored-by: Iwan Kawrakow <redacted>
21 months agoexamples : make n_ctx warning work again (#3066)
Cebtenzzre [Fri, 8 Sep 2023 15:43:35 +0000 (11:43 -0400)]
examples : make n_ctx warning work again (#3066)

This was broken by commit e36ecdcc ("build : on Mac OS enable Metal by
default (#2901)").

21 months agoreadme : update hot tpoics
Georgi Gerganov [Fri, 8 Sep 2023 15:18:04 +0000 (18:18 +0300)]
readme : update hot tpoics

21 months agosync : ggml (CUDA GLM RoPE + POSIX) (#3082)
Georgi Gerganov [Fri, 8 Sep 2023 14:58:07 +0000 (17:58 +0300)]
sync : ggml (CUDA GLM RoPE + POSIX) (#3082)

ggml-ci

21 months agobuild : do not use _GNU_SOURCE gratuitously (#2035)
Przemysław Pawełczyk [Fri, 8 Sep 2023 12:09:21 +0000 (14:09 +0200)]
build : do not use _GNU_SOURCE gratuitously (#2035)

* Do not use _GNU_SOURCE gratuitously.

What is needed to build llama.cpp and examples is availability of
stuff defined in The Open Group Base Specifications Issue 6
(https://pubs.opengroup.org/onlinepubs/009695399/) known also as
Single Unix Specification v3 (SUSv3) or POSIX.1-2001 + XSI extensions,
plus some stuff from BSD that is not specified in POSIX.1.

Well, that was true until NUMA support was added recently,
so enable GNU libc extensions for Linux builds to cover that.

Not having feature test macros in source code gives greater flexibility
to those wanting to reuse it in 3rd party app, as they can build it with
FTMs set by Makefile here or other FTMs depending on their needs.

It builds without issues in Alpine (musl libc), Ubuntu (glibc), MSYS2.

* make : enable Darwin extensions for macOS to expose RLIMIT_MEMLOCK

* make : enable BSD extensions for DragonFlyBSD to expose RLIMIT_MEMLOCK

* make : use BSD-specific FTMs to enable alloca on BSDs

* make : fix OpenBSD build by exposing newer POSIX definitions

* cmake : follow recent FTM improvements from Makefile

21 months agodocker : add git to full-cuda.Dockerfile main-cuda.Dockerfile (#3044)
hongbo.mo [Fri, 8 Sep 2023 10:57:55 +0000 (18:57 +0800)]
docker : add git to full-cuda.Dockerfile main-cuda.Dockerfile (#3044)

21 months agoUpdate deprecated GGML TheBloke links to GGUF (#3079)
Yui [Fri, 8 Sep 2023 10:32:55 +0000 (12:32 +0200)]
Update deprecated GGML TheBloke links to GGUF (#3079)

21 months agoggml-alloc : correctly check mmap return value for errors (#3075)
slaren [Fri, 8 Sep 2023 02:04:56 +0000 (04:04 +0200)]
ggml-alloc : correctly check mmap return value for errors (#3075)

21 months agoenable CPU HBM (#2603)
Kunshang Ji [Fri, 8 Sep 2023 01:46:56 +0000 (09:46 +0800)]
enable CPU HBM (#2603)

* add cpu hbm support

* add memalign 0 byte check

* Update ggml.c

* Update llama.cpp

* ggml : allow ggml_init with 0 size

* retrigger ci

* fix code style

---------

Co-authored-by: Georgi Gerganov <redacted>
21 months agoconvert : fix F32 ftype not being saved (#3048)
Cebtenzzre [Thu, 7 Sep 2023 18:27:42 +0000 (14:27 -0400)]
convert : fix F32 ftype not being saved (#3048)

21 months agofix some warnings from gcc and clang-tidy (#3038)
Cebtenzzre [Thu, 7 Sep 2023 17:22:29 +0000 (13:22 -0400)]
fix some warnings from gcc and clang-tidy (#3038)

Co-authored-by: xaedes <redacted>
21 months agomake : improve test target (#3031)
Cebtenzzre [Thu, 7 Sep 2023 14:15:01 +0000 (10:15 -0400)]
make : improve test target (#3031)

21 months agomake : fix CPPFLAGS (#3035)
Cebtenzzre [Thu, 7 Sep 2023 14:13:50 +0000 (10:13 -0400)]
make : fix CPPFLAGS (#3035)

21 months agollama-bench : use two tokens in the warmup run for prompt evals (#3059)
slaren [Thu, 7 Sep 2023 13:52:34 +0000 (15:52 +0200)]
llama-bench : use two tokens in the warmup run for prompt evals (#3059)

21 months agometal : parallel RoPE on Metal (#3024)
Kawrakow [Thu, 7 Sep 2023 13:45:01 +0000 (15:45 +0200)]
metal : parallel RoPE on Metal (#3024)

* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <redacted>
21 months agometal : correct fix of kernel_norm (#3060)
Kawrakow [Thu, 7 Sep 2023 13:42:42 +0000 (15:42 +0200)]
metal : correct fix of kernel_norm (#3060)

Co-authored-by: Iwan Kawrakow <redacted>
Co-authored-by: Georgi Gerganov <redacted>
21 months agometal : fix kernel_norm (fixes Falcon on Metal) (#3057)
Georgi Gerganov [Thu, 7 Sep 2023 12:49:09 +0000 (15:49 +0300)]
metal : fix kernel_norm (fixes Falcon on Metal) (#3057)

* metal : fix kernel_norm

ggml-ci

* metal : put warning in kernel_norm to not combine the loops

* metal : restore original F16 mat-vec multiplication

It works after the norm fixes

* common : don't do warm-up with more than n_batch tokens (close #3058)

ggml-ci

* metal : minor

21 months agoggml : posixify madvise and pagesize (#3037)
Przemysław Pawełczyk [Thu, 7 Sep 2023 08:15:06 +0000 (10:15 +0200)]
ggml : posixify madvise and pagesize (#3037)

* llama : use posix_madvise() instead of madvise() derived from BSD

sed -i 's,\<madvise\>,posix_&,g;s,\<MADV_,POSIX_&,g' llama.cpp

* ggml : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD

sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml.c

* metal : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD

sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml-metal.m

21 months agok-quants : fix zero-weight guard in Q6_K (ref #3040)
Georgi Gerganov [Wed, 6 Sep 2023 09:40:57 +0000 (12:40 +0300)]
k-quants : fix zero-weight guard in Q6_K (ref #3040)