Is 7B llama speed expected to be slow?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python, pytorch
- Lĩnh vực
- machine-learning, performance
Hướng nghiên cứu
Start with the supplied Python benchmark and compare the two model-loading and generation paths on the stated 2x RTX3060 setup. Check whether the reported token rates are reproducible and document whether the 7B quantized result is expected, including any identified performance difference or measurement issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello, thank you for opening source such a solid work! Feel free to add my wechat (hellozhongwei) for an offline chat!
I know that, in the paper, the inference speed in Figure 2 is measured only by the gate_proj linear operation speed for 70B LLaMA. The speed bar looks impressive although I assume de-quantization and re-scaling in the CUDA kernel has huge overheads.
My hypothesis is the speed is due to single-batch memory-bound slowdown? But if this is the case, the full model inference for single batch should be faster as well? I do not have enough hardware resources, so I tested the smaller LLaMA 7B checkpoint: ChenMnZ/Llama-2-7b-EfficientQAT-w2g64-BitBLAS. However, the 2bit BitBLAS version is only around 14.5 tokens / s, but the huggingface native fp16 is faster (20 tokens / s) even if the latter one is operating in model parallelism.
My question is whether this is expected. Because I think BitBLAS has applied efficient schedulers on CUDA code already, it should have higher inference speed as you have reported in Figure 2. But why?
Test devices: 2x RTX3060
Test code:
import time
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from transformers import TextStreamer
from gptqmodel import GPTQModel
# ref model
ref_model_path = "NousResearch/Llama-2-7b-hf"
tokenizer = AutoTokenizer.from_pretrained(ref_model_path)
model = AutoModelForCausalLM.from_pretrained(ref_model_path,
torch_dtype=torch.float16, device_map='auto', load_in_8bit=False)
streamer = TextStreamer(tokenizer)
start = time.time()
output = model.generate(
**tokenizer("Solar eclipse is ", return_tensors="pt").to(model.device),
max_new_tokens=256, streamer=streamer, use_cache=True
)
end = time.time()
output_len = output.shape[-1]
delta_time = end - start
print(output_len, delta_time, output_len / delta_time)
# 2-bit model in BitBLAS
model_path = "ChenMnZ/Llama-2-7b-EfficientQAT-w2g64-BitBLAS"
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=True)
model = GPTQModel.from_quantized(model_path)
streamer = TextStreamer(tokenizer)
start = time.time()
output = model.generate(
**tokenizer("Solar eclipse is ", return_tensors="pt").to(model.device),
max_new_tokens=256, streamer=streamer, use_cache=True
)
end = time.time()
output_len = output.shape[-1]
delta_time = end - start
print(output_len, delta_time, output_len / delta_time)
- Ngôn ngữ chính
- Python
- Star
- 351
- Fork
- 38
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenGVLab/EfficientQAT
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
OpenGVLab/EfficientQAT#31 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
OpenGVLab/EfficientQAT#34 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
OpenGVLab/EfficientQAT#33 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
OpenGVLab/EfficientQAT#32 ·
-
About Dataset Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
OpenGVLab/EfficientQAT#30 ·
Tất cả issue của OpenGVLab/EfficientQAT
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
modelscope/FunASR#3728 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-compass/opencompass#2655 ·