ggml : sync ggml (ggml_alibi)

This commit is contained in:
Georgi Gerganov 2023-04-28 20:37:43 +03:00
parent 5fba3c016b
commit 55390bcaf2
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
2 changed files with 210 additions and 2 deletions

9
ggml.h
View file

@ -269,6 +269,7 @@ extern "C" {
GGML_OP_DIAG_MASK_INF,
GGML_OP_SOFT_MAX,
GGML_OP_ROPE,
GGML_OP_ALIBI,
GGML_OP_CONV_1D_1S,
GGML_OP_CONV_1D_2S,
@ -662,6 +663,14 @@ extern "C" {
int n_dims,
int mode);
// alibi position embedding
// in-place, returns view(a)
struct ggml_tensor * ggml_alibi(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_past,
int n_head);
// padding = 1
// TODO: we don't support extra parameters for now
// that's why we are hard-coding the stride, padding, and dilation