Skip to content

[ONNX] Create fake implementations for onnx ops; fix boolean mask in attention#165780

Closed
justinchuby wants to merge 13 commits intopytorch:mainfrom
justinchuby:justinchu/meta-native
Closed

[ONNX] Create fake implementations for onnx ops; fix boolean mask in attention#165780
justinchuby wants to merge 13 commits intopytorch:mainfrom
justinchuby:justinchu/meta-native

Conversation

@justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Oct 17, 2025

Previously we rely on the concreate implementation to generate fake implementation. This makes the fake implementation overly complicated and breaks in some cases when there are dynamic shapes.

This PR updates onnx op registration to instead take a dedicated fake implementation.

Also fixed: When boolean mask is supplied to torch sdpa, it was previously taken the negation, which is incorrect.

Fix #164909 Also taken changes from #156635

cc @titaiwangms

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Oct 17, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 17, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9fba564 with merge base b31bad1 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@justinchuby
Copy link
Collaborator Author

cc @jambayk

@justinchuby justinchuby added module: onnx Related to torch.onnx topic: improvements topic category labels Oct 17, 2025
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 19, 2025
@justinchuby justinchuby self-assigned this Oct 25, 2025
@justinchuby
Copy link
Collaborator Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@pytorchmergebot
Copy link
Collaborator

Successfully rebased justinchu/meta-native onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout justinchu/meta-native && git pull --rebase)

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added topic: bug fixes topic category and removed topic: improvements topic category labels Oct 28, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby changed the title [ONNX] Create fake implementations for onnx ops [ONNX] Create fake implementations for onnx ops; fix boolean mask in attention Oct 28, 2025
@justinchuby justinchuby added this to the 2.10.0 milestone Oct 28, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 29, 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

BoyuanFeng pushed a commit that referenced this pull request Oct 31, 2025
…attention (#165780)

Previously we rely on the concreate implementation to generate fake implementation. This makes the fake implementation overly complicated and breaks in some cases when there are dynamic shapes.

This PR updates onnx op registration to instead take a dedicated fake implementation.

**Also fixed: When boolean mask is supplied to torch sdpa, it was previously taken the negation, which is incorrect.**

Fix #164909 Also taken changes from #156635

Pull Request resolved: #165780
Approved by: https://github.com/titaiwangms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes topic: bug fixes topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ONNX] Create meta implementations for onnx ops

6 participants