fastllm icon indicating copy to clipboard operation
fastllm copied to clipboard

量化后的模型如何选择GPU/CPU推理?

Open Alone749-i opened this issue 1 year ago • 1 comments

如标题,在测试时通过GPU和CPU加载模型转换为flm模型后,推理速度几乎一样。

Alone749-i avatar Jul 05 '23 07:07 Alone749-i

编译的时候得选择是否使用CUDA

JianbangZ avatar Jul 05 '23 13:07 JianbangZ

现在可以在创建模型前llm.set_device_map("cpu"),然后可以在cpu上运行(建议配合llm.set_cpu_thread()来设定cpu核数)

ztxz16 avatar Jul 26 '23 07:07 ztxz16