Skip to content

Add support for compressed-tensors w8a8 int checkpoints #2745

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

Merged
merged 5 commits into from
Nov 18, 2024

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.

@danieldk danieldk marked this pull request as ready for review November 14, 2024 14:51
drbh
drbh previously approved these changes Nov 14, 2024
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

@danieldk danieldk marked this pull request as draft November 15, 2024 17:15
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 force-pushed the feature/compressed-tensors-w8a8-int branch from bdb6d0a to b2dc10a Compare November 18, 2024 10:10
@danieldk danieldk marked this pull request as ready for review November 18, 2024 13:02
drbh
drbh previously approved these changes Nov 18, 2024
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.

looks good to me! just added a nit for a typo

Co-authored-by: drbh <[email protected]>
@danieldk danieldk merged commit 3c9df21 into main Nov 18, 2024
10 of 12 checks passed
@danieldk danieldk deleted the feature/compressed-tensors-w8a8-int branch November 18, 2024 16:20
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