From 8d412f8a225f3e337dac271ea2491ac3c1c099af Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Tue, 2 Jun 2026 09:08:54 +0200 Subject: cpu: reuse tiled attention scratch buffers --- qwen_asr_kernels.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qwen_asr_kernels.h') diff --git a/qwen_asr_kernels.h b/qwen_asr_kernels.h index 92082f1..c32ec3a 100644 --- a/qwen_asr_kernels.h +++ b/qwen_asr_kernels.h @@ -150,6 +150,14 @@ void qwen_bidirectional_gqa_attention_packed(float *out, const float *Q, int n_heads, int n_kv_heads, int head_dim, float scale); +/* Optional reusable scratch for the BLAS-tiled packed attention path. */ +size_t qwen_bidirectional_gqa_attention_packed_scratch_bytes( + const int *offsets, int batch); +void qwen_bidirectional_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 * ======================================================================== */ -- cgit v1.3.1