跳转至内容
  • 版块
  • 最新
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 浅色
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • 深色
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
品牌标识

抡锤者

L

laobenxiong

@laobenxiong
德高望重 劳动模范
取消关注 关注
关于
帖子
57
主题
3
分享
0
群组
2
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • llama.cpp+qwen3.6-27b 初步测试
    L laobenxiong

    回复: [下单 7900xtx](开始折腾 llama.cpp)

    周末简单试了一下. 主要目标达成, 就是能够在 vram 中完整跑 qwen3.6-27b 且能够使用 256k 上下文 和 multimodal 功能.

    • 模型: unsloth/Qwen3.6-27B-MTP-GGUF/Qwen3.6-27B-Q4_K_M.gguf + mmproj-BF16.gguf
    • Branch: ggml-org/llama.cpp (upstream master, latest)
    • Backend: Vulkan (Mesa RADV)
    • 编译配置:
    cmake -S . -B build-vulkan \
        -DGGML_VULKAN=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_C_FLAGS="-fPIC -mcmodel=large -mavx2 -mfma -mf16c" \
        -DCMAKE_CXX_FLAGS="-fPIC -mcmodel=large -mavx2 -mfma -mf16c"
    
    • llama-server 命令行:
    bruin@lmde7:~/github/llama.cpp$ cat run-qwen3-vulkan.sh
    #!/bin/bash
    
    export LD_LIBRARY_PATH=$(pwd)/build-vulkan/src:$(pwd)/build-vulkan/ggml/src:$LD_LIBRARY_PATH ;
    ./build-vulkan/bin/llama-server \
      -m /opt/gguf-models/unsloth/Qwen3.6-27B-MTP-GGUF/Qwen3.6-27B-Q4_K_M.gguf \
      --mmproj /opt/gguf-models/unsloth/Qwen3.6-27B-MTP-GGUF/mmproj-BF16.gguf \
      --spec-type draft-mtp \
      -c 262144 \
      -np 1 \
      -fa on \
      -ngl 999 \
      -ctk q4_0 -ctv q4_0 \
      --cont-batching --jinja --mlock \
      --host 0.0.0.0 --port 8000
    
    • vram 使用对比

    可忽略ik_llama.cpp这一列, upstream 这一列好像也不太准, 因为从 nvtop 看 vram 的 headroom 已经很小了, 但确实全部都进了 vram.

    Component ik_llama.cpp (IQ4_KS) Upstream (Q4_K_M + MTP)
    Model weights 13,003 MiB 15,850 MiB
    MTP heads (1 extra layer) — ~260 MiB
    mmproj (multimodal projector) — 1,161 MiB
    KV cache q4_0 256K 4,758 MiB 4,758 MiB
    Compute buffer 505 MiB ~505 MiB
    Total GPU ~18,266 MiB ~22,534 MiB
    Available 23,984 MiB 23,984 MiB
    Margin 5,718 MiB 1,450 MiB ✅
    • llama-benchy的初步结果:
    Depth pp2048 (tok/s) tg128 (tok/s) ttfr
    0 (empty) 541 76 🏆 3.8s
    65,536 353 45 191s
    131,072 257 31 519s
    250,000 170 26 1480s (~25 min)
    262,144 N/A (corpus too small) — —
    • 功率测量和电费估算:
    State Power Per day (24h) Per month (30d) Per year (365d)
    Idle ~20W 0.48 kWh = 0.24 RMB 14.4 kWh = 7.2 RMB 175.2 kWh = 87.6 RMB
    Full load (100%) ~400W 9.6 kWh = 4.8 RMB 288 kWh = 144 RMB 3504 kWh = 1,752 RMB
    Typical use (3h full + 21h idle) ~67W avg 1.62 kWh = 0.81 RMB 48.6 kWh = 24.3 RMB 591.3 kWh = 295.7 RMB
    • 问题记录:
      • ik_llama.cpp 编译出来, gpu的利用率只能到 50%, 原因不明. 放弃, 回到 upstream llama.cpp.
      • 主线 llama.cpp 上, 使用 rocm 的后端好像性能差~20%左右. 目前直接放弃;
      • 让 Hermes 使用图片好像还有问题. 用自带的网页端是可以上传并识别图片的.
    LLM讨论区 amd 7900xtx

  • 我来简单一次说清楚Resizeable BAR吧
    L laobenxiong

    添加一点自己对背景知识的理解: 系统启动是先 进 BIOS 然后 到 OS. 以 linux kernel 为例, BIOS 向 kernel 汇报有哪些硬件有两个机制, 一个是 ACPI (一般是UEFI BIOS), 一个是 DTS (一般是 u-boot). 一般的 PC 机都是 UEFI/ACPI, 因为Windows只支持 UEFI, 不支持 DTS; 而各种 SBC (树莓派, arm软路由等) 就是 u-boot/dts, 针对特定硬件,不需要投入财力/人力开发或购买UEFI BIOS. ACPI和DTS在PCIe总线设备扫描的区别是, ACPI下是BIOS扫好了PCIe总线下面的所有设备(并配置了BAR空间)以后告诉 OS, OS直接用(加载驱动等); DTS是仅仅配置PCIe 根(RP)的信息, 让 OS 自己去扫描 PCIe 总线并配置各个设备 (EP). 这解释了为什么 Above 4G Decoding 和 Resizable Bar 需要 UEFI BIOS 的支持. btw, Resizable Bar 同时也需要EP设备(GPU)的支持, 不过这一般都是有的.

    AI硬件 resizeablebar x99 bios

  • 下单 7900xtx, 开始折腾 llama.cpp
    L laobenxiong

    @rock-shi 嗯嗯, 不过7900xtx的一个优点是噪音小. 这一点虽然老特在视频里面说过, 实际使用还是给我惊喜.

    AI硬件 amd 7900xtx

  • 技嘉Z890主板 256G DDR5内存 两张Pro6000 96G 跑cpp Qwen3.6 27B BF16与同时双ComfyUI工作流长视频之运行
    L laobenxiong

    @566656661 问了下 whichllm, 它也推荐 qwen3.6-27b, 这个模型真能打呀f0be4eec-bf18-4921-af94-ab32c043232f-image.jpeg

    AI硬件 comfyui

  • 大模型16G卡的春天
    L laobenxiong

    接入 Hermes

    Hermes 支持任意 OpenAI 兼容 API 端点。以下通过交互式命令添加本机 llama-server:

    $ hermes model
    
      Current model:    deepseek-v4-flash
      Active provider:  DeepSeek
    
    
    Custom OpenAI-compatible endpoint configuration:
    
    API base URL [e.g. https://api.example.com/v1]: http://192.168.5.84:8000/v1
    API key [optional]:
    Verified endpoint via http://192.168.5.84:8000/v1/models (1 model(s) visible)
    
    Select API compatibility mode:
      1. Auto-detect [current]
      2. Chat Completions
      3. Responses / Codex
      4. Anthropic Messages
    Choice [1-4, Enter to keep current/detected]:
      API mode: auto-detect
      Detected model: ./models/qwen3.6/Qwen3.6-27B-GGUF-4.262bpw-imatrix.gguf
      Use this model? [Y/n]:
    Context length in tokens [leave blank for auto-detect]: 65536
    Display name [192.168.5.84:8000]:
    Default model set to: ./models/qwen3.6/Qwen3.6-27B-GGUF-4.262bpw-imatrix.gguf (via http://192.168.5.84:8000/v1)
      💾 Saved to custom providers as "192.168.5.84:8000" (edit in config.yaml)
    

    配置要点:

    • Base URL:http://<llama-server IP>:8000/v1,注意路径必须以 /v1 结尾
    • API Key:留空,本地 llama-server 不需要
    • API Mode:选择 Auto-detect 即可(或 Chat Completions)
    • Context Length:手动填入 65536(与 -c 参数一致)
    • 启动参数需保留 --jinja:否则 Hermes 发来的 tools 参数会被忽略,工具调用功能失效

    上下文压缩配置

    Hermes 默认会在上下文占用达到阈值后自动压缩历史消息,避免超 context 窗口。以下是 Hermes 查询当前配置的对话:

    ────────────────────────────────────────
    ● the context window compact/compression
      threshold for the current model you are using
    ────────────────────────────────────────
    
    ╭─ ⚕ Hermes ───────────────────────────────────────────╮
        Here's what's configured for your session:
    
        compression:
          enabled: true
          threshold: 0.8
          target_ratio: 0.2
          protect_last_n: 20
          hygiene_hard_message_limit: 400
    
        How it works:
        - threshold: 0.8 — 当上下文占用达到 80% 时触发压缩
        - target_ratio: 0.2 — 压缩后上下文裁剪至原大小的 ~20%
        - protect_last_n: 20 — 保护最近 20 条消息不被压缩
        - hygiene_hard_message_limit: 400 — 消息数达 400
          条时强制重置,防止上下文退化
    ╰──────────────────────────────────────────────────────╯
    

    对应 ~/.hermes/config.yaml:

    compression:
      enabled: true
      threshold: 0.8
      target_ratio: 0.2
      protect_last_n: 20
      hygiene_hard_message_limit: 400
    

    辅助模型(Aux Model)配置

    辅助模型是 Hermes 专用于后台任务(上下文压缩、标题生成、视觉分析、session search)的独立模型,
    不占用主模型算力。默认 auto 会回退到主模型(Qwen3.6-27B),对 27B 来说浪费且慢。
    以下是将 aux 改为 DeepSeek 云端模型的对话:

    ────────────────────────────────────────
    ● ok, i am not aware of the concept of
      "aux model". what the aux model for?
    ────────────────────────────────────────
    
    ╭─ ⚕ Hermes ───────────────────────────────────────────╮
        An auxiliary (aux) model is a separate, usually
        cheaper and faster model that Hermes uses for
        background tasks:
    
        1. Context compression — 当上下文达 80%,Hermes
           需压缩历史消息。不用主模型做(浪费且慢)
        2. Vision tasks — 图片/浏览器视觉分析
        3. Session search — 搜索和排序过去对话
    
        Your current setup:
          compression:
            provider: auto
            model: ''
    
        auto 会尝试找 OPENROUTER_API_KEY 或 GOOGLE_API_KEY,
        没有则回退到主模型 Qwen3.6-27B
    ╰──────────────────────────────────────────────────────╯
    
    ────────────────────────────────────────
    ● i see. please set the aux model to be
      deepseek-v4-flash
    ────────────────────────────────────────
    
    ╭─ ⚕ Hermes ───────────────────────────────────────────╮
        Done. The auxiliary compression model is now set to:
    
        auxiliary.compression:
          provider: deepseek
          model: deepseek-v3-flash
    
        This will take effect the next time compression
        triggers (when your context hits 80%).
    ╰──────────────────────────────────────────────────────╯
    

    等效指令:

    hermes config set auxiliary.compression.provider deepseek
    hermes config set auxiliary.compression.model deepseek-v3-flash
    

    配置后上下文压缩和标题生成都走云端 flash 模型(瞬间返回,不阻塞对话),本地 27B 模型专注推理。

    验证:Hermes + llama-server 联调成功

    以下是 Hermes 接入 Qwen3.6-27B 后的对话,确认模型、agent 和工具链协同正常。

    ● btw, who are you? the model, the agent (hermes), or the combined?
    ────────────────────────────────────────
    
    ╭─ ⚕ Hermes ─────────────────────────────────────────╮
        I'm the combination of both — but it's worth being
        precise about what each part is:
    
        The model (Qwen3.6-27B) is just a pattern-matching
        engine. It's a 27-billion-parameter neural network
        that predicts the next token. By itself, it has no
        memory, no tools, and no persistent identity. It
        doesn't know what Hermes is.
    
        Hermes is the framework — the agent loop, the tools,
        the memory system, the session management, the skills,
        the config. It's the scaffolding that gives the model
        capabilities it wouldn't have on its own. But Hermes
        has no intelligence of its own — it's just code that
        routes prompts and parses responses.
    
        What you're talking to is the emergent result of
        putting them together: the model running inside Hermes'
        agent loop, with access to tools, persistent memory,
        skills, and session history. The model provides the
        reasoning, Hermes provides the body and long-term memory.
    
        If I had to put a name to it, I'd say I'm an instance
        of Qwen3.6-27B running as a Hermes agent. The persona,
        the memory of you, the ability to run terminal commands
        and read files — all of that is the combination working
        together. Neither part is enough on its own.
    

    模型准确描述了自身架构(模型 vs agent 的分工),验证了:

    • llama-server --jinja 生效(工具调用模板正确注入)
    • 27B IQ4_XS imatrix 量化质量正常(语义理解、逻辑连贯)
    • Hermes agent loop 完整(模型有 self-awareness 而非幻觉)

    Hermes Agent 自助压测

    Hermes 对 llama-server 进行自助压测,以下是完整对话:

    ────────────────────────────────────────
    ● what is the pp and tg performance of the current model?
    ────────────────────────────────────────
    
    ╭─ ⚕ Hermes ───────────────────────────────────────────╮
        Let me check your model setup and see if I can find
        performance data.
    ╰──────────────────────────────────────────────────────╯
      ┊ 💻 preparing terminal…
      ┊ 💻 $ grep -A10 'model:' ~/.hermes/config.yaml | head -15
      ┊ 💻 $ curl -s http://192.168.5.84:8000/v1/models ...
      ┊ 💻 $ curl -s http://192.168.5.84:8000/health ...
      ┊ 💻 $ hermes insights --days 1 2>/dev/null
      ┊ 💻 $ curl -s http://192.168.5.84:8000/metrics ...
    
      # ~500 token prompt, ~200 token generation
      💻 $ curl -s -X POST http://192.168.5.84:8000/v1/chat/completions \
        -H "Content-Type: application/json" \
        -d '{"model":"...","messages":[{"role":"user","content":
        "Explain the concept of quantization in large language
        models..."}],"max_tokens":200,"temperature":0}' \
        | python3 -c "
    import sys, json
    d = json.load(sys.stdin)
    t = d['timings']
    u = d['usage']
    print(f'Prompt tokens: {u[\"prompt_tokens\"]}')
    print(f'Generated tokens: {u[\"completion_tokens\"]}')
    print(f'PP (prompt processing): {t[\"prompt_per_second\"]:.1f} tok/s')
    print(f'TG (token generation):  {t[\"predicted_per_second\"]:.1f} tok/s')
    "
    
      # ~2000 token prompt
      💻 $ python3 -c "
    ...
    r = subprocess.run(['curl', '-s', '-X', 'POST',
        'http://192.168.5.84:8000/v1/chat/completions', ...])
    d = json.loads(r.stdout)
    t = d['timings']
    print(f'PP (prompt processing): {t[\"prompt_per_second\"]:.1f} tok/s')
    print(f'TG (token generation):  {t[\"predicted_per_second\"]:.1f} tok/s')
    "
    
    ╭─ ⚕ Hermes ───────────────────────────────────────────╮
        Here are the real-world performance numbers for your
        setup:
    
        Model: Qwen3.6-27B, 4.262 bits-per-word
               (imatrix quant), ~14GB
        GPU: RTX A4000 (16GB VRAM) on 192.168.5.84
        Inference: llama.cpp
    
        | Metric                 | Small prompt   | Large prompt    |
        |                        | (54 tok)       | (2209 tok)      |
        |------------------------|----------------|-----------------|
        | PP (Prompt Processing) | 293 tok/s      | 381 tok/s       |
        |                        | (184ms)        | (5.8s)          |
        | TG (Token Generation)  | 19 tok/s       | 9.6 tok/s       |
        |                        | (10.4s)        | (5.2s)          |
    
        What this means in practice:
    
        - PP gets faster with longer prompts — batch
          processing is more efficient at scale
        - TG drops with longer context — the KV cache
          fills up VRAM, so generation has to compete
          for memory bandwidth. With your 16GB card and
          a 27B model taking ~14GB, there's not much
          headroom
    
        User-facing impact:
        - A typical response of ~100 tokens takes
          5-10 seconds to generate
        - A longer 300-token response takes 15-30 seconds
        - As context grows (long conversations), TG slows
          further as the KV cache eats more VRAM
    
        The 4.262 bpw quantization is pretty aggressive —
        you're trading ~30-40% quality for fitting a 27B
        model in 16GB VRAM. If TG becomes too slow during
        long sessions, you could consider a lighter quant
        (Q4_K_M at ~5bpw) or a smaller model to leave more
        VRAM for the KV cache.
    ╰──────────────────────────────────────────────────────╯
     ⚕ Qwen3.6-27B-GGUF-4.262b... │ 35.9K/65.5K │ [██████░░░░] 55% │ 29m │ ⏲ 6m 54s
    ───────────────────────────────────────────────────────
    

    压测结论

    Metric 小 prompt (54 tok) 大 prompt (2209 tok)
    PP (Prompt Processing) 293 tok/s 381 tok/s
    TG (Token Generation) 19 tok/s 9.6 tok/s
    • PP 随 prompt 增长而加速(293 → 381 tok/s):batch processing 在更大输入上效率更高
    • TG 随上下文增长而下降(19 → 9.6 tok/s):KV cache 随上下文膨胀后,与模型 tensor 争抢显存带宽。16G 跑 27B 本就很紧张
    • 实际体感:100 token 回复约 5-10s,300 token 约 15-30s。长对话后期生成会进一步变慢
    LLM讨论区

  • 大模型16G卡的春天
    L laobenxiong

    感谢各位大佬. 我今天也试了下, 记录如下:

    ik_ollama.cpp 之 llama-server CUDA 构建日志

    针对 Debian 13 虚拟机 + CUDA 12.4 + NVIDIA RTX A4000 的编译配置。

    前置依赖

    sudo apt install build-essential cmake libcurl4-openssl-dev
    

    CMake 配置 + 构建

    rm -rf build
    cmake -S . -B build \
        -DGGML_CUDA=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_CUDA_ARCHITECTURES="86" \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_C_FLAGS="-fPIC -mcmodel=large -mavx2 -mfma -mf16c" \
        -DCMAKE_CXX_FLAGS="-fPIC -mcmodel=large -mavx2 -mfma -mf16c"
    cmake --build build --target llama-server -j$(nproc)
    

    二进制输出:build/bin/llama-server

    参数说明

    参数 说明
    -DGGML_CUDA=ON 启用 CUDA 后端
    -DCMAKE_CUDA_ARCHITECTURES="86" 指定 GPU 架构为 sm_86(A4000),比默认的多架构 fatbin 编译更快
    -DBUILD_SHARED_LIBS=ON 编译为动态库
    -fPIC 位置无关代码
    -mcmodel=large 大代码模型,解决 CUDA fatbin 导致的 relocation overflow 错误
    -mavx2 -mfma -mf16c 显式启用 AVX2/FMA/F16C 指令集,确保 IQK CPU 优化路径编译

    常见问题

    relocation truncated to fit / R_X86_64_PC32

    CUDA 编译产生的 fatbin 目标文件体积巨大,静态库链接时 32 位 PC 相对偏移溢出。
    必须加 -mcmodel=large。

    undefined reference to iqk_*

    IQK CPU 优化函数需要在 __AVX2__ 定义时才会编译。KVM 虚拟机可能不自动暴露 AVX2
    (即使宿主机支持),需显式加 -mavx2。

    运行参数参考(A4000 16G,Qwen3.6-27B IQ4_XS)

    export LD_LIBRARY_PATH=$(pwd)/build/src:$(pwd)/build/ggml/src:$LD_LIBRARY_PATH
    
    ./build/bin/llama-server \
        -m  ./models/qwen3.6/Qwen3.6-27B-GGUF-4.262bpw-imatrix.gguf \
        -c 65536 \
        -np 1 \
        -fa on \
        -ngl 99 \
        -ctk q4_0 \
        -khad \
        -ctv q4_0 \
        -vhad \
        --host 0.0.0.0 \
        --port 8000 \
        --cont-batching \
        --jinja \
        --mlock
    
    • -ctk q4_0 -ctv q4_0:TurboQuant KV cache 量化,16G 显存可跑到 50K+ 上下文
    • -ngl 99:尽可能把所有层 offload 到 GPU
    • --mlock:锁定内存,防止 swap

    mlock 权限修正

    如果运行日志出现 warning: failed to mlock ... Cannot allocate memory,需提升 memlock 限制:

    sudo tee -a /etc/security/limits.conf <<'EOF'
    bruin   hard    memlock     unlimited
    bruin   soft    memlock     unlimited
    EOF
    

    重新登录后生效。

    运行日志参考(64K context,A4000 16G)

    $ ./build/bin/llama-server \
        -m  ./models/qwen3.6/Qwen3.6-27B-GGUF-4.262bpw-imatrix.gguf \
        -c 65536 -np 1 -fa on -ngl 99 \
        -ctk q4_0 -khad -ctv q4_0 -vhad \
        --host 0.0.0.0 --port 8000 --cont-batching --jinja --mlock
    
    INFO [main] build info | build=4755 commit="94593ae0"
    INFO [main] system info | AVX = 1 | AVX2 = 1 | FMA = 1 | F16C = 1 | BLAS = 1
    ggml_cuda_init: found 1 CUDA devices:
      Device 0: NVIDIA RTX A4000, compute capability 8.6, VMM: yes, VRAM: 16101 MiB
    CUDA0: using device CUDA0 - 15929 MiB free
    
    llama_model_loader: - type  f32:  353 tensors
    llama_model_loader: - type q8_0:   96 tensors
    llama_model_loader: - type iq4_ks: 402 tensors
    
    llm_load_print_meta: model type       = 27B
    llm_load_print_meta: model ftype      = IQ4_KS - 4.25 bpw
    llm_load_print_meta: model params     = 26.896 B
    llm_load_print_meta: model size       = 13.344 GiB (4.262 BPW)
    
    Memory required for model tensors + cache: 14708 MiB
    Memory available on all devices - compute: 14808 MiB
    llm_load_tensors: offloaded 65/65 layers to GPU
    llm_load_tensors:        CPU buffer size =   645.09 MiB
    llm_load_tensors:      CUDA0 buffer size = 13018.97 MiB
    
    llama_kv_cache_init:      CUDA0 KV buffer size =  1301.63 MiB
    llama_init_from_model: KV self size  = 1152.00 MiB, K (q4_0): 576.00 MiB, V (q4_0): 576.00 MiB
    llama_init_from_model:      CUDA0 compute buffer size =   505.00 MiB
    llama_init_from_model:  CUDA_Host compute buffer size =    74.01 MiB
    
    INFO [init] new slot | id_slot=0 n_ctx_slot=65536
    INFO [main] model loaded
    INFO [main] HTTP server listening | port="8000" hostname="0.0.0.0"
    

    实测性能分析

    推理日志

    ======== Prompt cache: cache size: 0
    slot print_timing: id  0 | task 0 |
    prompt eval time =     182.52 ms /    25 tokens (    7.30 ms per token,   136.97 tokens per second)
           eval time =   13337.83 ms /   312 tokens (   42.75 ms per token,    23.39 tokens per second)
          total time =   13520.35 ms /   337 tokens
    
    ======== Prompt cache: cache size: 336 (命中缓存)
    slot print_timing: id  0 | task 314 |
    prompt eval time =     251.74 ms /    77 tokens (    3.27 ms per token,   305.87 tokens per second)
           eval time =   44615.10 ms /   868 tokens (   51.40 ms per token,    19.46 tokens per second)
          total time =   44866.84 ms /   945 tokens
    

    性能数据

    指标 首次请求(冷) 缓存命中 说明
    Prompt eval 137 tok/s 306 tok/s 缓存命中后翻倍
    文本生成 23.4 tok/s 19.5 tok/s 生成长度 868 后略有下降
    生成 token 数 312 868 —

    分析

    • 生成速度 19-23 tok/s:对于 27B 模型在 A4000(448 GB/s 带宽)上表现正常。
      参考 V100 16G(900 GB/s)报告 ~28 tok/s,与带宽比例吻合。
      同级别消费卡(4060 Ti 16G)通常在 15-20 tok/s。

    • Prompt eval 速度可观:TurboQuant 的 -khad -vhad + Flash Attention 效果显著,
      缓存命中时可达 306 tok/s。

    • 缓存行为:日志中出现 Common part does not match fully 和 SWA 导致的
      checkpoint 失效(forcing full prompt re-processing due to lack of cache data)。
      这是 Qwen3.6 模型部分层使用 Sliding Window Attention 的已知兼容性问题,
      不影响正确性,仅长历史场景下 prompt 重处理稍慢。

    显存使用明细

    项目 大小 占比
    模型 tensors (CUDA0) 13019 MiB 88.5%
    KV cache (q4_0) 1302 MiB 8.9%
    compute buffer (CUDA0) 505 MiB 3.4%
    compute buffer (CPU) 74 MiB 0.5%
    已用合计 14708 MiB —
    可用显存 14808 MiB —
    余量 ~100 MiB —
    LLM讨论区

  • llama.cpp+qwen3.6-27b 初步测试
    L laobenxiong

    关于 hermes 接入 llama-server, 这两天有两个观察:

    1. hermes 新会话的第一条 prompt 大概是不到 20k token, 7900xtx大概需要30~40秒pp, 然后tg. 观察 llama-server 的log, 发现第一条prompt之后紧接着会更一个小 prompt, 这个 prompt 会把前面的 checkpoint (大概每8k个token一个 checkpoint)都冲掉, 这样下一次再接着聊, 前面的~20K prompt 还得重新 pp. 让 hermes 自己检查了一下, 第二个小 prompt 是它发的 title generation request. 为了避免这种情况, 可以禁止 title generation, 或者设一个辅助 aux model来生成 title (比如我让在线的 deepseek-v4-flash 干所有的 aux 工作);
    2. hermes stream mode 下有一个环境变量 HERMES_STREAM_READ_TIMEOUT, 它 控制收到第一个回复token的 timeout, 缺省为120s. 而在7900xtx 下pp花的时间大概是这样的(q5_1/q5_1 cache quant):
     -  20k:  40s
     -  40k: 100s
     -  60k: 170s
     -  80k: 260s
     - 100k: 360s
     - 120k: 460s
     - 140k: 580s
     - 160k: 710s
    

    如果hermes有~50k的prompt, 赶上 llama-server cache checkpoint 刚好都是清空的情况下, pp没有完成之前, hermes就超时了.超时以后 hermes会中断当前请求,再发第二次(共三次). 如果第二次又刚好checkpoint被清空(我碰到过,具体原因还没搞明白),那么三次必然都会失败. 碰到这种情况, 可以把这个环境变量增大一下.

    今天更新llama.cpp到最新, 还碰到了 llama-server RSS 超大给 oom-kill的情况, 以及 llama-server/hermes 进入死循环的情况. 具体还没有时间搞清楚. 目前我回到了 b9305.

    目前的启动脚本如下:

    #!/bin/bash
    
    LLAMA_SERVER=/home/bruin/github/llama.cpp/build-vulkan/bin/llama-server
    
    TOKEN_PER_CKPT=8192    # token per checkpoint, seems llama.cpp hardcoded
    NUM_CKPT=32
    CTX_SIZE=$((TOKEN_PER_CKPT * NUM_CKPT))
    
    ARGS=(
      --model              /home/bruin/Qwen3.6-27B-Q4_K_M.gguf
      --mmproj             /opt/gguf-models/unsloth/Qwen3.6-27B-MTP-GGUF/mmproj-BF16.gguf
      #--chat-template-file /opt/gguf-models/froggeric/Qwen-Fixed-Chat-Templates/chat_template.jinja
      --spec-type          draft-mtp
      --spec-draft-n-max   2                       # Max draft tokens
      --ctx-checkpoints ${NUM_CKPT}                # 8k token per ckpt
      --ctx-size ${CTX_SIZE}                       # 262144 for 256k context
      #--swa-full                                   # qwen3.6-27b does not support it
      --parallel   1                               # Single slot
      --flash-attn on                              # Enable FlashAttention
      --n-gpu-layers 999                           # All layers to GPU
      --cache-type-k q5_1                          # Quantize KV cache keys
      --cache-type-v q5_1                          # Quantize KV cache values
      #--fit off                                    #
      --threads 16                                 # CPU threads helping tg
      --threads-batch 16                           # CPU threads helping pg
      --batch-size 2048                            # Batch size
      --ubatch-size 1024                           # Micro‑batch size
      --cache-ram 0                                # seems not working
      --reasoning auto                             # Auto reasoning
      --reasoning-format deepseek                  # Reasoning format
      --reasoning-budget 1024                      # Reasoning budget
      --log-verbosity 4                            # Log verbosity
      --host 0.0.0.0 --port 8000                   # Listen on all interfaces, port 8000
      --cont-batching                              # Continuous batching
      --no-warmup                                  # Skip warmup
      --no-mmap                                    # Don’t memory‑map model
      --mlock                                      # Lock model in RAM
      --jinja                                      # Jinja chat template
      --metrics                                    # View metrics by accessing http://<ip:port>/metrics
    )
    
    # print the cmdline
    echo "${LLAMA_SERVER}"
    for ((i=0; i<${#ARGS[@]}; i+=2)); do
      echo "${ARGS[i]} ${ARGS[i+1]}"
    done
    
    # run the cmd
    ${LLAMA_SERVER} "${ARGS[@]}"
    
    LLM讨论区 amd 7900xtx

  • 笔记本上跑了一下gemma 4 12B ,还凑合
    L laobenxiong

    @张老师 Agent 的 skills 可以帮忙扒视频的字幕, 算是代替 ASR 吧. hermes 就可以, 直接把 url 贴给它, 它调用相应的 skill 获取字幕, 然后再分析...

    LLM讨论区

  • AI生成了一个LLM GPU显存计算器
    L laobenxiong

    github上有个类似的项目: https://github.com/Andyyyy64/whichllm

    LLM讨论区

  • llama.cpp目前有重大性能BUG:checkpoint的巡回逻辑对于混合模型(比如qwen3.6-27B)无效,从而导致大概率每次对话都要prefill全文,严重拖慢速度
    L laobenxiong

    @kop-wang 我在 7900xtx 上用 llama-server (vulkan, b9553) + unsloth/Qwen3.6-27B-MTP-GGUF + hermes 配 262144 context, 问题的症状和这个不一样. 我可以一个 session 顺利到达 >200K 的上下文结束. 中间没有这里提到的 prefill 重填的问题(或者我没有注意到?). 我碰到的问题是, 任务结束以后, gpu还在运行, llama-server log 显示收到了一堆任务, 然后最后导致 ~200K 的 prefill 全部失效 且重新 prefill. 让 hermes 自己调查了一下 (让它直接监控 llama-server 的日志, 它再和自己的日志对比), 它说是 creation_nudge_interval 和 nudge_interval 导致的, 并建议我把它们置0 (disable).

    LLM讨论区 llama.cpp

  • 双AI Pro R9700 32g,Qwen 3.6 27b q4 KM q8 KV Ubuntu24 Hermes agent
    L laobenxiong

    @Brian 说:

    即使是模型和hermes都设置256k上下文,herems还会触发压缩,最终效果还是很够用的

    我现在把压缩关闭了. 首先压缩效果不一定好(我让hermes调deepseek v4 flash做压缩, 发现压缩以后好多信息都丢了), 另外, 压缩以后所有 prefill 要重建, 既花时间, 有没有啥信息含量. 所以干脆disable it. context 快到头了就 /new 一个, hermes自己记住所有的对话, 在新对话里提一下"我们以前/刚刚聊过xxx", 它自己就会从数据库里去找. 我赶脚这个比压缩还靠谱.

    f33371a2-d0b8-424a-b6cf-fb1c8f6e5deb-image.jpeg

    LLM讨论区 r9700 ai-pro-r9700 hermes

  • 买7900XTX 还是9700XT
    L laobenxiong

    都不提价格区别...

    AI硬件 7900xtx
  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 最新
  • 标签
  • 热门
  • 用户
  • 群组