使用 RTX 2080 Ti 22GiB 部署 Qwen 3.6-27B 语言模型

Qwen 3.6-27B 是性能强劲、适合本地部署的语言模型。借助量化MTPTurboQuant 等技术,该模型可以在 RTX 2080 Ti 22GiB 上部署并流畅运行。

以下步骤在运行 CachyOS 最新版(使用 260426 ISO 安装)的电脑上测试通过。

安装依赖

sudo pacman -Syu cmake cuda nodejs npm
paru -S python-modelscope

必要时配置 npm 镜像:

npm config set registry https://mirrors.cloud.tencent.com/npm/
npm config set strict-ssl false

安装后建议重启或重新登录,以刷新环境变量。

编译 llama-cpp-turboquant

cd
git clone https://github.com/TheTom/llama-cpp-turboquant.git
# 下面三行用于编译 Web UI 前端
cd llama-cpp-turboquant/tools/ui
npm i
npm run build

cd ../..
cmake -B build -DGGML_CUDA=ON -DLLAMA_BUILD_WEBUI=ON && cmake --build build --config Release -j --target llama-server llama-cli

编译产物在 build/bin 目录下。

下载模型

modelscope download --model Tariel/Qwen3.6-27B-4bpw-MTP.gguf --local_dir ~/Qwen3.6

部署

cd ~/llama-cpp-turboquant/build/bin
./llama-server -m ~/Qwen3.6/Qwen3.6-27B-4bpw-MTP.gguf \
    -mm ~/Qwen3.6/mmproj-Qwen-Qwen3.6-27B-Q6_K.gguf \
    -fa on --spec-type draft-mtp --spec-draft-n-max 3 -np 1 -kvu \
    -c 190208 \
    -ngl all -ctk q8_0 -ctv turbo3 \
    --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 \
    --host 0.0.0.0 \
    --port 22345 \
    -a qwen3.6:27b

使用

此时用浏览器访问主机的 22345 端口(例如 http://127.0.0.1:22345)即可使用 llama.cpp Web UI。 注意如果在其他电脑访问部署了模型的主机,需要打开 CachyOS 自带的防火墙:

sudo ufw allow 22345

llama-server 兼容 OpenAIAnthropic 格式的 API,可以直接在常见的 AI 客户端软件中使用。

使用 Cherry Studio 时的注意事项

使用 Cherry Studio 时,为正确开关思考模式,建议选择“英伟达”为提供商,API 地址填写 llama-server 的地址(详见 Issue #14981)。

性能

性能测试的环境为:CPU i5-12500H (视频输出使用核显), GPU RTX 2080 Ti 22GiB, 内核 Linux 7.0.10-1-cachyos.

MTP 以少量的显存占用和略微降低预填充速度为代价,显著提高了模型的解码性能和总体性能。

输入上下文 token 数 输出上下文 token 数(无 MTP) 预填充时间/速度(无 MTP) 解码时间/速度(无 MTP) 总时间(无 MTP) 输出上下文 token 数(有 MTP) 预填充时间/速度(有 MTP) 解码时间/速度(有 MTP) 总时间(有 MTP)
30667 1666 52.9 s, 1.72 ms/token, 580.16 token/s 116.6 s, 70.02 ms/token, 14.28 token/s 169.5 s 1556 64.4 s, 2.10 ms/token, 476.14 token/s (speed -17.9%) 53.3 s, 34.22 ms/token, 29.22 token/s (speed +104.6%) 117.7 s
159283 1679 500.8 s, 3.14 ms/token, 318.04 token/s 381.4 s, 227.17 ms/token, 4.40 token/s 882.3 s 1337 579.6 s, 3.64 ms/token, 274.80 token/s (speed -13.6%) 87.4 s, 65.37 ms/token, 15.30 token/s (speed +247.7%) 667.0 s

使用 MTP、思考模式关闭时,不同任务类型的性能如下:

输入上下文长度 (token) 输出长度 (token) 显存占用 (MiB) 预填充速度 (token/s) 解码速度 (token/s) 任务类型
0 / 20270 / / /
41 1632 29296 158.78 41.15 解题
75 1260 20298 204.50 39.02 解题
15202 15422 20526 513.91 38.69 翻译
30667 1556 20538 476.14 29.22 长文本总结
53108 2058 20731 419.84 25.17 长文本总结
83743 1612 20954 364.67 20.50 长文本总结
106196 1486 21126 333.72 19.39 长文本总结
136828 1721 21370 296.02 16.11 长文本总结
159283 1337 21542 274.80 15.30 长文本总结
189915 293 21770 249.99 14.50 长文本总结(输出被截断)

思考模式打开时:

输入上下文长度 (token) 输出长度 (token) 显存占用 (MiB) 预填充速度 (token/s) 解码速度 (token/s) 任务类型
0 / 20270 / / /
39 7887 20344 131.31 38.94 解题
73 10436 20370 207.27 36.13 解题
15200 18345 20550 518.64 35.71 翻译
30665 3043 20550 478.33 28.10 长文本总结
53106 3150 20726 422.29 24.45 长文本总结
83741 3715 20970 364.77 21.54 长文本总结
106194 3330 21142 333.43 19.65 长文本总结
136826 3860 21386 297.03 16.79 长文本总结
159281 3039 21554 273.92 15.35 长文本总结
189913 294 21770 249.73 15.70 长文本总结(输出被截断)