inference
inference copied to clipboard
QUESTION: CUDA out of memory when running baichuan-2-7b on 4090
环境:
torch==2.0.1+cu117
xinference==0.4.4
启动 baichuan-2-chat-7b 模型时,占用GPU内存大概13G,但是调用服务后,就显存溢出了,如下图:
@chenmonster Hi,感谢对 xinference 的关注。
显存开销主要是由模型权重和 kv cache 两部分组成,kv cache 的大小和请求数量及生成文本长度正相关。
请问你在调用服务的时候,会有很大的负载吗?
就是使用 flowise 调用 xinference API服务,知识库文件就 17k 大小,不应该有这么大的内存开销吧?
首先,可以在 xinference 启动的时候,加上 --log-level debug,通过日志观察 flowise 具体发了哪些请求。
其次,从上图看,embedding 这一步也是在用 LLM 做,这个可能是导致 OOM 的关键。根据我们的经验,LLM 的 embedding 效果并不是很好,召回的文本与查询匹配度不是很高。因此推荐使用 xinference 内置的 embedding 模型来替代:https://inference.readthedocs.io/en/latest/models/builtin/index.html#embedding-models
启动 embedding 模型 bge-large-zh 报错
启动 embedding 模型 bge-large-zh 报错
好像是目前不支持在一张卡上同时启多个模型,不知道能否放宽限制,至少给同时启一个LLM和一个embedding @UranusSeven
@Minamiyama @chenmonster 下周五的 release 中会支持。
This issue is stale because it has been open for 7 days with no activity.
This issue was closed because it has been inactive for 5 days since being marked as stale.