YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Qwen3.5-9B on AX8860 (llama.cpp + ggml-axera, 2026-11-05)

在爱芯 AX8860 的 NPU(4 核)上用 llama.cpp 运行 Qwen3.5-9B,支持文本和图像输入;一套 kernel 覆盖到 256k 上下文,NPU 内存随 llama.cpp 的上下文长度(-c)分配。 Qwen3.5-9B with text and image input on the 4-core NPU of the Axera AX8860, with llama.cpp; one kernel set for contexts up to 256k, the NPU memory allocated for the context llama.cpp is given (-c).

文件 / Files

文件 / File 说明 / Description
qwen3.5-9b-mxfp4.gguf 模型权重(GGUF MXFP4,6.00 GB,md5 57b4b4b8fe3e7d05af29019438e5369a)/ weights
mmproj-qwen3.5-9b-bf16.gguf 视觉编码器权重(BF16,921 MB,md5 69d1a645084d0f31d4296a82dce991cf)/ vision encoder weights
bin/ llama.cpp 板端程序(静态链接,只依赖系统 /opt/lib 与 libc)/ the board programs (static; need only the system /opt/lib and libc)
kernels/ NPU kernel + manifest.json:prefill、16 层 decode group(两组)、输出头、3072-patch ViT / the NPU kernels + manifest.json: prefill, a 16-layer decode group (two groups), the output head, the 3072-patch ViT
run.sh 运行脚本 / run script

权重只来自 GGUF:kernel 不含权重,加载时从 GGUF 转换到 NPU(约 36 - 38 s);NPU 内存里只放一份权重(prefill 和 decode 共用)。 The weights come only from the GGUFs: the kernels hold none; they are converted from the GGUF at load (~36 - 38 s); one copy of the weights in NPU memory (shared by prefill and decode).

运行 / Run

环境 / Requirements:AX8860,SDK V0.5.0 或更新(cat /proc/ax_proc/version)/ SDK V0.5.0 or newer.

./run.sh "The capital of France is" 64                 # 文本补全 / text completion
./run.sh -i bus.jpg "Describe this image." 256         # 图像描述 / describe an image
./run.sh -c                                            # 命令行多轮对话 / multi-turn chat in the terminal
./run.sh -s 8080                                       # OpenAI 兼容服务 / OpenAI-compatible server
CTX=262144 ./run.sh -s 8080                            # 256k 上下文 / the full 256k context
CTX=16384 ./run.sh -s 8080                             # 16k 上下文,NPU 内存最省 / 16k context, the least NPU memory
curl http://<board>:8080/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"你好"}]}'

CTX 是传给 llama.cpp 的 -c(默认 131072,最大 262144):KV cache 的 NPU 内存按它分配,所以短上下文的场景把它调小即可省内存。 CTX is llama.cpp's -c (default 131072, up to 262144): the NPU memory of the KV cache is allocated for it, so a smaller value saves memory for short-context use.

直接调用程序时设置 / When calling the programs directly: LD_LIBRARY_PATH=/opt/lib GGML_AXERA_KERNEL_DIR=<repo>/kernels,-ngl 99,-c 不超过 262144,服务端 -np 1。GGML_AXERA_PROF=1 退出时打印各阶段耗时 / prints per-stage times at exit。

性能 / Performance

AX8860,SDK V0.5.1,NPU 4 核 / 4 cores,贪心解码 / greedy decoding:

项 / Item 值 / Value
加载后 NPU 内存(CMM)/ NPU memory after load CTX=4096 6.0 GB,CTX=16384 6.5 GB,CTX=131072(默认 / default)9.7 GB,CTX=262144 13.9 GB
加载后系统内存 / host memory after load 0.4(峰值 / peak 1.3) GB
加载 / load 36 - 38 s
4k prompt prefill 2898 tokens/s
短上下文 decode / short-context decode 42.5 tokens/s
32k prompt prefill / decode(32k 上下文 / context) 2458 tokens/s / 30.3 tokens/s
64k prompt prefill / decode(64k 上下文 / context) 1990 tokens/s / 23.3 tokens/s
120k prompt(113,463 token)prefill / decode(113k 上下文 / context) 1481 tokens/s / 17.7 tokens/s
图像编码 / image encoding(3072 patch = 768 图像 token / image tokens) 0.28 s

上下文越长 decode 越慢(attention 要读整个 KV)/ decode slows with the context (attention reads the whole KV).

正确性 / Correctness

  • "The capital of France is" → "Paris. …";图像描述正确(车辆、文字、人物)/ image descriptions correct.
  • 长文 PPL(-c 4096,英文小说):5.014 / long-text PPL (-c 4096, an English novel): 5.014;中文 PPL(内部测试集,-c 512):20.83,同一 GGUF 在 CPU 上 20.55 / Chinese PPL on an internal set: 20.83 (the same GGUF on the CPU: 20.55).
  • 大海捞针 / needle in a haystack(一句暗号藏在小说 30% 处,末尾提问 / a code hidden at 30% of a novel, asked at the end):32k / 64k / 120k token 全部命中 / found at 32k / 64k / 120k tokens.
  • KV cache 按 -c 分配后的输出与分配整个 256k 时一致(GGML_AXERA_KV_PAGES=1024 对照)/ the output with the KV cache allocated for -c matches the one with the whole 256k allocated.
  • 同一输入多次运行,结果偶有极小差异(NPU 上累加顺序不固定),不影响输出质量。 Repeated runs of one input may differ slightly (the NPU's accumulation order varies); the output quality is the same.

已知限制 / Known limits

  • 运行时独占 NPU 4 核,同时运行其他 NPU 程序会出错 / takes all 4 NPU cores; do not run other NPU programs alongside.
  • 单序列:服务端须 -np 1 / one sequence: the server needs -np 1.
  • 板子 16 GB 系统内存:llama-perplexity 的 -c 不超过 4096(它把整段上下文的 logits 放在系统内存里)/ with the board's 16 GB host memory, llama-perplexity works up to -c 4096 (it keeps the whole context's logits in host memory).
  • 上下文越长 decode 越慢(attention 要读整个 KV):64k 上下文 23.3 tokens/s,113k 17.7 tokens/s / decode slows with the context (attention reads the whole KV): 23.3 tokens/s at 64k, 17.7 at 113k.

源码 / Sources

Downloads last month
220
GGUF
Model size
9B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including AXERA-TECH/Qwen3.5-9B-AX8860-llama.cpp