lmdeploy icon indicating copy to clipboard operation
lmdeploy copied to clipboard

[Bug] qwen1.5-14b-chat使用turbomind进行推理,会出现输出重复的情况

Open qiuxuezhe123 opened this issue 1 year ago • 9 comments

Checklist

  • [ ] 1. I have searched related issues but cannot get the expected help.
  • [ ] 2. The bug has not been fixed in the latest version.

Describe the bug

[Bug] qwen1.5-14b-chat使用turbomind进行推理,会出现输出重复的情况 部署服务的命令:lmdeploy serve api_server qwen1half_14b_chat_awq_base --server-name 0.0.0.0 --server-port 8014 --tp 1

Reproduction

Environment

lmdeploy:0.4.0

Error traceback

No response

qiuxuezhe123 avatar May 21 '24 11:05 qiuxuezhe123

gpu型号是怎样的呢? 另外,qwen1half_14b_chat_awq_base 这个模型是怎么量化出来的呢?

lvhan028 avatar May 21 '24 14:05 lvhan028

gpu型号是怎样的呢? 另外,qwen1half_14b_chat_awq_base 这个模型是怎么量化出来的呢?

gpu型号:A800 量化方式:lmdeploy lite auto_awq model_name --calib-dataset 'c4' --calib-samples 128 --calib-seqlen 2048 --work-dir output_model

qiuxuezhe123 avatar May 22 '24 06:05 qiuxuezhe123

正常对话没复现,量化用的默认 dataset ptb,显卡 A100。

可以详细描述下使用方式吗?

AllentDan avatar May 22 '24 09:05 AllentDan

正常对话没复现,量化用的默认 dataset ptb,显卡 A100。

可以详细描述下使用方式吗?

使用方式如下: 用户搜索的query + 参考信息(比较长,是一系列文档内容的拼接)

预期模型输出的结果: 大模型基于参考信息,生成满足query的回答

我们这边排查的结论 对于qwen1.5-chat版本的模型,是模型转Turbomind这一步之后,造成大模型输出结果重复,和量化还是非量化没有关系。我尝试过不进行量化,只进行转Turbomind,转Turbomind后,使用上面的 “使用方式如下” 进行推理,会存在输出重复的问题。

qiuxuezhe123 avatar May 22 '24 09:05 qiuxuezhe123

可以试试 gen_config 参数 repetition_penalty 设置成 1.02

AllentDan avatar May 22 '24 09:05 AllentDan

prompt 比较长估计是有问题的。turbomind并没有实现 local attention 可以换用 pytorch engine 试试看

lvhan028 avatar May 22 '24 12:05 lvhan028

prompt 比较长估计是有问题的。turbomind并没有实现 local attention 可以换用 pytorch engine 试试看

请问使用pytorch engine的推理速度大概会比使用turbomind慢多少?

qiuxuezhe123 avatar May 22 '24 12:05 qiuxuezhe123

我们还没有在 qwen1.5-14b 上对比过。

lvhan028 avatar May 22 '24 12:05 lvhan028

你可以通过 profile_throughput.py 对比看看。 qwen1.5-14b是 MHA 结构,pytorch engine不会比turbomind慢很多,从我们之前的经验看,大约是30%的样子。

lvhan028 avatar May 22 '24 12:05 lvhan028