diff options
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 * ======================================================================== */ |
