Skip to content

Fix GQA Rotary Embedding sequence length#19801

Merged
aciddelgado merged 1 commit intomainfrom
aciddelgado/fix_rotary_gqa
Mar 6, 2024
Merged

Fix GQA Rotary Embedding sequence length#19801
aciddelgado merged 1 commit intomainfrom
aciddelgado/fix_rotary_gqa

Conversation

@aciddelgado
Copy link
Contributor

Description

Previously, GQA incorrectly enforced rotary cos and sin cache to be of sequence length equal to present sequence length. Now it enforces that it be greater than or equal to present sequence length since to match Rotary Embedding Op it should be of max_sequence_length

Motivation and Context

Fixes issue with fusing Rotary Embedding and GQA for certain models which prefer this optimization.

@aciddelgado aciddelgado merged commit 8bd1335 into main Mar 6, 2024
@aciddelgado aciddelgado deleted the aciddelgado/fix_rotary_gqa branch March 6, 2024 20:34
zz002 pushed a commit to zz002/onnxruntime that referenced this pull request Mar 7, 2024
### Description
Previously, GQA incorrectly enforced rotary cos and sin cache to be of
sequence length equal to present sequence length. Now it enforces that
it be greater than or equal to present sequence length since to match
Rotary Embedding Op it should be of max_sequence_length



### Motivation and Context
Fixes issue with fusing Rotary Embedding and GQA for certain models
which prefer this optimization.
YUNQIUGUO pushed a commit that referenced this pull request Mar 21, 2024
### Description
Previously, GQA incorrectly enforced rotary cos and sin cache to be of
sequence length equal to present sequence length. Now it enforces that
it be greater than or equal to present sequence length since to match
Rotary Embedding Op it should be of max_sequence_length



### Motivation and Context
Fixes issue with fusing Rotary Embedding and GQA for certain models
which prefer this optimization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants