使用autodl服务器,两个3090显卡上运行, Yi-34B-Chat-int4模型,并使用vllm优化加速,显存占用42G,速度23 words/s

1,演示视频地址

https://www.bilibili.com/video/BV1Hu4y1L7BH/

使用autodl服务器,两个3090显卡上运行, Yi-34B-Chat-int4模型,用vllm优化,增加 --num-gpu 2,速度23 words/s

2,使用3090显卡 和使用A40 的方法一样

https://blog.csdn.net/freewebsys/article/details/134698597

安装软件: 先安装最新的torch版本

bash 复制代码
apt update && apt install -y git-lfs net-tools
#
git clone https://www.modelscope.cn/01ai/Yi-34B-Chat-4bits.git


# 1,安装 torch 模块,防止依赖多次下载
pip3 install torch==2.1.0

# 2,安装 vllm 模块:
pip3 install vllm

# 最后安装 
pip3 install "fschat[model_worker,webui]" auto-gptq optimum

安装完成之后就可以使用fastchat启动了。

3,启动脚本增加 --num-gpus 2 即可使用,两个显卡

bash 复制代码
# run_all_yi.sh

# 清除全部 fastchat 服务
ps -ef | grep fastchat.serve | awk '{print$2}' | xargs kill -9
sleep 3

rm -f *.log

#IP_ADDR=`ifconfig -a | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1 `
# 首先启动 controller :
nohup python3 -m fastchat.serve.controller --host 0.0.0.0 --port 21001 > controller.log 2>&1 &

# 启动 openapi的 兼容服务 地址 8000
nohup python3 -m fastchat.serve.openai_api_server --controller-address http://127.0.0.1:21001 \
  --host 0.0.0.0 --port 8000 > api_server.log 2>&1 &
  
# 启动 web ui
nohup python -m fastchat.serve.gradio_web_server --controller-url http://127.0.0.1:21001 \
 --host 0.0.0.0 --port 6006 > web_server.log 2>&1 &

# 然后启动模型: 说明,必须是本地ip --load-8bit 本身已经是int4了
# nohup python3 -m fastchat.serve.model_worker  --model-names yi-34b \
#   --model-path ./Yi-34B-Chat-8bits --controller-address http://${IP_ADDR}:21001 \
#   --worker-address http://${IP_ADDR}:8080 --host 0.0.0.0 --port 8080 > model_worker.log 2>&1 &

## 
nohup python3 -m fastchat.serve.vllm_worker --num-gpus 2 --quantization awq --model-names yi-34b \
  --model-path ./Yi-34B-Chat-4bits --controller-address http://127.0.0.1:21001 \
  --worker-address http://127.0.0.1:8080 --host 0.0.0.0 --port 8080 > model_worker.log 2>&1 &

4,运行占用 gpu

5,效果,还是会有英文出现的BUG

6,同时启动界面,方法本地开启 6006 端口即可

只限制在内蒙古机房,其他机房需要企业用户!!

在本地开启 6006 端口即可:

但是模型没有选择出来,不知道咋回事,下次再研究。

7,总结

使用autodl服务器,两个3090显卡上运行, Yi-34B-Chat-int4模型,并使用vllm优化加速,显存占用42G,速度23 words/s。

随着大模型的参数增加,企业用户再使用的是特别需要大参数的模型了。

因为大模型在更加准确。硬件都不是问题。通过多卡的方式可以成功部署。

2张 3090,或者 4090 就可以部署 Yi-34B-Chat-int4模型了。

但是目前看中文稍微有点小问题,会返回英文,相信很快会迭代下一个版本了。

同时,已经有猎户星空Yi-34B-Chat,基于 yi-34b进行优化了。马上去研究下:

https://modelscope.cn/models/OrionStarAI/OrionStar-Yi-34B-Chat/summary

相关推荐
Flash.kkl19 小时前
Linux——进程信号
运维·服务器
苏宸啊20 小时前
Linux权限
linux·运维·服务器
Gofarlic_oms120 小时前
Windchill用户登录与模块访问失败问题排查与许可证诊断
大数据·运维·网络·数据库·人工智能
我是小疯子6621 小时前
Python变量赋值陷阱:浅拷贝VS深拷贝
java·服务器·数据库
xqhoj21 小时前
Linux——make、makefile
linux·运维·服务器
文亭湖畔程序猿21 小时前
Debian 12 日常命令 & nano 快捷键速查表
运维·debian
张童瑶21 小时前
Linux 在线安装编译Python3.11
linux·运维·python3.11
ziqibit21 小时前
debian Live with Persistence 持久化U盘的debian系统
运维·debian
Shi_haoliu21 小时前
SolidTime 在 Rocky Linux 9.5 上的完整部署流程
linux·运维·nginx·postgresql·vue·php·laravel
lifejump21 小时前
Pikachu | XXE
服务器·web安全·网络安全·安全性测试