ztxz16 / fastllm

纯c++的全平台llm加速库,支持python调用,chatglm-6B级模型单卡可达10000+token / s,支持glm, llama, moss基座,手机端流畅运行
Apache License 2.0
3.28k stars 332 forks source link

chatglm2速度慢 #146

Open zoey-zy998 opened 1 year ago

zoey-zy998 commented 1 year ago

感谢提升了一倍的效率。但是时间还是太长了,用的机器是A10,24G现存,都是单线程先后4次请求,(开4个线程同时请求更慢)。 请问还有什么提升空间吗 chatglm2 base: 5743c2c08dec457bd46d7b37e452c109 fastllm test: b25b982100ae125bea7e3b61367e5f3f

zoey-zy998 commented 1 year ago

使用api请求 tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True) model = AutoModel.from_pretrained("chatglm2-6b", trust_remote_code=True).cuda()

# 加入下面这两行,将huggingface模型转换成fastllm模型
from fastllm_pytools import llm
model = llm.from_hf(model, tokenizer, dtype = "int4")
ztxz16 commented 1 year ago

int4模型之前没有多batch加速(现在会有一些),如果是float16模型多batch加速会比较强一点