Skip to content
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

运行deepseek-r1-distill-32B-awq版本,使用vllm运行后,聊天经常断流 #2848

Open
1 of 3 tasks
kuntali opened this issue Feb 13, 2025 · 26 comments
Open
1 of 3 tasks
Labels
Milestone

Comments

@kuntali
Copy link

kuntali commented Feb 13, 2025

System Info / 系統信息

运行deepseek-r1-distill-qwen-32B-awq版本,使用vllm引擎加载运行后,聊天经常断流,输出到一半或者接近输出完的时候就不输出了。
导入的时自定义模型,对话模板选择deepseek-r1-distill-qwen,模型上下文长度位设置为8192,实际上下文长度不到2000就断流。
对话时设置的max_new_token=4k。
单独使用vllm启动模型无这种问题。xinference版本v1.2.2。

Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?

  • docker / docker
  • pip install / 通过 pip install 安装
  • installation from source / 从源码安装

Version info / 版本信息

v1.2.2

The command used to start Xinference / 用以启动 xinference 的命令

使用官方的docker一键启动命令

Reproduction / 复现过程

注册自定义模型:
1.导入的时自定义模型
2.对话模板选择deepseek-r1-distill-qwen
3.模型上下文长度位设置为8192
运行自定义模型:
1.选择模型deepseek-r1-distill-qwen
2.选择推理引擎vllm
3.选择格式awq
4.选择模型大小32
5.选择量化类型Int4
6.GPU选项auto
7.副本数1
8.填写额外的vllm参数:gpu-memory-utilization=1 max-model-len=110000

Expected behavior / 期待表现

应该不会断流才对,单独使用vllm启动模型对话无这种问题。

@XprobeBot XprobeBot added the gpu label Feb 13, 2025
@XprobeBot XprobeBot added this to the v1.x milestone Feb 13, 2025
@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

额外参数是下划线,gpu_memory_utilization=1

@kuntali
Copy link
Author

kuntali commented Feb 13, 2025

额外参数是下划线,gpu_memory_utilization=1

问题里面写错了,实际运行的时候是使用的下划线

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

感觉不太可能,stop reason 是啥?

@kuntali
Copy link
Author

kuntali commented Feb 13, 2025

通chrome浏览器F12查看SSE最后一个流式{"message":"close_stream"}

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

要看停止回答的原因是什么,是 stop 了还是 length。

@kuntali
Copy link
Author

kuntali commented Feb 13, 2025

在哪里可以看到呢

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

在哪里可以看到呢

看模型返回的内容,json 里会有 stop reason

@kuntali
Copy link
Author

kuntali commented Feb 13, 2025

Image

Image

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

图片看不清。结论是啥?

@kuntali
Copy link
Author

kuntali commented Feb 13, 2025

图片看不清。结论是啥?

Image

Image
不好意思,图片糊了。 第二张图片就是倒数第二条消息的内容,没输出完,但是感觉流却是正常结束。
我直接使用vllm server命令加载,只指定了端口参数,每次聊天都能输出完整信息。但是xinference加载几率很高。出现问题的对话上下文不到2000字

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

生成的 max_tokens 指定了吗?

@qinxuye
Copy link
Contributor

qinxuye commented Feb 13, 2025

目前 chat 默认 max_tokens 是 1024, 指定长。

@geyaandy
Copy link

geyaandy commented Feb 13, 2025

目前 chat 默认 max_tokens 是 1024, 指定长。

我也遇到了这个问题,stop reason 是length , 如果请求参数里不指定,默认是1024,这个max_tokens在哪个配置里修改呢, xinference launch启动命令里似乎没有关于max_tokens的参数

@gongyifeiisme
Copy link

目前 chat 默认 max_tokens 是 1024, 指定长。

我也遇到了这个问题,stop reason 是length , 如果请求参数里不指定,默认是1024,这个max_tokens在哪个配置里修改呢, xinference launch启动命令里似乎没有关于max_tokens的参数

VLLM 的后端参数 可以设置

@kuntali
Copy link
Author

kuntali commented Feb 14, 2025

通过xinference界面添加vllm额外参数max_tokens=8192,说不支持该参数

@gahoo
Copy link

gahoo commented Feb 14, 2025

I tested vLLM engine awq format 14B, 32B and Transformers engine pytorch format 32B 4bit and none quantization. Truncation issues seems affect all engine and all format deepseek-r1-distill model.

Meanwhile llama.cpp engine 32B Q4_K_M failed to load with this error:

llama_model_load: error loading model: error loading model vocabulary: unknown pre-tokenizer type: 'deepseek-r1-qwen'

@qinxuye
Copy link
Contributor

qinxuye commented Feb 14, 2025

通过xinference界面添加vllm额外参数max_tokens=8192,说不支持该参数

max_tokens 是 chat 的参数,不是加载的参数。我们看下是否默认调大 max_tokens。

@qinxuye
Copy link
Contributor

qinxuye commented Feb 14, 2025

I tested vLLM engine awq format 14B, 32B and Transformers engine pytorch format 32B 4bit and none quantization. Truncation issues seems affect all engine and all format deepseek-r1-distill model.

Meanwhile llama.cpp engine 32B Q4_K_M failed to load with this error:

llama_model_load: error loading model: error loading model vocabulary: unknown pre-tokenizer type: 'deepseek-r1-qwen'

For llama.cpp engine, please upgrade llama-cpp-python to v0.3.7

@averyyan
Copy link

通过xinference界面添加vllm额外参数max_tokens=8192,说不支持该参数

max_tokens 是 chat 的参数,不是加载的参数。我们看下是否默认调大 max_tokens。

使用了max_tokens 参数无效

@qinxuye
Copy link
Contributor

qinxuye commented Mar 17, 2025

怎么写的?

@averyyan
Copy link

怎么写的?

应该是openai-go库的问题,我使用curl 测试了是可以的,我找找看是哪里有问题

@qinxuye
Copy link
Contributor

qinxuye commented Mar 17, 2025

怎么写的?

应该是openai-go库的问题,我使用curl 测试了是可以的,我找找看是哪里有问题

有个已知的问题,openai 现在把 max_tokens 改叫 max_completion_tokens 了。有可能新版已经改成了这个参数。

@averyyan
Copy link

怎么写的?

应该是openai-go库的问题,我使用curl 测试了是可以的,我找找看是哪里有问题

有个已知的问题,openai 现在把 max_tokens 改叫 max_completion_tokens 了。有可能新版已经改成了这个参数。

我检查出来了,是有一个chuck 是ping,在openai-go中无法解析

@qinxuye
Copy link
Contributor

qinxuye commented Mar 17, 2025

chunk 什么内容?

@averyyan
Copy link

chunk 什么内容?

ping- <时间字符串>

@qinxuye
Copy link
Contributor

qinxuye commented Mar 17, 2025

嗯?为啥有这个chunk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants