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
相关推荐
GPUStack2 天前
怎么优雅地在GPUStack上使用minerU?
ai·大模型·llm·gpu·vllm·gpu集群·gpustack
薛定谔的猫19822 天前
LLaMA Factory微调中的模版在vLLM或LMDeploy框架部署中对齐
大模型·微调·vllm·模版·llama factory·lmdeploy·对话模板
时空无限3 天前
vllm 大模型启动缓存相关环境变量 export
linux·缓存·vllm
时空无限4 天前
vllm 缓存对模型启动时间的影响
缓存·vllm
谢白羽4 天前
vllm源码剖析14-vLLM 分布式推理-专家并行EP
笔记·分布式·llm·论文·vllm
GPUStack6 天前
Day 0 实测|在 GPUStack 上部署 Inkling-BF16:8 卡 H20-141G 推理性能测试
ai·大模型·llm·gpu·vllm·gpu集群·sglang·gpustack
华科大胡子6 天前
vLLM 与 SGLang 推理框架性能横评:架构、吞吐与延迟的深度较量
vllm
wen_zhufeng7 天前
vLLM-Omni TTS 推理加速实战手册
vllm
Yunzenn8 天前
强化学习1-Liu2026_GFlowRL_精读笔记
人工智能·笔记·深度学习·机器学习·transformer·集成学习·vllm