-
Notifications
You must be signed in to change notification settings - Fork 108
Use torch._grouped_mm in eager mode #2721
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
base: main
Are you sure you want to change the base?
Conversation
This gives a fair comparison between eager and other modes. The constraints mentioned in the comment seem to have been fixed at least for Blackwell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables the use of torch._grouped_mm in eager mode for benchmarking purposes, providing a fair comparison between eager and other modes. Previously, the function was only used during compilation (via torch.compiler.is_compiling() check). The constraints that prevented eager mode usage have been resolved.
Key changes:
- Replaced
torch.compiler.is_compiling()check with availability check based on_grouped_mmvariable - Added
elseclause to set_grouped_mm = Nonefor torch versions < 2.8.0 - Removed outdated comment about constraints requiring offsets to be multiples of 16
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Masaki <[email protected]>
crcrpar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
mattteochen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This gives a fair comparison between eager and other modes.
The constraints mentioned in the comment seem to have been fixed by pytorch/pytorch#161407
python thunder/benchmarks/benchmark_inference.pyat head runs fine on both Blackwell and Ampere.