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

Switch from fbgemm-gpu w8a8 scaled matmul to vLLM/marlin-kernels #2688

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

danieldk
Copy link
Member

@danieldk danieldk commented Oct 24, 2024

What does this PR do?

Performance and accuracy of these kernels are on par (tested with Llama 70B and 405B). Removes a dependency and resolves some stability issues we have been seeing.

Two test snapshots had to be changed. It seems like the perturbations come from switching from bfloat16 (which was the only dtype supported by fbgemm FP8 quantization) to float16 which is our default dtype for Llama (even though recent Llama checkpoints are bfloat16).

I added an environment variable USE_CUTLASS_W8A to force use of the cutlass kernels on compute capability 8. The question why we use FP8-Marlin on compute capability 8.9 comes up occasionally (because it's faster and probably more accurate because it's in FP16), so this is a backdoor to use W8A8 on 8.9 in case somebody really wants it.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@danieldk danieldk marked this pull request as draft October 24, 2024 15:31
Performance and accuracy of these kernels are on par (tested with Llama
70B and 405B). Removes a dependency and resolves some stability issues
we have been seeing.
@danieldk danieldk marked this pull request as ready for review October 25, 2024 10:12
@drbh drbh requested review from drbh and removed request for drbh October 25, 2024 14:02
Copy link
Collaborator

@drbh drbh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danieldk danieldk merged commit 0f346a3 into main Oct 25, 2024
10 of 12 checks passed
@danieldk danieldk deleted the feature/cc89-cutlass-w8a8 branch October 25, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants