InternLM / Tutorial

LLM Tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问lmdeploy如何在多卡部署

ChingKwanCheung opened this issue · comments

输入命令lmdeploy serve api_server后,默认是在单卡(0号卡)上部署,请问怎么实现在多卡上部署?

  1. CUDA_VISIBLE_DEVICES=0,2 使用前缀或者环境变量指定可以使用的卡
  2. 对于命令lmdeploy serve api_server 来说 可以--help查看使用说明,其中 --tp 2表示用2卡部署

因而多卡部署可以结合1,2,如
CUDA_VISIBLE_DEVICES=0,2 lmdeploy serve api_server $model_path --tp 2 表示使用0卡和2卡进行2卡部署

具体也可见 https://github.com/InternLM/lmdeploy/blob/main/docs/zh_cn/serving/api_server.md