nano-vllm环境安装

nano-vllm简介

大模型基础

nano-vllm

云环境选择

优云智算 - 简单、可靠、高性价比的GPU云平台

镜像的选择非常重要,因为nano-vllm需要安装flash_attn。flash_attn需要特定的环境

flash_attn:flash_atten release包github下载

https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3.post1/flash_attn-2.8.3.post1+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl上述镜像刚好是

cuda12 torch2.4 cxx11 abi:false python3.10

安装必要依赖

1. apt 清华镜像源

替换/etc/apt/sources.list

bash 复制代码
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# 以下安全更新软件源为官方源配置
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

2. 安装系统依赖包

bash 复制代码
apt update && apt install -y git ninja-build build-essential zip unzip  pciutils

3.安装python包

bash 复制代码
pip install tqdm transformers xxhash nvitop

安装flash_atten

不要直接pip install,会编译很久,从github上找适合当前环境的包

https://github.com/Dao-AILab/flash-attention/releases?page=1#release-v2.8.3.post1

flash_attn-2.8.3.post1+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

下载模型

bash 复制代码
huggingface-cli download Qwen/Qwen2.5-0.5B-Instruct \
    --local-dir /root/huggingface/Qwen3-0.6B/ \
    --local-dir-use-symlinks False

跑nano-vllm example

bash 复制代码
git clone https://github.com/GeeeekExplorer/nano-vllm.git
cd nano-vllm
python exmaple.py
相关推荐
Soonyang Zhang18 小时前
vllm 分析(十一)——deepseek v4 kv cache layout
vllm
RobinDevNotes2 天前
K8s+Ray+vLLM打穿大模型全生命周期(有实践步骤)
人工智能·云原生·容器·kubernetes·生活·vllm
咖啡星人k3 天前
本地跑起 MiniMax H3:SGLang/vLLM/diffusers/ComfyUI 四种部署路线实测对比
vllm·sglang
咕噜咕噜啦啦3 天前
vLLM框架
人工智能·qwen·vllm
thesky1234564 天前
27届大模型面试准备(二十五):推理服务化与投机解码——vLLM、PagedAttention、Medusa 与连续批处理
大模型·vllm·eagle·pagedattention·medusa·推理服务化·投机解码
LitchiCheng6 天前
vllm运行在DGX Spark的启动参数及小问题
人工智能·python·vllm
HyperAI超神经6 天前
【vLLM 学习】Disaggregated Prefill
人工智能·深度学习·学习·vllm
初级炼丹师(爱说实话版)8 天前
Ubuntu24.04 Docker+vLLM+qianwen2.5-coder-32B部署文档
docker·容器·vllm
一个王同学9 天前
从零到一 | CV转多模态大模型 | week21 | 实战项目-DocuMind-VL:基于 OCR 与 Qwen-VL 的文档多模态问答系统(一)
人工智能·深度学习·计算机视觉·ocr·vllm
江畔柳前堤9 天前
YOLO 目标检测全流程深度剖析
人工智能·yolo·目标检测·计算机视觉·unity·面试·vllm