抖音:8G显存跑9B几百T/s

原始方案

.\llama-server.exe
--model Qwen3.5-9B-UD-Q4_K_XL.gguf    # 模型名称(GGUF格式)
--mmproj mmproj-F16-9B.gguf           # 多模态视觉投影文件,让Qwen能“看图”
--alias "unsloth/Qwen3.5-9B-GGUF"     # 客户端API链接模型时,显示的名称
--ctx-size 65536                      # 设置64k上下文,支持更长文本处理
--temp 0.7                            # 创造力调节器,控制生成随机性
--top-p 0.8                           # 核心采样参数,控制多样性
--top-k 20                            # 核心采样参数,限制候选词数量
--min-p 0.00                          # 核心采样参数,过滤低概率词
--port 8880                           # 暴露服务端口,可自定义
--n-gpu-layers 99                     # 将99层模型层(本模型约48层)全部加载到GPU
--flash-attn auto                     # 自动启用Flash Attention,显存效率更高、文本更长
--reasoning off                       # 关闭思考模式(可选)
--cache-type-k q4_0                   # 开启缓存量化(K缓存,Q4_0精度)
--cache-type-v q4_0                   # 开启缓存量化(V缓存,Q4_0精度)
--batch-size 4096                     # 增加吞吐量,默认2048
--ubatch-size 1024                    # 增加吞吐量,默认512

测试 - 抖音版

---------------------- mobax cmd-------------------------
D:\softWin\ProgramFiles_AI\llama\cuda\llama-bench.exe ^
  -m D:\OS\gguf\Qwen3.5-9B-Claude-4.6-Opus-Deckard-V4.2-Uncensored-Heretic-Thinking.i1-Q4_K_M.gguf ^
  -p 512 -n 128 ^
  -ngl 99 ^
  -fa 1 ^
  -ctk q4_0 -ctv q4_0 ^
  -b 4096 -ub 1024
  
----------------------------------------------------------
ggml_cuda_init: found 1 CUDA devices (Total VRAM: 8187 MiB):
  Device 0: NVIDIA GeForce RTX 4060, compute capability 8.9, VMM: yes, VRAM: 8187 MiB
| model                          |       size |     params | backend    | ngl | n_batch | n_ubatch | type_k |
type_v | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -------: | -----: |
-----: | -: | --------------: | -------------------: |
| qwen35 9B Q4_K - Medium        |   5.23 GiB |     8.95 B | CUDA       |  99 |    4096 |     1024 |   q4_0 |
  q4_0 |  1 |           pp512 |      2011.09 ± 21.36 |
| qwen35 9B Q4_K - Medium        |   5.23 GiB |     8.95 B | CUDA       |  99 |    4096 |     1024 |   q4_0 |
  q4_0 |  1 |           tg128 |         42.43 ± 0.15 |

build: 5d2b52d80 (8911)

测试 - 在用版

---------------------- mobax cmd-------------------------
D:\softWin\ProgramFiles_AI\llama\cuda\llama-bench.exe --model "D:\OS\gguf\Qwen3.5-9B-Claude-4.6-Opus-Deckard-V4.2-Uncensored-Heretic-Thinking.i1-Q4_K_M.gguf" --n-gpu-layers 0,32 --batch-size 512,1024,2048 --ubatch-size 512 --threads 4,12 --n-prompt 512,1024,20480 --n-gen 128 --cache-type-k q4_0 --cache-type-v q4_0
----------------------------------------------------------