Skip to content

Enable fast FP8 GEMM for memory bound #3577

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 1 commit into from

Conversation

jiawenliu64
Copy link
Member

Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/659

This Diff enables fast FP8 gemm for memory bound with adding TRT-LLM FP8 cuda gemm to fbgemm. In addition to the original kernel, this Diff extends the kernel to:

  • Support pytorch operations
  • Support cuda graph with handling scale as tensor
  • Support larger dim M
  • Support benchmark/unittest

For decode attn linear shapes:

  • When BS=1, TRT-LLM FP8 gemm brings 2x speedup compared to BF16, while FP8 cutlass gemm’s perf is similar to BF16
  • When BS>4, TRT-LLM FP8 gemm does not bring perf gain

This TRT-LLM kernel is based on tensorwise quantization not rowwise

Reviewed By: jwfromm

Differential Revision: D68193920

@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

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

Summary:

X-link: facebookresearch/FBGEMM#659

This Diff enables fast FP8 gemm for memory bound with adding TRT-LLM FP8 cuda gemm to fbgemm. In addition to the original kernel, this Diff extends the kernel to:
- Support pytorch operations
- Support cuda graph with handling scale as tensor
- Support larger dim M
- Support benchmark/unittest

For decode attn linear shapes:
- When BS=1, TRT-LLM FP8 gemm brings 2x speedup compared to BF16, while FP8 cutlass gemm’s perf is similar to BF16
- When BS>4, TRT-LLM FP8 gemm does not bring perf gain

This TRT-LLM kernel is based on tensorwise quantization not rowwise.

Reviewed By: jwfromm

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 497bad6.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 2d025dc.

q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
Summary:
X-link: pytorch#3577

Pull Request resolved: facebookresearch/FBGEMM#659

This Diff enables fast FP8 gemm for memory bound with adding TRT-LLM FP8 cuda gemm to fbgemm. In addition to the original kernel, this Diff extends the kernel to:
- Support pytorch operations
- Support cuda graph with handling scale as tensor
- Support larger dim M
- Support benchmark/unittest

For decode attn linear shapes:
- When BS=1, TRT-LLM FP8 gemm brings 2x speedup compared to BF16, while FP8 cutlass gemm’s perf is similar to BF16
- When BS>4, TRT-LLM FP8 gemm does not bring perf gain

This TRT-LLM kernel is based on tensorwise quantization not rowwise.

Reviewed By: jwfromm

Differential Revision: D68193920

fbshipit-source-id: fbf34e283e9430a8fed63ddb91781ade321012e3
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