Comments (4)
How did you measure performance? This is much lower than my own benchmarks which you can see in the README.
from autoawq.
Hey @casper-hansen for these metrics I took a shortcut and ran them using text-generation-webui.
If I can find the time today I'll make a second attempt using a plain python script.
from autoawq.
You should try the benchmark script that I included in examples. GEMV achieves 90% of ExLlamaV2 speed and GEMM achieves 70%.
Also do note that AutoAWQ is a more broad framework. We aim for high speed but make compromises that does ExLlama does not.
from autoawq.
I cobbled together a version of the script to gauge performance and you're absolutely right, the implementation in text-generation-webui is slowing things down.
I can confirm that for the first run AutoAWQ approaches 90% of ExLlamaV2 performance at least for TheBloke/Llama-2-7b-Chat-AWQ.
What interesting is that the inference performance goes down for every run. This was run against the standard 0.1.0 version so it errored out after the last run shown.
(textgen) alansrobotlab@goliath:~/Documents/brayden/langchain$ python testawq.py
Fetching 13 files: 100%|██████████████████████████████████████████████████████████████████| 13/13 [00:00<00:00, 226248.76it/s]
Replacing layers...: 100%|████████████████████████████████████████████████████████████████████| 32/32 [00:01<00:00, 20.25it/s]
Tokens per second: 120.23952638403186
Tokens per second: 112.92177108754163
Tokens per second: 103.59184799892934
Tokens per second: 95.48121527004926
Tokens per second: 99.72065805469065
Tokens per second: 98.25381852653379
Tokens per second: 94.36816405132929
Tokens per second: 90.7243856285012
Tokens per second: 88.71160320470709
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
import time
#model_name_or_path = "TheBloke/CodeLlama-34B-AWQ"
model_name_or_path = "TheBloke/Llama-2-7b-Chat-AWQ"
#model_name_or_path = "casperhansen/vicuna-7b-v1.5-awq"
# Load model
model = AutoAWQForCausalLM.from_quantized(
model_name_or_path,
#"awq_model_w4_g128.pt",
fuse_layers=True,
trust_remote_code=False,
safetensors=True,
max_new_tokens=4096,
)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
tokens = tokenizer(
"# What are all fo the different quarks in nuclear physics and when and where were they discovered?\n\n", return_tensors=>
).to("cuda")
# Generate output
for _ in range(10):
start = time.time()
generation_output = model.generate(
**tokens,
do_sample=True,
temperature=0.2,
top_p=0.95,
top_k=0,
max_new_tokens=512,
)
elapsed = time.time() - start
count = len(generation_output[0])
#print("Elapsed: ",elapsed)
#print("Tokens: ",count)
print("Tokens per second: ",(count/elapsed))
#print(tokenizer.decode(generation_output[0], skip_special_tokens=True))
from autoawq.
Related Issues (20)
- when quantize qwen2 by autoawq, it not works successful. HOT 2
- Support Qwen2-57B-A14B?
- awqint4 to gguf ,ModuleNotFoundError: No module named 'awq.apply_awq' HOT 5
- Is there an example on how to quantize with multiple GPUs? Is it possible to quantize Llama 3 70B with 2x3090 24GB?
- I wanted to add a pull request, but it was closed immediately, prompting that the base branch is protected. HOT 2
- ConnectionError: Couldn't reach 'mit-han-lab/pile-val-backup' on the Hub (ConnectTimeout) HOT 11
- [Performance degrade]phi-3-medium-128k-instruct after awq quantized, then output repetitively HOT 2
- Support Qwen2 72 Awq quantization? HOT 2
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:7 and cuda:0! (when checking argument for argument index in method wrapper_CUDA__index_select)
- Unable to install with `poetry`
- Is it possible to quantize MoE models?
- Multi-GPU quantization randomly loads all host GPUs HOT 1
- Same AWQ model behaves differently on two similar machines
- deepseek-coder-v2-instruction-awq HOT 8
- Version on PyPi doesn't support Python 3.12 HOT 1
- Performance with PyTorch 2.3.x HOT 4
- Calibration Dataset: how to avoid computing loss on instructions?
- I encountered the following problem during the KL assessment
- Lora Adapters Support
- Gemma2 Support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoawq.