MOSS-TTS-v1.5-W4GPTQ-w2 — 独立(自包含)W4-GPTQ 量化版
MOSS-TTS-v1.5 的 int4 GPTQ 量化权重,自包含单目录:下载本目录即可推理,不再需要 16.6 GB 的 bf16 基座检查点。
Standalone int4 (GPTQ) weights for MOSS-TTS-v1.5. This directory is
self-contained — the 16.6 GB bf16 base checkpoint is not required.
Requires the minimal inference runtime moss_min (this repository) and a
separate audio-codec checkpoint.
| 项 / Item | 值 / Value |
|---|---|
| 档位 / preset | w2 (None) |
| 量化 / quantization | GPTQ, int4, group size 32, I32 payload + BF16 scales/zeros |
| 量化投影数 / quantized projections | 212 |
| 保 bf16 / kept in bf16 | 40 projections kept bf16 — v_proj x36 + down_proj L6/16/33/35 |
| 权重文件 / weight file | quantized.safetensors — 7.37 GiB, 675 tensors |
| sha256 | 478505b4cb3e8b5f44d9ec0a74b865316e163880300468decbd38b93fbaecb31 |
| 导出时间 / exported | 2026-09-11T08:39:59Z (torch 2.9.1+cu129) |
| 基座 / base | OpenMOSS-Team/MOSS-TTS-v1.5 |
1. 这是什么
这是 MOSS-TTS-v1.5(Qwen3-8B 骨干 + 32 路音频码本 + 33 个输出头)的逐层 GPTQ 校准量化版本:
骨干 36 层的 q/k/o/gate/up/down 六个投影被压成 int4(group 32),最敏感的
v_proj 全 36 层与 down_proj 第 6/16/33/35 层保留 bf16;嵌入、输出头、各类归一化全部保持 bf16。
推理内核与未量化的 --quant w4 档完全相同(torch._weight_int4pack_mm,
inner_k_tiles=8,offset-binary nibble 打包),因此量化只改变权重数值、不引入任何运行时开销。
2. 量化方法
- 校准语料:6 层分层设计(纯文本 / 语流 / 边界 / 长静音 / 收尾 / 深段),约 6200 个位置, 由 bf16 模型自回归生成,覆盖 RTN 失效的病灶区。
- GPTQ 核心:经典逐列(block 128)惰性批更新,
H = XᵀX带 0.1% 阻尼的 Cholesky 逆 (Hessian 数值秩亏,零阻尼不可解);误差按列补偿。 - 逐层顺序量化:第 L 层的 Hessian 由"已量化"的前 L−1 层产生的激活统计, 使校准分布与部署分布一致(error-propagated)。
- 保护项选择:由三路独立证据(校准相对误差排名、held-out 相对误差、llama.cpp Q4_K_M 配方)
取交集 →
v_proj全 36 层(本档 w2)。 - 保护项的第二批:按绝对误差预算(校准激活上的逐张量局部平方误差占比)增加保护
down_proj第 35/6/16/33 层(分别占 W1 基线总误差的 73.6%/15.6%/4.2%/2.2%,合计 95.5%)。同为 4 个张量的预算若改保上游最差up_proj(第 6/7/9/35 层,仅占 0.61%),tie-robust 增益只有本档的 1/5.7(语言)与 1/12.7(情感),且平均 logit 偏差不降反升(+0.003 vs 本档 −0.307);两支配置形状、体积、速度、显存均相同,故取本档。实测见 gencheck-2-alt4.md / gencheck-3-w2-replacement.md。 - 细分组:g32 是内核支持的最细粒度(g16/g8 内核报错)。
3. 指标(A10G-24G, torch 2.9.1+cu129;数据源 w2 档门禁实测)
| 指标 / Metric | 本档 / This preset | bf16 参考 / Reference |
|---|---|---|
音频 top-25 命中率(tie-robust cover):主指标,40 步 / 1280 位置 | 99.30% | 100% |
| 音频 top-25 命中率(CUDA topk 口径,原门禁口径) | 91.25% | 100% |
语言分层 tie-robust cover 增益(4 语言 × 4 段,相对 W1:g32+v_proj 保护) | +0.545 pt | — |
情感文本 tie-robust cover 增益(6 项,同样相对 W1) | +1.020 pt | — |
| 音频 logit 平均绝对偏差 mean|Δ|(越低越好) | 0.2641 | 0.0006 |
| 文本 argmax 一致率 | 100.0% | 100% |
| 解码速度(稳态) | 78.5 步/s | ~36 步/s |
| 显存驻留峰值 | 8.53 GiB | ~17.0 GiB |
| runaway(12 种子长文本,看门狗关闭) | 0/12 | 0/12(配看门狗) |
| 权重体积 | 7.37 GiB | 16.6 GiB |
GPTQ 档在同 12 个种子上修掉了 RTN int4 的近静音 runaway(RTN:3/12), 长静音 / 收尾段的相对误差约为 RTN g128 的 1/50。
3.1 关于 top-25 数字的口径(重要)
音频 top-25 命中率高度依赖并列(tie)的打破方式,报数必须注明口径。 参考分布上 63.9% 的声道 top1==top2、20.1% 的声道有 ≥25 个值并列在最大值; 在这种分布上"参考 argmax 是否落在候选的前 25 大之内"这句话本身是不唯一的: 同一份 logits,仅改并列打破方式,分数可以从 80.2% 变到 100%(一个与参考逐位相同的 模型也会被打成 86.8%)。本卡因此同时报两个口径:
- tie-robust
cover(推荐):取候选的前 25 大集合,看参考 argmax 的值是否 ≥ 第 25 大的值 —— 并列一律算命中,与任何排序实现无关,可复现、可跨实现比较; - CUDA
topk口径:历史上的门禁口径(torch.topk在 CUDA 上的并列顺序), 与旧版本报告可直接对照。
两个口径的方向一致;幅度不可跨口径比较(tie 主导时旧口径会把同等真实增益放大约 7 倍)。
评估方法、并列证据与全部口径对照见仓库内 gencheck-1-lang-emo.md。
3.2 跨语言验证 / Cross-language validation
基座声明支持 31 种语言;本档已在其中 10 种语言 × 4 条轨迹 = 40 条轨迹上完成 teacher-forced 跨语言验收(zh / en / fr / ja / de / ko / yue / ru / es / ar,覆盖拉丁、汉字、西里尔、阿拉伯、韩文 五种文字系统):
| 项 / Item | 值 / Value |
|---|---|
| 轨迹一致改善 / trajectories improving | 40/40(tie-robust cover;mean|Δlogit| 在 10 种语言上全部同向下降) |
本档相对 W1 的合并增益 / merged W2-vs-W1 gain,tie-robust cover(10 语言等权,轨迹自助 95% CI) | +0.641 pt [+0.59, +0.69] |
| 本档相对 W1 的音频 logit 平均绝对偏差变化 / mean|Δlogit| change(越低越好) | −0.341 [−0.371, −0.303] |
| runaway 观测 / runaway observations(bf16 直生成,看门狗开启) | 0/25,25/25 正常收尾(含本项目首个 RTL 语言:阿拉伯语) |
| 本档水平 / this preset's level on the same corpus | tie-robust cover 99.76%(10 语言等权;逐语言 99.53–99.93),mean|Δlogit| 0.369–0.646 |
Cross-language validation: 10 languages × 4 trajectories = 40 trajectories (zh/en/fr/ja/de/ko/yue/ru/es/ar,
spanning Latin, Han, Cyrillic, Arabic and Hangul scripts). 40/40 trajectories improve under the
tie-robust cover metric and mean |Δlogit| falls in all 10 languages. Merged gain of this preset
over w1 (equal language weight, trajectory bootstrap 95 % CI): cover +0.641 pt [+0.59, +0.69],
mean |Δlogit| −0.341 [−0.371, −0.303]. Runaway 0/25 (25/25 finished, watchdog on, including
this project's first RTL language, Arabic). Both metrics are tie-robust (see §3.1 for the convention
and why the magnitudes are not comparable across conventions). Method, per-language detail and
residual attribution: the quantization acceptance documentation (langcheck-1) in the release
repository. Honest scope: the other 21 of the 31 declared languages were not individually
verified, and this result is not extrapolated to them.
4. 使用方法
# 1) 运行时依赖(仅 4 个第三方包)
pip install torch --index-url https://download.pytorch.org/whl/cu128 # torch>=2.9, CUDA 12.x
pip install numpy soundfile pyyaml
# 2) 本目录(TTS 主模型)
hf download <用户名>/MOSS-TTS-v1.5-W4GPTQ-w2 --local-dir ./MOSS-TTS-v1.5-W4GPTQ-w2
# 或 ModelScope 集合 OpenMOSS-Team/MOSS-TTS;音频 codec 是**独立**检查点,需另行下载:
hf download OpenMOSS-Team/MOSS-Audio-Tokenizer --local-dir ./MOSS-Audio-Tokenizer
# 3) 推理(--model-dir 指向本目录;目录内含 meta.json 时会自动识别量化档)
python -m moss_min "你好,欢迎收听这段试音。" -o out.wav \
--model-dir ./MOSS-TTS-v1.5-W4GPTQ-w2 \
--codec-dir ./MOSS-Audio-Tokenizer
# 等价显式写法:
python -m moss_min "Hello, this is a test." -o out_en.wav --language English \
--model-dir ./MOSS-TTS-v1.5-W4GPTQ-w2 --quant w4gptq
Python API:
from moss_min.export import load_standalone_model # 装配(自动读 meta.json)
from moss_min.fast import generate_fast
from moss_min.prompt import build_tts_prompt
model, fast = load_standalone_model("./MOSS-TTS-v1.5-W4GPTQ-w2") # (MossTTSModel, GptqMossTTS)
prompt = build_tts_prompt("你好,欢迎收听。")
res = generate_fast(fast, prompt, seed=1234) # 之后交给 moss_min.codec 解码
5. 目录内容 / Files
| 文件 / File | 说明 / Description |
|---|---|
quantized.safetensors | int4 打包权重(layers.{i}.{proj}.q / .qsz)+ 全部保 bf16 张量(沿用原检查点 key 名) |
meta.json | 格式版本、量化参数、逐项 group size、bf16 保留清单、基座溯源(含 sha256)、指标 |
README.md | 本模型卡 |
config.json, configuration*.py, modeling_moss_tts.py, processing_moss_tts.py | 原模型配置与参考实现(provenance / 互操作) |
tokenizer.json, vocab.json, merges.txt, tokenizer_config.json, added_tokens.json, special_tokens_map.json, chat_template.jinja | 分词器全套(moss_min 只需要 vocab.json/merges.txt/tokenizer.json) |
LICENSE | Apache-2.0(继承自基座) |
6. 限制声明 / Limitations
- 量化质量权衡:int4 不是 bf16 的位级等价物。音频 top-25 命中率 99.30%(tie-robust 口径)/91.25%(CUDA topk 口径,见 §3.1), 主观质量接近但不能等同于 bf16;对音质极端敏感的场景请使用未量化权重。
- 速度余量很窄:稳态 78.5 步/s,距离本项目 78 步/s 的硬底线只有约 0.6%。 再加任何 bf16 保护项(每 4 个投影约 −3.8%)会跌破底线,需先重新验收速度。
- 仅 CUDA:int4 kernel(
_weight_int4pack_mm)与 CUDA Graph 路径要求 NVIDIA GPU (Ampere/sm_80 及以上);没有 CPU 回退。 - codec 不在本目录:音频解码器 MOSS-Audio-Tokenizer(1.6B) 是独立检查点(~3.6 GB), 需另行下载;仅下载本目录无法出声。
- 看门狗默认开启:连续低能量超过 ~5.12 s(或超长段落尾部已静音)会强制收尾,
以避免失控生成;需要长静音时可调大
--watchdog-silence-frames或--no-watchdog。 - Windows 未实测:仅在 Linux + A10G-24G(torch 2.9.1, CUDA 12.x)上验证; Windows/WSL 与其它 GPU 架构未做验收测试。
- 语言覆盖:基座声明支持 31 种语言,本量化版已在其中 10 种上完成跨语言验收(见上文“跨语言验证”小节),其余 21 种未逐一验证。
- 许可证继承:本量化产物继承基座 Apache-2.0,署名 OpenMOSS-Team;商用请遵循原模型许可与使用条款。
7. 基座溯源 / Provenance
| 基座分片 / Base shard | 大小 | sha256 |
|---|---|---|
model-00001-of-00004.safetensors | 4.59 GiB | 749b82d07cebea77… |
model-00002-of-00004.safetensors | 4.58 GiB | 4d891c8adb8bf9c1… |
model-00003-of-00004.safetensors | 4.64 GiB | 111013e05174e677… |
model-00004-of-00004.safetensors | 2.00 GiB | 951ee88cf85996ee… |
- 基座仓库 / base repo:OpenMOSS-Team/MOSS-TTS-v1.5
- 本地导出源 / exported from:
models/MOSS-TTS-v1.5 - 权重文件 sha256:
478505b4cb3e8b5f44d9ec0a74b865316e163880300468decbd38b93fbaecb31 - 导出时间 / exported at:2026-09-11T08:39:59Z(A10G-24G, torch 2.9.1+cu129)
- 复现脚本 / regeneration:
python -m moss_min.export --model-dir models/MOSS-TTS-v1.5 --gptq-state <w1.pt> --out <dir> --preset w2
8. English summary
This is a self-contained int4 GPTQ quantization of
MOSS-TTS-v1.5 (Qwen3-8B backbone + 32 audio
codebooks + 33 heads, 31 languages). The six backbone projections per layer
(q/k/o/gate/up/down) are int4 (group 32, GPTQ with six-stratum
calibration and error-propagated sequential quantization) while the most
sensitive projections (40 projections kept bf16 — v_proj x36 + down_proj L6/16/33/35) stay bf16; embeddings, heads and norms
are bf16. Runtime kernel is identical to the non-GPTQ w4 tier, so the
quantization costs nothing at inference.
Measured on an A10G-24G with torch 2.9.1+cu129: audio top-25 membership
99.30% (tie-robust cover) / 91.25% (CUDA topk convention,
see §3.1 — the two are not comparable in magnitude), text argmax 100.0%,
78.5 steps/s, 8.53 GiB resident VRAM, runaway 0/12
(12 seed long-form battery, watchdog off), 7.37 GiB on disk.
Install torch/numpy/soundfile/pyyaml, download the separate
MOSS-Audio-Tokenizer codec, then:
python -m moss_min "Hello, this is a test." -o out.wav \
--language English --model-dir <this directory>
Limitations: int4 quality trade-off (not bit-equivalent to bf16), CUDA-only int4 kernel, codec checkpoint not included, run-away watchdog on by default (~5.12 s of consecutive low-energy frames forces an audio end), validated on Linux + A10G only (Windows untested), license inherited from the Apache-2.0 base model (attribution: OpenMOSS-Team).