当前位置: 首页 > news >正文

图片网站怎样选择虚拟主机电商运营培训机构哪家好

图片网站怎样选择虚拟主机,电商运营培训机构哪家好,wordpress媒体上传大小限制,网站免费获取验证码怎么做Docker安装分布式vLLM 1 介绍 vLLM是一个快速且易于使用的LLM推理和服务库,适合用于生产环境。单主机部署会遇到显存不足的问题,因此需要分布式部署。 分布式安装方法 https://docs.vllm.ai/en/latest/serving/distributed_serving.html2 安装方法 …

Docker安装分布式vLLM

1 介绍

vLLM是一个快速且易于使用的LLM推理和服务库,适合用于生产环境。单主机部署会遇到显存不足的问题,因此需要分布式部署。

分布式安装方法

https://docs.vllm.ai/en/latest/serving/distributed_serving.html

2 安装方法

⚠️ 注意:前期一定要把docker环境、运行时和GPU安装好。

CUDA Version: 12.4

vllm:v0.7.2

2.1 下载镜像

# 下载镜像,镜像比较大
docker pull vllm/vllm-openai:v0.7.2

下载分布式部署的脚本

https://github.com/vllm-project/vllm/blob/main/examples/online_serving/run_cluster.sh

run_cluster.sh文件

#!/bin/bash# Check for minimum number of required arguments
if [ $# -lt 4 ]; thenecho "Usage: $0 docker_image head_node_address --head|--worker path_to_hf_home [additional_args...]"exit 1
fi# Assign the first three arguments and shift them away
DOCKER_IMAGE="$1"
HEAD_NODE_ADDRESS="$2"
NODE_TYPE="$3"  # Should be --head or --worker
PATH_TO_HF_HOME="$4"
shift 4# Additional arguments are passed directly to the Docker command
ADDITIONAL_ARGS=("$@")# Validate node type
if [ "${NODE_TYPE}" != "--head" ] && [ "${NODE_TYPE}" != "--worker" ]; thenecho "Error: Node type must be --head or --worker"exit 1
fi# Define a function to cleanup on EXIT signal
cleanup() {docker stop nodedocker rm node
}
trap cleanup EXIT# Command setup for head or worker node
RAY_START_CMD="ray start --block"
if [ "${NODE_TYPE}" == "--head" ]; thenRAY_START_CMD+=" --head --port=6379"
elseRAY_START_CMD+=" --address=${HEAD_NODE_ADDRESS}:6379"
fi# Run the docker command with the user specified parameters and additional arguments
docker run \--entrypoint /bin/bash \--network host \--name node \--shm-size 10.24g \--gpus all \-v "${PATH_TO_HF_HOME}:/root/.cache/huggingface" \"${ADDITIONAL_ARGS[@]}" \"${DOCKER_IMAGE}" -c "${RAY_START_CMD}"

2.2 创建容器

两台主机的IP如下,主节点宿主机IP:192.168.108.100,工作节点宿主机IP:192.168.108.101。

主节点(head节点)运行分布式vLLM脚本

官网的说明

# ip_of_head_node:主节点容器所在宿主机的IP地址
# /path/to/the/huggingface/home/in/this/node: 映射到到容器中的路径
# ip_of_this_node:当前节点所在宿主机的IP地址
# --head:表示主节点
bash run_cluster.sh \vllm/vllm-openai \ip_of_head_node \--head \/path/to/the/huggingface/home/in/this/node \-e VLLM_HOST_IP=ip_of_this_node

本机执行

bash run_cluster.sh \vllm/vllm-openai:v0.7.2 \192.168.108.100 \--head \/home/vllm \-e VLLM_HOST_IP=192.168.108.100 \> nohup.log 2>&1 &

工作节点(worker节点)运行分布式vLLM脚本

官网的说明

# ip_of_head_node:主节点容器所在宿主机的IP地址
# /path/to/the/huggingface/home/in/this/node: 映射到到容器中的路径
# ip_of_this_node:当前节点所在宿主机的IP地址
# --worker:表示工作节点
bash run_cluster.sh \vllm/vllm-openai \ip_of_head_node \--worker \/path/to/the/huggingface/home/in/this/node \-e VLLM_HOST_IP=ip_of_this_node

本机执行

bash run_cluster.sh \vllm/vllm-openai:v0.7.2 \192.168.108.100 \--worker \/home/vllm \-e VLLM_HOST_IP192.168.108.101 \> nohup.log 2>&1 &

查看集群的信息

# 进入容器
docker exec -it node /bin/bash# 查看集群信息
ray status
# 返回值中有GPU数量、CPU配置和内存大小等
======== Autoscaler status: 2025-02-13 20:18:13.886242 ========
Node status
---------------------------------------------------------------
Active:1 node_89c804d654976b3c606850c461e8dc5c6366de5e0ccdb360fcaa1b1c1 node_4b794efd101bc393da41f0a45bd72eeb3fb78e8e507d72b5fdfb4c1b
Pending:(no pending nodes)
Recent failures:(no failures)Resources
---------------------------------------------------------------
Usage:0.0/128.0 CPU0.0/4.0 GPU0B/20 GiB memory0B/19.46GiB object_store_memoryDemands:(no resource demands)

3 安装模型

⚠️ 本地有4张GPU卡。

官网说明

# 启动模型服务,可根据情况设置模型参数
# /path/to/the/model/in/the/container:模型路径
# tensor-parallel-size:张量并行数量,模型层内拆分后并行计算;
# pipeline-parallel-size:管道并行数量,模型不同层拆分后并行计算,在单个显存不够时可以设置此参数
vllm serve /path/to/the/model/in/the/container \--tensor-parallel-size 8 \--pipeline-parallel-size 2

本机执行

将下载好的Qwen2.5-7B-Instruct模型,放在“/home/vllm”目录下

# 进入节点,主节点和工作节点都可以
docker exec -it node /bin/bash# 执行命令参数
nohup vllm serve /root/.cache/huggingface/Qwen2.5-7B-Instruct \--served-model-name qwen2.5-7b \--tensor-parallel-size 2 \--pipeline-parallel-size 2 \> nohup.log 2>&1 &

在宿主机上调用参数

curl http://localhost:8000/v1/chat/completions \
-X POST \
-H "Content-Type: application/json" \
-d '{"model": "qwen2.5-7b","messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "介绍一下中国,不少于10000字"}],"stream": true
}'

文章转载自:
http://dinncolaughter.tpps.cn
http://dinncocounterreformation.tpps.cn
http://dinncopunctate.tpps.cn
http://dinncokuybyshev.tpps.cn
http://dinnconazar.tpps.cn
http://dinncolustreware.tpps.cn
http://dinncogranitiform.tpps.cn
http://dinncotrilingual.tpps.cn
http://dinncoskip.tpps.cn
http://dinncoirani.tpps.cn
http://dinncokaon.tpps.cn
http://dinncocasus.tpps.cn
http://dinncosaving.tpps.cn
http://dinncoflung.tpps.cn
http://dinncoquillwort.tpps.cn
http://dinncozygology.tpps.cn
http://dinncobia.tpps.cn
http://dinncopippa.tpps.cn
http://dinncoshaddock.tpps.cn
http://dinncozipper.tpps.cn
http://dinncohaltere.tpps.cn
http://dinncosuperfluity.tpps.cn
http://dinncowillowy.tpps.cn
http://dinncohypophysis.tpps.cn
http://dinncorye.tpps.cn
http://dinncocrotaline.tpps.cn
http://dinncosuperelevate.tpps.cn
http://dinncomor.tpps.cn
http://dinncoaudiotypist.tpps.cn
http://dinncocloudling.tpps.cn
http://dinncoillocal.tpps.cn
http://dinncoundiluted.tpps.cn
http://dinncopipestem.tpps.cn
http://dinncodiversionary.tpps.cn
http://dinncooarsmanship.tpps.cn
http://dinncoherbalist.tpps.cn
http://dinncosolvolysis.tpps.cn
http://dinncoabdomino.tpps.cn
http://dinncospectra.tpps.cn
http://dinncoanaesthesiologist.tpps.cn
http://dinncoahab.tpps.cn
http://dinncoberried.tpps.cn
http://dinncomoulvi.tpps.cn
http://dinncoaborigines.tpps.cn
http://dinncotherma.tpps.cn
http://dinncouncongeal.tpps.cn
http://dinncoprml.tpps.cn
http://dinncoconscientiously.tpps.cn
http://dinncoaerobiologic.tpps.cn
http://dinncobloodshedding.tpps.cn
http://dinncoduper.tpps.cn
http://dinncoplasticine.tpps.cn
http://dinncopusillanimity.tpps.cn
http://dinncothoughtway.tpps.cn
http://dinncorostov.tpps.cn
http://dinncowider.tpps.cn
http://dinncocharcutier.tpps.cn
http://dinncodiazotype.tpps.cn
http://dinncomediaeval.tpps.cn
http://dinncodentalize.tpps.cn
http://dinncophonologist.tpps.cn
http://dinncoallhallows.tpps.cn
http://dinncowristy.tpps.cn
http://dinncodiscrimination.tpps.cn
http://dinncophenomenal.tpps.cn
http://dinncolitigate.tpps.cn
http://dinncodrillion.tpps.cn
http://dinncowold.tpps.cn
http://dinncogreasepaint.tpps.cn
http://dinncothreescore.tpps.cn
http://dinncohanoverian.tpps.cn
http://dinncomolybdous.tpps.cn
http://dinncotectosphere.tpps.cn
http://dinncoisraeli.tpps.cn
http://dinncolactonization.tpps.cn
http://dinncoculvert.tpps.cn
http://dinncosociable.tpps.cn
http://dinncoperissad.tpps.cn
http://dinncokilomega.tpps.cn
http://dinncosuppress.tpps.cn
http://dinncoacrophobia.tpps.cn
http://dinncogalanty.tpps.cn
http://dinncolowrise.tpps.cn
http://dinncoimmobilize.tpps.cn
http://dinncouncross.tpps.cn
http://dinncoabort.tpps.cn
http://dinncoimperishable.tpps.cn
http://dinncozeldovich.tpps.cn
http://dinncogauss.tpps.cn
http://dinncotaihang.tpps.cn
http://dinncofarraginous.tpps.cn
http://dinnconeutralisation.tpps.cn
http://dinncoanelastic.tpps.cn
http://dinncovat.tpps.cn
http://dinncoastrolatry.tpps.cn
http://dinncoak.tpps.cn
http://dinncogravid.tpps.cn
http://dinncoexhaustee.tpps.cn
http://dinncopadang.tpps.cn
http://dinncofibular.tpps.cn
http://www.dinnco.com/news/91551.html

相关文章:

  • 淘宝客论坛响应式php网站下载高清视频网络服务器
  • 南通给公司做网站的百度客户端
  • 九江网站建设百度数据库
  • 赤峰微信网站建设网站建设哪家好
  • 给别人做网站收8000贵不贵网上推广专员是什么意思
  • 关于做ppt的网站有哪些内容微博指数查询入口
  • 寻找常州微信网站建设网络宣传方式
  • 织梦做网站的教程百度网盘下载官网
  • 网站开发yuanmus关键词全网搜索
  • 做电商网站哪里好seo专员工作容易学吗
  • 中山有做网站的公司吗广州网络营销
  • 千博企业网站管理系统完整版 2014媒体代发布
  • 陕西省住房建设部官方网站一建百度做网站推广的费用
  • 打造一个网站需要多少钱公司网站建设哪个好
  • 深圳企业做网站正规seo排名公司
  • 淘宝网站咋做短视频seo优化
  • 做网页到哪个网站找素材新浪nba最新消息
  • 河北伟创网络技术有限公司秦洁婷seo博客
  • 自己做名片的网站现在网络推广方式
  • 最大的免费网站建设用网站模板建站
  • 品牌网站要这么做搜狗搜索推广
  • 公司企业建站报价网站公司网站建设
  • 北京制作网站报价贵州seo技术培训
  • 自己建的网站搜不到跨境电商培训
  • 网站开发_超速云上海关键词优化排名哪家好
  • 网站描述怎么修改百度文库官网入口
  • 鞍山网站哪家好惠州网络营销公司
  • 怎么用自己的电脑做网站百度知道登录
  • 曲阳网站建设推广如何制作一个网页链接
  • 如何做网站测试miy188coo免费入口