Files
Sun Ruoxi 72c88c849d update README
Signed-off-by: Sun Ruoxi <sunruoxi@4paradigm.com>
2026-10-23 15:02:45 +08:00

25 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 本项目基于天数智芯官方的量化方案对GLM-5进行量化
原压缩包地址:
>sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn
>get /client_tmp/support/quant/w4a8_w8a8_quant.tar.gz .
## 新增
dev/configs/w4a8_int/glm5_nn_g64.yml
# 修改
| 文件 | 必要改动 |
|---|---|
| `functions/config_builder/__init__.py` | 将 `glm_moe_dsa` 交给 `Qwen3MoEQuantConfigBuilder`,按 GLM-5 源权重的 `128×128` FP8 block scale 反量化。 |
| `core/kernels/pytorchs/int4_pack8.py` | `quant_repack_int4()` 最后一个参数改为 `not symmetric`;该接口参数名实际是 `isAsymQuant`。 |
| `functions/quant.py` | 仅在存在 `i8zeros` 时写入;分组 scale 的输出键改为 `专家名.i8_weight_scale`,与当前 vLLM 参数名一致。 |
| `utils.py`、`main.py` | 将 `group_size: 64` 写入压缩元数据,权重策略设为 `group`;检查全部分片是否生成。 |
| `main.py` | 缺少 `natsort` 时使用 `sorted`,适用于这些已补零的分片文件名。 |
当前压缩元数据中的 `num_bits` 仍为 `8`,这是这版 Iluvatar W4A8 加载器使用的描述方式;实际专家权重是打包的 INT4,由启动时的 `VLLM_W8A8_MOE_USE_W4A8=1` 选择相应加载器。
## 量化方式:
>PYTHONUNBUFFERED=1 OMP_NUM_THREADS=1 \
> python main.py --config configs/w4a8_int/glm5_nn_g64.yml /mnt/data/models/ZhipuAI/glm5-nn-g64-quant.log 2>&1