Qwen3-ForcedAligner-0.6B on AX8860 (llama.cpp + ggml-axera, 2026-11-15)

在爱芯 AX8860 的 NPU(4 核)上用 llama.cpp 运行 Qwen3-ForcedAligner-0.6B,给定音频和文本,输出词级起止时间戳。 Qwen3-ForcedAligner-0.6B word-level forced alignment on the 4-core NPU of the Axera AX8860, with llama.cpp.

文件 / Files

文件 / File 说明 / Description
qwen3-forcedaligner-0.6b-bf16.gguf 文本塔权重(GGUF BF16,1.13 GiB)/ text-tower weights
mmproj-qwen3-forcedaligner-0.6b-q8_0.gguf 音频编码器权重(GGUF Q8_0,338 MiB)/ audio-encoder weights
bin/llama-forced-aligner 命令行程序 / command-line program
bin/llama-server 常驻服务程序,提供 /v1/audio/alignments / resident server
kernels/ 音频编码器、文本塔+5000 类头各一个 4 核合并 axmodel + manifest.json / one merged axmodel each for the audio encoder and the text tower + 5000-class head, plus manifest.json
run.sh 运行脚本 / run script
bench.sh 无参数测速脚本 / no-argument benchmark
examples/ 包内自带 5 s、30 s、接近上下文上限的测速音频和文本 / bundled 5 s, 30 s and near-limit benchmark audio and text
SHA256SUMS 全包校验和 / checksums

权重只来自 GGUF:kernel 不含权重,加载时转换(文本塔 MXFP8,音频编码器 BF16,由 mmproj 的 Q8_0 反量化)。 The kernels hold no weights: they are converted at load (text tower MXFP8, audio encoder BF16 dequantized from the mmproj's Q8_0).

运行 / Run

环境 / Requirements:AX8860,SDK V0.6.0(板上实测)/ tested with SDK V0.6.0.

./run.sh speech.wav "The quick brown fox jumps over the lazy dog." English out.json
./run.sh speech.wav "今天天气很好,我们出去走走吧。" Chinese          # JSON 到 stdout
./run.sh -s 18240                                                    # 常驻服务 / resident server

一次性 CLI 输出 / CLI JSON output:

{"words":[{"word":"The","start":0.08,"end":0.24}, ...],
 "timestamp_ids":[1,3,...], "raw_timestamp_ms":[...], "fixed_timestamp_ms":[...],
 "segments":[{"id":0,"start":0.08,"end":2.40,"text":"...","words":[]}],
 "language":"English", "duration":2.56, "input_tokens":42, "audio_tokens":32}

words[].start/end 已按官方 fix_timestamp 规则做单调约束;timestamp_ids 是 80 ms 网格上的原始类别,top2_margin_u6 是分类头前两名的间隔(诊断用)。 words[].start/end follow the official fix_timestamp monotonic rule; timestamp_ids are the raw 80 ms grid classes.

服务请求 / Server requests(模型常驻,-np 1,一次一个请求 / resident model, one request at a time):

curl -F file=@speech.wav -F transcript="The quick brown fox jumps over the lazy dog." \
     -F language=English http://localhost:18240/v1/audio/alignments

# OpenAI 风格转写端点,带 transcript 时用同一个对齐器 / transcriptions endpoint
curl -F file=@speech.wav -F transcript="..." -F response_format=verbose_json \
     http://localhost:18240/v1/audio/transcriptions

也可用 JSON 请求体:{"audio":"<base64 wav>","transcript":"...","language":"English"}。响应头 X-Align-Forward-Seconds、X-Align-Input-Tokens、X-Align-Audio-Tokens 给出本次前向耗时和 token 数。 A JSON body with base64 audio is also accepted. The response headers report the text-tower forward time and token counts.

性能 / Performance

AX8860,SDK V0.6.0,NPU 4 核,服务端端到端。数字全部来自 ./bench.sh(可直接无参数运行,默认端口 18240,占用时在 18240–18249 内自动后移;也可用 FA_BENCH_PORT 指定该范围内的端口;冷启动 + 每档 3 次 warm)。 4 NPU cores, server mode, end to end. All numbers come from ./bench.sh (runs without arguments on port 18240, moving within 18240–18249 if the port is busy; set FA_BENCH_PORT to choose another port in that range; one cold start plus three warm runs per tier).

档位 / Tier 音频 / Audio wall / s 文本塔前向 / text forward / s wall RTF 前向 RTF / forward RTF
冷启动首请求 / first request 5.00 s 0.855 0.049 0.171 0.010
5 s warm 5.00 s 0.319–0.350 0.017–0.028 0.064–0.070 0.003–0.006
30 s warm 30.00 s 0.670–0.734 0.103–0.173 0.022–0.024 0.003–0.006
接近上限 / near limit, warm 162.84 s 2.732–3.011 0.729–0.992 0.017–0.018 0.004–0.006

wall 是请求端到端时间(含 WAV 解码、音频编码器、文本塔和 HTTP);text forward 是 X-Align-Forward-Seconds,只计文本塔+分类头的那次 NPU 图。 wall is the whole request (WAV decode, audio encoder, text tower, HTTP); text forward is the text-tower graph only.

启动与 NPU 内存 / Startup and NPU memory(同一次 bench):

项 / Item 数值 / Value
服务冷启动加载 / cold server load 8.34 s
加载前 CMM / before load 288,002,048 B
加载后 CMM / after load 2,953,936,896 B
5 s 请求峰值增量 / 5 s peak delta 657,543,168 B
30 s 请求峰值增量 / 30 s peak delta 732,315,648 B
162.84 s 请求峰值增量 / near-limit peak delta 804,016,128 B
服务 TERM 退出 / server exit after TERM 1.2 s

正确性 / Correctness

对官方 FP32 CPU 实现(qwen_asr ForcedAligner,torch CPU)比较 22 段中英文音频(英 11、中 11,含 74.32 s 和 68.56 s 两段长音频),共 643 词、1286 个起止时间戳: Against the official FP32 CPU implementation on 22 Chinese/English recordings (11 each, including 74.32 s and 68.56 s long clips), 643 words and 1286 word boundaries:

指标 / Metric 结果 / Result
argmax 一致 / argmax agreement 1247/1286 = 96.97%
词级起止绝对误差均值 / mean abs error 2.67 ms
中位数 / median 0 ms
p99 80 ms
最大 / max 240 ms
≤80 ms 99.69%
≤160 ms 99.84%

不一致的 39 个时间戳中,36 个只差一格(80 ms)、2 个差两格、1 个差三格。用同一 GGUF 的 CPU BF16 路径作对照:CPU 也有 40 个不一致,其中 37 个与 NPU 完全相同;NPU 独有 2 个、CPU 独有 3 个,都是 ±1 格。因此这些差异主要是模型在近似并列类别上的数值敏感性,不是 NPU 独有错误;NPU 的 5000 类头与整条链路没有引入系统性偏移。 Of the 39 mismatching boundaries, 36 are one grid (80 ms), 2 are two grids and 1 is three grids. A CPU BF16 run of the same GGUF also has 40 mismatches, 37 of them identical to the NPU; the NPU has 2 unique and the CPU 3 unique, all ±1 grid. The differences are near-tie sensitivity, not an NPU-specific bias.

音频编码器的板上 cos 为 0.9999971(min 0.9999153),文本塔 28 层输出 cos 为 0.9984–0.9998,5000 类头输出 cos 为 0.9999995;漂移主要来自文本塔的 MXFP8 权重,分类头本身几乎无损。 Board cos is 0.9999971 for the audio encoder, 0.9984–0.9998 for the 28-layer text tower and 0.9999995 for the 5000-class head; the drift is dominated by the MXFP8 text weights, not the classifier.

语言与限制 / Languages and limits

  • 中文、英文:支持(官方切词规则)。Chinese and English: supported with the official word splitting.
  • 日文、韩文:返回 HTTP 400,并说明官方切词依赖 nagisa / soynlp 词典,本自包含包未内置。Japanese and Korean return HTTP 400 because the official segmentation needs dictionaries that are not bundled.
  • 上下文固定 4096 token,音频约 13 token/s。仅计音频时理论上限约 310 s;带正常语速 transcript 时实际约 160–200 s;包内接近上限样例是 162.84 s 音频 + 很长文本(4024 token)。超限返回 HTTP 400 和明确的 token 数,不会崩溃。The context is fixed at 4096 tokens (about 13 audio tokens per second). The audio-only bound is about 310 s; a normal transcript brings the practical bound to about 160–200 s. The bundled near-limit case is 162.84 s audio plus a long transcript (4024 tokens). Over-limit requests return HTTP 400 with the token counts.
  • 服务端必须 -np 1;NPU 4 核运行时独占,单请求串行。输出行上限 4096(与上下文一致),超过返回 HTTP 400,服务不中断。The server requires -np 1; it uses all four NPU cores and serializes requests. Up to 4096 timestamp rows are supported; over-limit requests return HTTP 400 without killing the server.

样例来源 / Sample sources

examples/ 和正确性测试中的音频均为本机 TTS 生成(Qwen3-TTS CustomVoice、Fun-CosyVoice3-0.5B,Apache-2.0),或 Qwen3-ASR 公开演示音频;文本为对应的合成文本。长音频是这些短句按 0.4 s 静音拼接。没有重新分发第三方录音。 The audio in examples/ and in the correctness set is locally TTS-generated (Qwen3-TTS CustomVoice, Fun-CosyVoice3-0.5B under Apache-2.0) or the public Qwen3-ASR demo clip; long clips concatenate the short TTS sentences with 0.4 s of silence. No third-party recording is redistributed.

源码 / Sources

更新 / Changelog

  • 2026-11-15:首次发布 / first release.
Downloads last month
263
GGUF
Model size
0.6B params
Architecture
qwen3vl
Hardware compatibility
Log In to add your hardware

16-bit

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

Model tree for AXERA-TECH/Qwen3-ForcedAligner-0.6B-AX8860-llama.cpp

Quantized
(22)
this model

Collection including AXERA-TECH/Qwen3-ForcedAligner-0.6B-AX8860-llama.cpp