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

Add support for compressed-tensors w8a8 int checkpoints #2745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danieldk
Copy link
Member

@danieldk danieldk commented Nov 14, 2024

What does this PR do?

This change adds a loader for w8a8 int checkpoints. One large benefit of int8 support is that the corresponding cutlass matmul kernels also work on compute capability 7.5.

Evaluation on neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a8:

Tasks Version Filter n-shot Metric Value Stderr
gsm8k_cot_llama 3 flexible-extract 8 exact_match 0.8431 ± 0.0100
strict-match 8 exact_match 0.8393 ± 0.0101
ifeval 4 none 0 inst_level_loose_acc 0.8597 ± N/A
none 0 inst_level_strict_acc 0.8201 ± N/A
none 0 prompt_level_loose_acc 0.7967 ± 0.0173
none 0 prompt_level_strict_acc 0.7468 ± 0.0187

Which is the same ballpark as vLLM.

Note: output of static input quantization with zero points (asymmetric) seems really bad. But it's hard to tell if it's a bug in this PR or just static input quantization just being bad in general (for the expected reasons). vLLM also doesn't give good output in this case, though it seems slightly better? (E.g. on nm-testing/asym-w8w8-int8-static-per-tensor-tiny-llama.)

As usual, lots of thanks to Neural Magic/vLLM for the kernels.

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.

This change adds a loader for w8a8 int checkpoints. One large benefit of
int8 support is that the corresponding cutlass matmul kernels also work on
compute capability 7.5.

Evaluation on neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w8a8:

|     Tasks     |Version|     Filter     |n-shot|        Metric         |   |Value |   |Stderr|
|---------------|------:|----------------|-----:|-----------------------|---|-----:|---|------|
|gsm8k_cot_llama|      3|flexible-extract|     8|exact_match            |↑  |0.8431|±  |0.0100|
|               |       |strict-match    |     8|exact_match            |↑  |0.8393|±  |0.0101|
|ifeval         |      4|none            |     0|inst_level_loose_acc   |↑  |0.8597|±  |   N/A|
|               |       |none            |     0|inst_level_strict_acc  |↑  |0.8201|±  |   N/A|
|               |       |none            |     0|prompt_level_loose_acc |↑  |0.7967|±  |0.0173|
|               |       |none            |     0|prompt_level_strict_acc|↑  |0.7468|±  |0.0187|

Which is the same ballpark as vLLM.

As usual, lots of thanks to Neural Magic/vLLM for the kernels.
@danieldk danieldk marked this pull request as ready for review November 14, 2024 14:51
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, great addition

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