Skip to content

Add Preshuffled FP8 x INT4 Grouped Gemm Kernel#3800

Closed
jwfromm wants to merge 3 commits into
pytorch:mainfrom
jwfromm:export-D70870933
Closed

Add Preshuffled FP8 x INT4 Grouped Gemm Kernel#3800
jwfromm wants to merge 3 commits into
pytorch:mainfrom
jwfromm:export-D70870933

Conversation

@jwfromm

@jwfromm jwfromm commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

Summary: Working on adding support for stacked mixed dtype grouped gemm with preshuffling.

Differential Revision: D70870933

@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

@netlify

netlify Bot commented Mar 11, 2025

Copy link
Copy Markdown

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 46acfbc
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67d48d40fe71510008d0e03f
😎 Deploy Preview https://deploy-preview-3800--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 Mar 13, 2025
Summary:

Working on adding support for stacked mixed dtype grouped gemm with preshuffling.

Differential Revision: D70870933
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
jwfromm added a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:

Working on adding support for stacked mixed dtype grouped gemm with preshuffling.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Pull Request resolved: pytorch#3800
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Pull Request resolved: pytorch#3800
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Mar 13, 2025
Summary:
Pull Request resolved: pytorch#3800

Working on adding support for stacked mixed dtype grouped gemm with preshuffling.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Pull Request resolved: pytorch#3800
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Differential Revision: D70870933
Summary:
X-link: facebookresearch/FBGEMM#847

Pull Request resolved: pytorch#3766

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.

Differential Revision: D70587477
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 14, 2025
Summary:
X-link: facebookresearch/FBGEMM#897

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

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

Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

Differential Revision: D70870933
Summary:
X-link: facebookresearch/FBGEMM#897

Pull Request resolved: pytorch#3800
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

Differential Revision: D70870933
jwfromm pushed a commit to jwfromm/FBGEMM that referenced this pull request Mar 14, 2025
Summary:
Pull Request resolved: pytorch#3800

Working on adding support for stacked mixed dtype grouped gemm with preshuffling.

Differential Revision: D70870933
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in a39d2cc.

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

Pull Request resolved: pytorch#3800
Efficient FP8xINT4 grouped gemm with preshuffling and scale packing. This implementation uses the "stacked" API where inputs and outputs are single contiguous tensors and the group boundaries are indicated with an `M_sizes` tensor that contains the number of rows in each group.

Reviewed By: jiawenliu64

Differential Revision: D70870933

fbshipit-source-id: 195fb9feb993ffa7efe27b038173bd70a1db57ed
@robertgshaw2-redhat

Copy link
Copy Markdown

hey @jwfromm - thanks for the PR

What exactly the intended use of m_offsets?

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.

4 participants