From f463018cd700690336898d109226d489deca036d Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Sun, 14 Jun 2026 15:19:12 +0200 Subject: all: add support for Qwen3-Embedding + causal GQA attention --- embed_internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'embed_internal.h') 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 { -- cgit v1.3.1