Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRANSFORMATIONS][GPU] SDPA Fusion passes #28042

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladimir-paramuzov
Copy link
Contributor

@vladimir-paramuzov vladimir-paramuzov commented Dec 12, 2024

Details:

  • Added basic SDPA fusion pass and QK scaling fusion into SDPA

T5 case

@vladimir-paramuzov vladimir-paramuzov requested review from a team as code owners December 12, 2024 12:40
@vladimir-paramuzov vladimir-paramuzov requested review from itikhono and removed request for a team December 12, 2024 12:40
@github-actions github-actions bot added category: GPU OpenVINO GPU plugin category: transformations OpenVINO Runtime library - Transformations labels Dec 12, 2024
@vladimir-paramuzov vladimir-paramuzov force-pushed the sdpa_fusion branch 2 times, most recently from 44480fe to 792a90f Compare December 12, 2024 12:53
Comment on lines 29 to 30
auto scaled_q = makePattern<ov::op::v1::Multiply>({q, scale_q});
auto scaled_k = makePattern<ov::op::v1::Multiply>({k, scale_k});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make sense to make one of these multiply optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relaxed pattern restrictions to support optional scales + non-constant scale case

pattern_map.at(softmax).get_target_inputs().size() > 1) {
return false;
}
if (pattern_map.count(optional_add_mask) && (pattern_map.at(optional_add_mask).get_target_inputs().size() > 1 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this restriction on the number of mask consumers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not mask consumers, but Add op consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin category: transformations OpenVINO Runtime library - Transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants