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 MX4 perf Pt. 1 #2709

Closed
wants to merge 1 commit into from
Closed

Improve MX4 perf Pt. 1 #2709

wants to merge 1 commit into from

Conversation

spcyppt
Copy link
Contributor

@spcyppt spcyppt commented Jun 10, 2024

Summary:
This kernel is compute bound when the input tensor is very large. One of the factors and the main optimization for this diff is doing a fusion instruction. That is, instead of doing x * pow(2, y), we do scalebn(x, y) -- this significantly reduces the number of cycles needed to do the computation.

Improve MX4 kernel performance

  • replace pow with scalebn
  • remove flush_fp32_subnorms which is currently not used. (Note: we will update to support this later)

Performance improvement:

  • quantize: 39M cycles -> 24M
  • dequantize: 28M -> 10M

Reviewed By: sryap

Differential Revision: D58296469

@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Jun 10, 2024

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit d24b546
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/66679897d76b7300080d13d4
😎 Deploy Preview https://deploy-preview-2709--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.

@facebook-github-bot
Copy link
Contributor

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

spcyppt added a commit that referenced this pull request Jun 11, 2024
Summary:
Pull Request resolved: #2709

This kernel is compute bound when the input tensor is very large. One of the factors and the main optimization for this diff is doing a fusion instruction.  That is, instead of doing `x * pow(2, y)`, we do `scalebn(x, y)` -- this significantly reduces the number of cycles needed to do the computation.

Improve MX4 kernel performance
- replace `pow` with `scalebn`
- remove `flush_fp32_subnorms` which is currently not used. (Note: we will update to support this later)

Performance improvement:
- quantize: 39M cycles -> 24M
- dequantize: 28M -> 10M

Reviewed By: sryap

Differential Revision: D58296469
Summary:
Pull Request resolved: #2709

This kernel is compute bound when the input tensor is very large. One of the factors and the main optimization for this diff is doing a fusion instruction.  That is, instead of doing `x * pow(2, y)`, we do `scalebn(x, y)` -- this significantly reduces the number of cycles needed to do the computation.

Improve MX4 kernel performance
- replace `pow` with `scalebn`
- remove `flush_fp32_subnorms` which is currently not used. (Note: we will update to support this later)

Performance improvement:
- quantize: 39M cycles -> 24M
- dequantize: 28M -> 10M

Reviewed By: sryap

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in d8900ae.

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.

None yet

2 participants