zheqiushui commited on
Commit
b461289
·
verified ·
1 Parent(s): fd5eade

README: align with the other AX8860 packages

Browse files
Files changed (3) hide show
  1. PACKAGE.md5 +1 -1
  2. README.md +48 -44
  3. SHA256SUMS +1 -1
PACKAGE.md5 CHANGED
@@ -1,6 +1,6 @@
1
  dda465045fe83467593a756c86c7e0be BIN_COMMIT
2
  57e37e3fd7758a9e4f7c687cf5c0e257 MiniCPM5-2B-Q8_0.gguf
3
- a48338b8e4d690f6f044873a61fd9a8b README.md
4
  8736973eb22670a9cce4a51d895363c2 WEIGHTS.md5
5
  d9ab3d8341082333481876b7e5d98d9f bench.sh
6
  8b8d2651ef667dc715582f816984997c bin/llama-bench
 
1
  dda465045fe83467593a756c86c7e0be BIN_COMMIT
2
  57e37e3fd7758a9e4f7c687cf5c0e257 MiniCPM5-2B-Q8_0.gguf
3
+ 6bfa5d88c690341ae90e9175e28eb78b README.md
4
  8736973eb22670a9cce4a51d895363c2 WEIGHTS.md5
5
  d9ab3d8341082333481876b7e5d98d9f bench.sh
6
  8b8d2651ef667dc715582f816984997c bin/llama-bench
README.md CHANGED
@@ -5,36 +5,26 @@ library_name: llama.cpp
5
 
6
  # MiniCPM5-2B on AX8860 (llama.cpp + ggml-axera)
7
 
8
- 在爱芯 AX8860 的 NPU 上用 llama.cpp 运行 MiniCPM5-2B 纯文本模型,OpenAI 兼容服务、思考开关与工具调用。
9
- MiniCPM5-2B on the Axera AX8860 NPU with llama.cpp: text-only decoding, an OpenAI-compatible server, a thinking switch and tool calling.
10
-
11
- ## 模型 / Model
12
-
13
- 42 层 Llama(GQA 16 Q / 2 KV,head_dim 128,SwiGLU 6144,vocab 130560,`rope_theta` 5e6,
14
- 原生上下文 131072,EOS `[1, 130073]`)。包内 GGUF 为官方 Q8_0;F16 GGUF 也可直接加载。
15
 
16
  ## 性能 / Performance
17
 
18
- `sh bench.sh` 复现(生成 50 token;短 prompt 只列耗时):
 
 
 
 
 
 
19
 
20
  | prompt | `-c` | prompt 耗时 / time | decode tokens/s |
21
  |---|---:|---:|---:|
22
- | 5 token | 8192 | 0.036 s | 59.50 |
23
- | 46 token | 8192 | 0.045 s | 59.15 |
24
- | 3907 token | 8192 | 0.628 s | 51.94 |
25
- | 5 token | 131072 | 0.036 s | 59.20 |
26
- | 3907 token | 131072 | 0.628 s | 52.08 |
27
-
28
- 4k prompt prefill 约 **6219 tokens/s**(`-c 8192`)。
29
-
30
- ## 困惑度 / Perplexity
31
-
32
- `sh bench.sh ppl`,同一 GGUF、`-c 512`:
33
-
34
- | 语言 | `-ub 1` | `-ub 4` |
35
- |---|---:|---:|
36
- | 中文 / zh | 16.70 | 16.72 |
37
- | 英文 / en | 13.33 | 13.44 |
38
 
39
  ## 快速开始 / Quick start
40
 
@@ -46,36 +36,50 @@ sh bench.sh # 性能复现 / benchmark
46
  sh bench.sh ppl # 困惑度 / perplexity
47
  ```
48
 
49
- `run.sh -c` 使用 `llama-completion -cnv` 的交互对话,需要真实终端;从管道喂输入时没有 TTY,
50
- 程序会立即读到 EOF。请直接在终端运行,或用 `script -qec './run.sh -c' /dev/null` 验证。
51
- Chat mode requires an interactive terminal; piped stdin has no TTY and exits at EOF.
52
 
53
- 需要 AX8860,SDK V0.5.1 或更新;HF 下载的文件没有执行权限时用 `sh` 调用即可 /
54
- needs an AX8860 with SDK V0.5.1+; call the scripts with `sh` when the downloaded files are not executable.
55
-
56
- ## 服务端 / Server
57
 
58
  ```sh
59
- sh run.sh -s 8080
60
  curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
61
  "messages": [{"role": "user", "content": "用一句话介绍长江"}],
62
  "chat_template_kwargs": {"enable_thinking": false}
63
  }'
64
  ```
65
 
66
- - 单序列(`-np 1`),prompt cache 与上下文 checkpoint 走统一的序列状态层。
67
- - 思考开关:`chat_template_kwargs.enable_thinking`;工具调用使用 `--jinja` + 包内
68
- `chat_template.jinja`。
69
- - 上下文:一套 kernel 按 `-c` 分配 KV,最大 131072;`CTX`/`CTXCP` 环境变量可调。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
- ## 权重与精度 / Weights
72
 
73
- - 加载时把 Q8_0 或 F16 GGUF 整块转成 MXFP8(e4m3 + per-32 E8M0 scale),KV 固定 bf16。
74
- - 不 tie embedding;输出头并入 4 核 decode kernel,一次调用同时给出贪心 argmax 与 top-1024(max/sumexp)采样结果。
75
- - 包内 kernel:`cpm5_prefill256_mx8_kvc_c131072_npu4.axmodel`(prefill)、
76
- `cpm5_decode1_mx8_kvc_c131072_npu4.axmodel`(decode + 输出头)。
77
- - 无 MTP 头,未启用投机解码。
78
 
79
- ## 来源 / Source
80
 
81
- https://github.com/ZHEQIUSHUI/llama.cpp
 
5
 
6
  # MiniCPM5-2B on AX8860 (llama.cpp + ggml-axera)
7
 
8
+ 在爱芯 AX8860 的 NPU 上用 llama.cpp 运行 MiniCPM5-2B 文本模型:思考开关、工具调用,OpenAI 兼容服务。
9
+ MiniCPM5-2B on the Axera AX8860 NPU with llama.cpp: text model with a thinking switch, tool calling and an OpenAI-compatible server.
 
 
 
 
 
10
 
11
  ## 性能 / Performance
12
 
13
+ | | |
14
+ |---|---|
15
+ | decode | **59.5 tokens/s** |
16
+ | 4k prompt prefill | **6219 tokens/s**(3907 token 0.63 s) |
17
+ | 上下文 / context | 最长 / up to 131072 |
18
+
19
+ `sh bench.sh` 复现 / reproduce(生成 50 token / 50 generated tokens):
20
 
21
  | prompt | `-c` | prompt 耗时 / time | decode tokens/s |
22
  |---|---:|---:|---:|
23
+ | 5 token | 8192 | 0.04 s | 59.5 |
24
+ | 46 token | 8192 | 0.05 s | 59.2 |
25
+ | 3907 token | 8192 | 0.63 s | 51.9 |
26
+ | 5 token | 131072 | 0.04 s | 59.2 |
27
+ | 3907 token | 131072 | 0.63 s | 52.1 |
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## 快速开始 / Quick start
30
 
 
36
  sh bench.sh ppl # 困惑度 / perplexity
37
  ```
38
 
39
+ 需要 AX8860,SDK V0.5.1 或更新;HF 下载的文件没有执行权限,用 `sh` 调用即可 / needs an AX8860 with SDK V0.5.1+; call the scripts with `sh`.
 
 
40
 
41
+ 服务请求 / Server request:
 
 
 
42
 
43
  ```sh
 
44
  curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
45
  "messages": [{"role": "user", "content": "用一句话介绍长江"}],
46
  "chat_template_kwargs": {"enable_thinking": false}
47
  }'
48
  ```
49
 
50
+ ## 文件 / Files
51
+
52
+ | 文件 / File | 说明 / Description |
53
+ |---|---|
54
+ | `MiniCPM5-2B-Q8_0.gguf` | 模型权重(官方 Q8_0)/ weights (official Q8_0),2.68 GB,md5 `57e37e3fd7758a9e4f7c687cf5c0e257` |
55
+ | `bin/` | llama.cpp 板端程序(静态链接)/ board programs (static) |
56
+ | `kernels/` | NPU kernel 2 个:prefill、decode(含输出头)+ `manifest.json` / two kernels: prefill and decode (with the output head) + `manifest.json` |
57
+ | `run.sh`,`chat_template.jinja` | 运行脚本与服务端对话模板 / run script and the server's chat template |
58
+ | `bench.sh` 及 prompt | 性能与困惑度复现 / benchmark and perplexity |
59
+
60
+ ## 说明 / Notes
61
+
62
+ - 权重在加载时由 GGUF 转成 MXFP8,KV 为 BF16;Q8_0 与 F16 GGUF 都可加载 / weights are converted from the GGUF to MXFP8 at load, with a BF16 KV cache; both Q8_0 and F16 GGUFs load.
63
+ - 一套 kernel 覆盖到 131072 上下文,KV 按 `-c` 分配;用环境变量 `CTX` 调整 / one kernel set covers up to 131072 tokens and allocates the KV by `-c`; set `CTX` to change it.
64
+ - 思考开关用 `chat_template_kwargs.enable_thinking`;工具调用使用包内 `chat_template.jinja` / toggle thinking with `chat_template_kwargs.enable_thinking`; tool calling uses the bundled `chat_template.jinja`.
65
+ - 没有 MTP 头,不支持 MTP 投机解码 / no MTP head, so no MTP speculative decoding.
66
+ - `run.sh -c` 需要真实终端 / chat mode needs an interactive terminal.
67
+ - 运行时独占 NPU 4 核;服务端 `-np 1` / takes all 4 NPU cores; the server runs `-np 1`.
68
+
69
+ ## 正确性 / Correctness
70
+
71
+ - 文本补全、服务端对话与思考开关���板上工作正常 / completion, server chat and the thinking switch work on the board.
72
+ - PPL(`sh bench.sh ppl`,`-c 512`)/ perplexity:
73
+
74
+ | 语言 / language | `-ub 1` | `-ub 4` |
75
+ |---|---:|---:|
76
+ | 中文 / zh | 16.70 | 16.72 |
77
+ | 英文 / en | 13.33 | 13.44 |
78
 
79
+ ## 源码 / Sources
80
 
81
+ - llama.cpp:[ZHEQIUSHUI/llama.cpp](https://github.com/ZHEQIUSHUI/llama.cpp) @ `1970d6c5d`
 
 
 
 
82
 
83
+ ## 更新 / Changelog
84
 
85
+ - 2026-11-15:首次发布 / first release.
SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
  0cdb06219b58744420a63b9bee1523816d47bc0edb530114eef33738dcef790d BIN_COMMIT
2
  c5415f8989bf88a8288f1b55a3cc371af53c07b0faa220a63bd7a990cfaba078 MiniCPM5-2B-Q8_0.gguf
3
- f072932c96fc449881e88cb5d29dc7c08537b04636df1993a06a34034dd2a869 README.md
4
  94dbae1f8d9a4c6563b08c82d18bd08496827e0273ce15352860c179a5a98932 WEIGHTS.md5
5
  8d4b00a1ffbb28665215172e794c13e6b681383113b25032d199cddce949236a bench.sh
6
  53128c2a1f7bf9f25f2a2c84d75e88b7e1917ec3840b3228333514b3b20998cd bin/llama-bench
 
1
  0cdb06219b58744420a63b9bee1523816d47bc0edb530114eef33738dcef790d BIN_COMMIT
2
  c5415f8989bf88a8288f1b55a3cc371af53c07b0faa220a63bd7a990cfaba078 MiniCPM5-2B-Q8_0.gguf
3
+ fe3fbf7eb29607e5983ef56bb93d508ebb9c8fb7fef3a58da09752e6b5ae9ffe README.md
4
  94dbae1f8d9a4c6563b08c82d18bd08496827e0273ce15352860c179a5a98932 WEIGHTS.md5
5
  8d4b00a1ffbb28665215172e794c13e6b681383113b25032d199cddce949236a bench.sh
6
  53128c2a1f7bf9f25f2a2c84d75e88b7e1917ec3840b3228333514b3b20998cd bin/llama-bench