Add torchao to optimum as a pytorch backend configuration #297
+28
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
att.
for now we just added int4 weight only quantization, using
TorchAoConfig
from https://huggingface.co/docs/transformers/main/en/quantization/torchaoTest Plan:
python examples/pytorch_llama.py
gpt2 model
Base:
prefill: 9486.25 decode: 83.75
AWQ:
prefill: 9496.02 decode: 83.62
GPTQ
prefill: 9814.27 decode: 97.31
torchao int4wo
prefill: 10007.93 decode: 84.66
llama2
Base:
prefill: 2275.32 decode: 18.92
AWQ:
prefill: 2344.19 decode: 18.21
GPTQ:
prefill: 2881.87 decode: 26.47
torchao int4wo
prefill: 3035.82 decode: 24.51
Reviewers:
Subscribers:
Tasks:
Tags: