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

Improve performance of prefill mode FP8 Grouped Gemm #3522

Closed
wants to merge 1 commit into from

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Dec 20, 2024

Summary: I previously assumed that using hipmemcpy would be more efficient than launching many kernels that directly set gpu memory. This assumption is apparently (and very surprisingly) untrue. It seems the the multi-kernel-launch approach reduces overhead considerably, giving a 10% speedup.

Differential Revision: D67531231

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67531231

Copy link

netlify bot commented Dec 20, 2024

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 47b6396
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67733c6fe95d5b0008e12fdc
😎 Deploy Preview https://deploy-preview-3522--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Dec 20, 2024
Summary:

X-link: facebookresearch/FBGEMM#603

I previously assumed that using hipmemcpy would be more efficient than launching many kernels that directly set gpu memory. This assumption is apparently (and very surprisingly) untrue. It seems the the multi-kernel-launch approach reduces overhead considerably, giving a 10% speedup.

Differential Revision: D67531231
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67531231

jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Dec 22, 2024
Summary:
Pull Request resolved: pytorch#3522

X-link: facebookresearch/FBGEMM#603

I previously assumed that using hipmemcpy would be more efficient than launching many kernels that directly set gpu memory. This assumption is apparently (and very surprisingly) untrue. It seems the the multi-kernel-launch approach reduces overhead considerably, giving a 10% speedup.

Differential Revision: D67531231
Summary:

X-link: facebookresearch/FBGEMM#603

It turns out that setting up the grouped gemm kernel arguments can be a significant overhead. This diff more carefully checks the number of groups to dispatch to either a hipmemcpy based approach, which works well when there are 16 more groups, or a series of kernels that directly sets the gpu memory for each group. For smaller number of groups, this approach provides a pretty substantial speedup.

Reviewed By: jianyuh

Differential Revision: D67531231
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67531231

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 8a1ca16.

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.

2 participants