TADA-1B 是一个基于 Llama 3.2 1B 的语音生成模型,通过 Text-Acoustic Dual Alignment 实现语音和文本的 1:1 对齐。本项目提供其在华为 Ascend NPU 环境下的部署方案。
| 项目 | 版本/内容 |
|---|---|
| 设备 | Ascend 910B |
tada-1b-ascend/
├── inference.py # 精度测试脚本
├── test.log # 测试日志
├── README.md # 本文档
└── graphics/ # 评估图表 (CER, MOS, etc.)source /usr/local/Ascend/ascend-toolkit/set_env.sh模型文件应放在 tada-1b/ 目录下:
cd tada-1b-ascend/
python3 inference.py --precision_testcd tada-1b-ascend/
python3 inference.py| 指标 | 实测值 | 阈值 | 状态 |
|---|---|---|---|
| Max Error (sum) | 2.44e-04 | < 1e-3 | PASS |
| Max Error (mean) | 1.46e-11 | < 1e-5 | PASS |
| Max Error (std) | 7.45e-09 | < 1e-5 | PASS |
| 操作 | 耗时 |
|---|---|
| 模型加载 | ~37s |
| CPU 参考计算 (20 tensors) | 0.73s |
| NPU 推理 (20 tensors) | 0.65s |
| 完整推理 (1, 32 tokens) | ~0.4s |
完整测试日志保存在 test.log
TADA-1B 基于 Llama 3.2 1B 架构:
| 组件 | 参数 | 说明 |
|---|---|---|
| embed_tokens | 128256 x 2048 | 词嵌入层 |
| layers (16层) | 每层 LlamaDecoderLayer | Transformer层 |
| norm | RMSNorm(2048) | 最终归一化 |
| lm_head | 2048 x 128256 | 语料库投影 |
A: 检查 NPU 驱动是否正确安装,确保 CANN 环境变量已 source。
A: 首次加载需要解析 safetensors,完整模型推理时间约 0.4s/32 tokens。
A: 大型 embedding 层在 BF16/F32 转换时有累积误差,已在精度测试中排除。
本项目遵循 Llama 3.2 Community License。