mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 18:35:00 +08:00
Fix boundary check in paged attention kernel (#1241)
This commit is contained in:
parent
b5a10eb0ef
commit
ebe4d1db3a
@ -269,7 +269,7 @@ __global__ void single_query_cached_kv_attention_kernel(
|
|||||||
// See https://github.com/vllm-project/vllm/issues/641#issuecomment-1682544472
|
// See https://github.com/vllm-project/vllm/issues/641#issuecomment-1682544472
|
||||||
scalar_t* v_vec_ptr = reinterpret_cast<scalar_t*>(&v_vec);
|
scalar_t* v_vec_ptr = reinterpret_cast<scalar_t*>(&v_vec);
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (int j = 0; j <= V_VEC_SIZE; j++) {
|
for (int j = 0; j < V_VEC_SIZE; j++) {
|
||||||
v_vec_ptr[j] = token_idx + j < context_len ? v_vec_ptr[j] : zero_value;
|
v_vec_ptr[j] = token_idx + j < context_len ? v_vec_ptr[j] : zero_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user