Skip to content

Provide helper functions for int4 quantization #3775

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

Closed
wants to merge 2 commits into from

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Mar 6, 2025

Summary: This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Differential Revision: D70643388

@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Mar 6, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 75124a2
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67d48c0b21268200081e1426
😎 Deploy Preview https://deploy-preview-3775--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 jwfromm force-pushed the export-D70643388 branch from d4fd535 to 6fab18a Compare March 6, 2025 18:30
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 6, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

@jwfromm jwfromm force-pushed the export-D70643388 branch from 6fab18a to 24e123e Compare March 7, 2025 17:34
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 7, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

@jwfromm jwfromm force-pushed the export-D70643388 branch from 24e123e to d9e4e3f Compare March 7, 2025 17:34
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 7, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 7, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
@jwfromm jwfromm force-pushed the export-D70643388 branch from d9e4e3f to afe0b73 Compare March 7, 2025 17:41
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 11, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 12, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 12, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 12, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 12, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Differential Revision: D70643388

Reviewed By: summerdengfb
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Differential Revision: D70643388

Reviewed By: summerdengfb
jwfromm added 2 commits March 14, 2025 13:05
Summary:
X-link: facebookresearch/FBGEMM#847


One of the new interesting changes in the preshuffled F8I4 kernel is that group scales are downcast to FP8. This has the risk of running into dynamic range issues and impacting accuracy. We can mitigate this risk by adding FP32 columnwise scaling to the output. Fortunately, we can do this using EVT so the performance impact is negligible.

Reviewed By: jiawenliu64

Differential Revision: D70587477
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

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

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

jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#855


This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388
jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Differential Revision: D70643388

Reviewed By: summerdengfb
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c8ee354.

liligwu pushed a commit to ROCm/FBGEMM that referenced this pull request Mar 19, 2025
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/855

Pull Request resolved: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388

fbshipit-source-id: 25d1896ead1918707c056e8cfb0d02bbdd24ecd1
q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
Summary:
Pull Request resolved: facebookresearch/FBGEMM#855

X-link: pytorch#3775

This diff introduces a set of quantization helper functions to fbgemm_gpu/experimental/gen_ai to make it easier to apply the new Int4 packing and preshuffling to weights.

Reviewed By: summerdengfb

Differential Revision: D70643388

fbshipit-source-id: 25d1896ead1918707c056e8cfb0d02bbdd24ecd1
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.

3 participants