diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 15:19:12 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 15:19:12 +0200 |
| commit | f463018cd700690336898d109226d489deca036d (patch) | |
| tree | 4e1d83f55a5e231af519aa4d647141db5de23af7 /embed_internal.h | |
| parent | d98ee1568c0bd88304a12e59d12104066e01e8d0 (diff) | |
| download | ffwd-f463018cd700690336898d109226d489deca036d.tar.gz ffwd-f463018cd700690336898d109226d489deca036d.zip | |
all: add support for Qwen3-Embedding + causal GQA attention
Diffstat (limited to 'embed_internal.h')
| -rw-r--r-- | embed_internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/embed_internal.h b/embed_internal.h index a7365a2..60fc581 100644 --- a/embed_internal.h +++ b/embed_internal.h @@ -29,12 +29,18 @@ typedef struct { const float *norm; /* [hidden] */ } embed_weights_t; +typedef void (*embed_attention_fn)( + float *out, const float *Q, const float *K, const float *V, + const int *offsets, int batch, int n_heads, int n_kv_heads, + int head_dim, float scale, float *scratch, size_t scratch_bytes); + struct embed_model { embed_config_t config; embed_weights_t weights; void *safetensors; /* multi_safetensors_t*, keeps mmap alive */ int layer_start; /* loaded transformer range, inclusive */ int layer_end; /* loaded transformer range, exclusive */ + embed_attention_fn attention; }; struct embed_workspace { |
