使用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

相关推荐
爱吃橘子橙子柚子3 天前
3CPU性能排查总结(超详细)【Linux性能优化】
运维·cpu
舒一笑5 天前
程序员效率神器:一文掌握 tmux(服务器开发必备工具)
运维·后端·程序员
NineData5 天前
数据库管理工具NineData,一年进化成为数万+开发者的首选数据库工具?
运维·数据结构·数据库
梦想很大很大6 天前
拒绝“盲猜式”调优:在 Go Gin 项目中落地 OpenTelemetry 链路追踪
运维·后端·go
Sinclair6 天前
内网服务器离线安装 Nginx+PHP+MySQL 的方法
运维
叶落阁主6 天前
Tailscale 完全指南:从入门到私有 DERP 部署
运维·安全·远程工作
茶杯梦轩6 天前
从零起步学习RabbitMQ || 第二章:RabbitMQ 深入理解概念 Producer、Consumer、Exchange、Queue 与企业实战案例
服务器·后端·消息队列
甲鱼9297 天前
MySQL 实战手记:日志管理与主从复制搭建全指南
运维
YuMiao8 天前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
碳基沙盒9 天前
OpenClaw 多 Agent 配置实战指南
运维