mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Fix SparseAttention cos/sin cache dimension checks (#20609)
### Description This PR fixes the dimension checks for the cos/sin caches used in the rotary embeddings in the `SparseAttention` operator. ### Motivation and Context This PR ports over the same changes from [this PR](https://github.com/microsoft/onnxruntime/pull/20547) for `GroupQueryAttention`.
This commit is contained in:
parent
58d7b12205
commit
274d162d93
1 changed files with 4 additions and 4 deletions
|
|
@ -202,13 +202,13 @@ Status CheckInputs(void* params,
|
|||
"head_size shall be a multiple of 16. Got head_size = ",
|
||||
head_size);
|
||||
}
|
||||
if (cos_dims[0] < max_sequence_length) {
|
||||
if (cos_dims[0] < total_sequence_length) {
|
||||
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT,
|
||||
"cos_cache dimension 0 should be of max_sequence_length.");
|
||||
"cos_cache dimension 0 should be not be less than total_sequence_length.");
|
||||
}
|
||||
if (sin_dims[0] < max_sequence_length) {
|
||||
if (sin_dims[0] < total_sequence_length) {
|
||||
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT,
|
||||
"sin_cache dimension 0 should be of max_sequence_length.");
|
||||
"sin_cache dimension 0 should be not be less than total_sequence_length.");
|
||||
}
|
||||
if (cos_dims[1] > (head_size / 16) * 8 || cos_dims[1] % 8 != 0) {
|
||||
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT,
|
||||
|
|
|
|||
Loading…
Reference in a new issue