Skip to content

fix: do not pass positions to RoPE when attn_backend is sdpa - #4804

Closed
ysa2215 wants to merge 22 commits into
pytorch:mainfrom
hann-wang:yue/sdpa-rope-no-positions
Closed

ysa2215 wants to merge 22 commits into
pytorch:mainfrom
hann-wang:yue/sdpa-rope-no-positions

Conversation

@ysa2215

@ysa2215 ysa2215 commented Sep 20, 2026

Copy link
Copy Markdown

Summary

When GQAttention uses the SDPA backend, pass None to rotary embedding instead of forwarding explicit positions.
Explicit positions remain unchanged for the flex and varlen backends.

Tests

python3 -m unittest tests.unit_tests.test_sdpa_rope_positions -v

@pytorch-bot pytorch-bot Bot added ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl labels Sep 20, 2026
@meta-cla

meta-cla Bot commented Sep 20, 2026

Copy link
Copy Markdown

Hi @ysa2215!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@pytorch-bot

pytorch-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/rl
  • ciflow/fake-pg

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SDPA should no longer support GQAttention anymore. Would it not error out?

Also, need to rebase.

@ysa2215
ysa2215 marked this pull request as draft September 21, 2026 08:42
@pytorch-bot pytorch-bot Bot removed the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Sep 21, 2026
@ysa2215 ysa2215 closed this Sep 21, 2026
@ysa2215

ysa2215 commented Sep 21, 2026

Copy link
Copy Markdown
Author

seems targeting at a wrong main branch, close this PR and reopen for related main branch

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.

3 participants