惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
博客园 - 司徒正美
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
Jina AI
Jina AI
GbyAI
GbyAI
Y
Y Combinator Blog
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
雷峰网
雷峰网
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
S
Secure Thoughts
博客园 - 三生石上(FineUI控件)
Cyberwarzone
Cyberwarzone
NISL@THU
NISL@THU
J
Java Code Geeks
C
Cisco Blogs
人人都是产品经理
人人都是产品经理
Webroot Blog
Webroot Blog
腾讯CDC
博客园 - 叶小钗
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Troy Hunt's Blog
AI
AI
L
LangChain Blog
Know Your Adversary
Know Your Adversary
T
Tenable Blog
M
MIT News - Artificial intelligence
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 最新话题
Hugging Face - Blog
Hugging Face - Blog
F
Full Disclosure
P
Proofpoint News Feed
AWS News Blog
AWS News Blog
有赞技术团队
有赞技术团队
A
Arctic Wolf
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
W
WeLiveSecurity
The Cloudflare Blog

博客园 - yi-sheng

国产曦云C500双卡vllm框架本地部署qwen3.6-35B模型 国产曦云C500驱动安装 国产曦云C500双卡本地部署qwen3.6-35B模型 NVIDIA GeForce RTX 3080 魔改20G 运行大模型 FusionXpark_GB10救砖教程 ARM 架构NVIDIA GB10 Grace Blackwell环境中部署 Qwen3.6-35B 推理服务 Rufus的4.4制作ubuntu-24.04.4安装U盘 常用办公终端NEC 莱斯双盘位桌面存储阵列2代-LaCie 2big v2设置RAID1 常用办公终端配置信息 H3C LinSeer MegaCube灵犀MegaCube工作站使用笔记 4090多卡使用sglang推理框架docker布署qwen3.6-35B 国产曦云C500双卡本地部署qwen3.5-35B模型 国产GPU沐曦GPU系统曦云C500体验笔记 ARM 架构NVIDIA GB10 Grace Blackwell 芯片环境下安装conda FusionXpark GB10盒子开箱笔记 Python 3.11.6 + Oracle 11g​开发环境配置 MCP开发技巧:静态参数作为行为提醒(Reminder Pattern) Teachable Machine安装 Qwen2.5-1.5B + LoRA 单张显卡 微调实战 Qwen2.5-1.5B + LoRA 微调实战 大模型基建实战:使用序列猴子数据集定制 BPE Tokenizer 老年小龙虾soul.md示例 低幻觉医疗大模型Baichuan-M2-32B本地部署笔记 小龙虾本地算力RTX 4090 (24G) 四卡本地SGLang框架跑qwen3.5-35B模型 MCP工具粒度的权衡 DELL XPS 13-7390 重装系统方法 搭建私有 Matrix 聊天服务器 OpenClaw小龙虾软件原理解析 OpenClaw 飞书平台配置指南 MacBook Air A1534 系统安装指南:从 macOS 到 Windows
小龙虾本地算力 RTX 4090 (24G) 四卡本地运行 Qwen2.5-27B​ 模型
yi-sheng · 2026-03-13 · via 博客园 - yi-sheng

1. 显卡驱动和CUDA验证

# 验证NVIDIA驱动状态
nvidia-smi

# 实时监控GPU使用情况(新开终端执行)
watch -n 1 nvidia-smi

# 验证CUDA安装
nvcc -V

2. Conda环境管理

# 验证Conda版本
conda --version

# 列出所有已创建的Conda环境
conda env list
# 或
conda info --envs

3. PyTorch安装

根据CUDA版本安装对应的PyTorch:

# CUDA 12.1
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

# CUDA 12.2  
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu122

模型下载与部署

# 使用ModelScope下载模型前,先安装modelscope
pip install modelscope


#下载模型   #若不指定--local_dir,则默认下载到/home/admin1/.cache/modelscope/hub/models/

modelscope download --model Qwen/Qwen3.5-27B --local_dir /mnt/raid1/modelscope/qwen27b_202603

2. 安装vLLM并启动API服务

#依赖库安装 vllm

pip install vllm -i https://mirrors.aliyun.com/pypi/simple/

 #验证vllm库是否安装成功

python3 -c "import vllm; print('vllm导入成功,版本:', vllm.__version__)"

运行(  测试可以正常运行,但小龙虾测试时上下文长度偏小

CUDA_VISIBLE_DEVICES=4,5,6,7 vllm serve /mnt/raid1/modelscope/qwen27b_202603 \
  --port 8600 \
  --tensor-parallel-size 4 \
  --max-model-len 16384 \          # 平衡上下文长度和显存使用
  --max-num-seqs 32 \
  --max-num-batched-tokens 24576 \
  --gpu-memory-utilization 0.85 \
  --block-size 16 \               # 优化KV Cache内存分配
  --swap-space 4 \                # 启用4GB虚拟显存作为交换空间
  --served-model-name qwen27b \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder

 测试

curl -X POST "http://127.0.0.1:8600/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen27b",
"messages": [{"role": "user", "content": "介绍下杭州"}]
}'

杀进程

 后台执行

# 1. 后台启动模型服务
nohup bash run_qwen27b_202603.sh > qwen27b.log 2>&1 &

# 2. 实时监控日志(新开一个终端窗口)
tail -f qwen27b.log

后续优化

进一步增加上下文长度(max-model-len

CUDA_VISIBLE_DEVICES=4,5,6,7 vllm serve /mnt/raid1/modelscope/qwen27b_202603 \
  --port 8600 \
  --tensor-parallel-size 4 \
  --max-model-len 32768 \          # 尝试提升至 32K
  --max-num-seqs 32 \
  --max-num-batched-tokens 24576 \
  --gpu-memory-utilization 0.8 \   # 预留更多显存给长序列
  --block-size 32 \                # 优化长序列内存管理
  --swap-space 16 \                 # 增大交换空间
  --enable-chunked-prefill \       # 启用分块预填充(关键!)
  --served-model-name qwen27b \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder