pytorch / FBGEMM

FB (Facebook) + GEMM (General Matrix-Matrix Multiplication) - https://code.fb.com/ml-applications/fbgemm/
Other
1.17k stars 474 forks source link

Optimize MX4 padding to minimize need for tuning #3040

Closed jwfromm closed 1 week ago

jwfromm commented 2 weeks ago

Summary: D61447274 introduced a very cool way of doing 2D indexing over input tensors during MX4 quantization, however, it is fairly reliant on tuning configurations to get good performance. It turns out the use case for MX4 has highly dynamic shapes, so we spend a huge amount of time tuning those shapes.

After deep meditation I realized there's a much simpler indexing scheme we can use, which is similar to the 1D accesses we used previously but adds shifts for padding.

With this approach we should get the best of both worlds; support for padding rows not divisible by group size and minimizing tuning while maintaining good performance.

Differential Revision: D61816830

netlify[bot] commented 2 weeks ago

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
Latest commit f4f7779b914d00cb0a05965a00ec592c80cc8375
Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/66cfbe77c77b7d000886ff37
Deploy Preview https://deploy-preview-3040--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 commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 2 weeks ago

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

facebook-github-bot commented 1 week ago

This pull request has been merged in pytorch/FBGEMM@c818b87d5313431412335d7b6cf0bb389f421581.