]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : add ALiBi support for ggml_soft_max_ext (#5488)
authorGeorgi Gerganov <redacted>
Sat, 17 Feb 2024 21:04:16 +0000 (23:04 +0200)
committerGitHub <redacted>
Sat, 17 Feb 2024 21:04:16 +0000 (23:04 +0200)
commit8f1be0d42f23016cb6819dbae01126699c4bd9bc
tree4a142e745a73307190e9c5ef5c41aeb4aadaca7a
parent6e4e973b2615f8d390b1c4f4a7e05a119078bb0f
ggml : add ALiBi support for ggml_soft_max_ext (#5488)

* ggml : avoid recomputing alibi slopes (CPU)

* llama : reuse hparams.f_max_alibi_bias in all cases

ggml-ci

* ggml : support alibi bias in ggml_soft_max_ext (CPU + Metal)

ggml-ci

* ggml : handle all SRCs (do not break on first null)

ggml-ci

* tests : do not use slope for large soft_max

accumulates too much error

ggml-ci

* ggml : alternative ALiBi without extra tensor

We compute the slopes in the kernel

ggml-ci

* cuda : add ALiBi support in ggml_soft_max_ext

ggml-ci

* ggml : deprecate ggml_alibi

* ggml : support multi-sequence ALiBi (Metal)

ggml-ci

* cuda : add multi-seq ALiBi + remote F16 soft_max

ggml-ci

* ggml : update deprecation message

* ggml : fix pos ptr when no ALiBi

ggml-ci

* cuda : fix performance (pow -> powf)

* cuda : precompute ALiBi constants

* metal : pre-compute ALiBi slopes

ggml-ci

* llama : init kq_pos only if needed

ggml-ci

* test-backend-ops : add null pos test to soft_max

test-backend-ops : replace soft_max tests

ggml-ci

---------

Co-authored-by: slaren <redacted>
ggml-alloc.c
ggml-backend.c
ggml-cuda.cu
ggml-metal.m
ggml-metal.metal
ggml.c
ggml.h
llama.cpp
tests/test-backend-ops.cpp