1,演示視頻地址
https://www.bilibili.com/video/BV1Hu4y1L7BH/
使用autodl服務(wù)器,兩個3090顯卡上運行, Yi-34B-Chat-int4模型,用vllm優(yōu)化,增加 --num-gpu 2,速度23 words/s
2,使用3090顯卡 和使用A40 的方法一樣
https://blog.csdn.net/freewebsys/article/details/134698597
安裝軟件: 先安裝最新的torch版本
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 即可使用,兩個顯卡
# run_all_yi.sh
# 清除全部 fastchat 服務(wù)
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的 兼容服務(wù) 地址 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 本身已經(jīng)是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,效果,還是會有英文出現(xiàn)的BUG
6,同時啟動界面,方法本地開啟 6006 端口即可
只限制在內(nèi)蒙古機房,其他機房需要企業(yè)用戶?。?/strong>
在本地開啟 6006 端口即可:
但是模型沒有選擇出來,不知道咋回事,下次再研究。
7,總結(jié)
使用autodl服務(wù)器,兩個3090顯卡上運行, Yi-34B-Chat-int4模型,并使用vllm優(yōu)化加速,顯存占用42G,速度23 words/s。
隨著大模型的參數(shù)增加,企業(yè)用戶再使用的是特別需要大參數(shù)的模型了。
因為大模型在更加準確。硬件都不是問題。通過多卡的方式可以成功部署。
2張 3090,或者 4090 就可以部署 Yi-34B-Chat-int4模型了。
但是目前看中文稍微有點小問題,會返回英文,相信很快會迭代下一個版本了。
同時,已經(jīng)有獵戶星空Yi-34B-Chat,基于 yi-34b進行優(yōu)化了。馬上去研究下:文章來源:http://www.zghlxwxcb.cn/news/detail-766681.html
https://modelscope.cn/models/OrionStarAI/OrionStar-Yi-34B-Chat/summary文章來源地址http://www.zghlxwxcb.cn/news/detail-766681.html
到了這里,關(guān)于使用autodl服務(wù)器,兩個3090顯卡上運行, Yi-34B-Chat-int4模型,并使用vllm優(yōu)化加速,顯存占用42G,速度23 words/s的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!