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

Add flop formulas for sdpa #95854

Closed
wants to merge 4 commits into from
Closed

Conversation

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 2, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit e9e9c34:
💚 Looks good so far! There are no failures yet. 💚

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

Chillee added a commit that referenced this pull request Mar 2, 2023
ghstack-source-id: 771ea7fb25103fdfee0bf063b96f9b28aa2627aa
Pull Request resolved: #95854
@Chillee Chillee added the topic: not user facing topic category label Mar 2, 2023
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

torch/utils/flop_counter.py Outdated Show resolved Hide resolved
# [b, h, s, d] @ [b, h, d, s2] -> [b, h, s, s2]
total_flops += bmm_flop([(b * h, s, d), (b * h, d, s2)])
# [b, h, s, s2] @ [b, h, s2, d] -> [b, h, s2, d]
total_flops += bmm_flop([(b * h, s, s2), (b * h, s2, d)])
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how precise flop_counting is but in essence, we only really care about the bmms right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

more or less yeah.

@Chillee
Copy link
Contributor Author

Chillee commented Mar 3, 2023

I still need to add the backwards formulas, but I'll leave that to a future PR 🤔

@Chillee
Copy link
Contributor Author

Chillee commented Mar 3, 2023

@pytorchbot merge

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

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
ydwu4 pushed a commit to ydwu4/pytorch that referenced this pull request Mar 10, 2023
ydwu4 added a commit to ydwu4/pytorch that referenced this pull request Mar 13, 2023
@facebook-github-bot facebook-github-bot deleted the gh/chillee/190/head branch June 8, 2023 15:54
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 topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants