KEMBAR78
[FlexAttention] fixing learnable bias assertion error in inductor by liangel-02 · Pull Request #161170 · pytorch/pytorch · GitHub
Skip to content

Conversation

@liangel-02
Copy link
Contributor

@liangel-02 liangel-02 commented Aug 21, 2025

Users encountered unexpected behaviour when using FlexAttention with learnable biases, including assertion errors (#157677)

We traced the root cause to the registration of subgraph buffers—this caused inconsistencies in the naming and ultimately incorrect retrieval later on. This problem only arose if the model was compiled as a whole (ie using @torch.compile) since only then would there be naming conflicts.

In this PR, we register the buffers with the base graph to solve this issue.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @Chillee @drisspg @yanboliang @BoyuanFeng

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 21, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161170

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 11ec4fd with merge base e20f6d7 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@liangel-02 liangel-02 changed the title [FlexAttention] fixing learnable biases in inductor [FlexAttention] fixing learnable bias assertion error in inductor Aug 21, 2025
@drisspg drisspg marked this pull request as ready for review August 22, 2025 01:22
@liangel-02
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 23, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…torch#161170)

Users encountered unexpected behaviour when using FlexAttention with learnable biases, including assertion errors (pytorch#157677)

We traced the root cause to the registration of subgraph buffers—this caused inconsistencies in the naming and ultimately incorrect retrieval later on. This problem only arose if the model was compiled as a whole (ie using @torch.compile) since only then would there be naming conflicts.

In this PR, we register the buffers with the base graph to solve this issue.

Pull Request resolved: pytorch#161170
Approved by: https://github.com/drisspg
@github-actions github-actions bot deleted the learnablebias branch September 23, 2025 02:08
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