ggml-cuda: bind cublas handle to the backend stream in DSA attention (#2347)
The DSA attention kernel used the shared cublas handle without binding it to the backend's stream, so its Q.K / P.V GEMMs ran on a different stream than the gather and softmax kernels. The softmax could then read the score buffer before the GEMM wrote it, picking up stale (NaN) values.
This commit is contained in:
parent
c574620b12
commit
26113d1dd3
|
|
@ -344,6 +344,7 @@ bool ggml_cuda_dsa_attn_ext(ggml_backend_cuda_context & ctx, ggml_tensor * dst)
|
|||
(const float *)((const char *)Q->data + first*Q->nb[1]), q16.get());
|
||||
}
|
||||
|
||||
CUBLAS_CHECK(cublasSetStream(ctx.cublas_handle(), ctx.stream()));
|
||||
CUBLAS_CHECK(cublasHgemmStridedBatched(ctx.cublas_handle(), CUBLAS_OP_T, CUBLAS_OP_N,
|
||||
indexer->ne[0], Q->ne[2], Q->ne[0],
|
||||
&alpha, k16.get(), K->ne[0], K->ne[0]*indexer->ne[0],
|
||||
|
|
|
|||
Loading…
Reference in New Issue