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 /qwen_kernels.h | |
| parent | d98ee1568c0bd88304a12e59d12104066e01e8d0 (diff) | |
| download | ffwd-f463018cd700690336898d109226d489deca036d.tar.gz ffwd-f463018cd700690336898d109226d489deca036d.zip | |
all: add support for Qwen3-Embedding + causal GQA attention
Diffstat (limited to 'qwen_kernels.h')
| -rw-r--r-- | qwen_kernels.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qwen_kernels.h b/qwen_kernels.h index 71f77f1..c611194 100644 --- a/qwen_kernels.h +++ b/qwen_kernels.h @@ -116,6 +116,20 @@ void qwen_bidirectional_gqa_attention_packed_with_scratch( const int *offsets, int batch, int n_heads, int n_kv_heads, int head_dim, float scale, float *scratch, size_t scratch_bytes); +/* + * Causal GQA attention over a packed/ragged batch. Query position i attends + * only to positions at or before i within its sequence. + */ +void qwen_causal_gqa_attention_packed(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); +void qwen_causal_gqa_attention_packed_with_scratch( + 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); + /* ======================================================================== * Position Embeddings * ======================================================================== */ |
