QLean模型量化工具 (v0.1.0 post1)
更新时间:
复制为 MD 格式
工具安装
发布了whl包,可在PIP源List中查看并通过pip install方式使用。
# 安装依赖
pip install triton_kernel==1.0.0+ppu2.0.0.oe
# 安装qlean
pip install qlean==0.1.0+ppu2.0.0post1工具使用
一. Qwen3.5的W8A8-INT8量化
编写Qwen3.5-recipe.yaml。
--- quant_stage: quant_modifiers: qwen35Day0Modifier: ignore: ["re:.*lm_head", "re:.*embed_tokens", "re:visual.*", "re:model.visual.*", "re:.*mlp.shared_expert_gate$", "re:.*mlp.gate$", "re:.*conv1d$", "re:.*in_proj_a$", "re:.*in_proj_b$", "re:.*fc$", "re:.*pre_fc_norm_embedding$", "re:.*pre_fc_norm_hidden$"] scheme: W8A8 ...输入原始模型路径和量化模型路径,进行W8A8-INT8 量化。
qlean --model_name Qwen/Qwen3.5 --model_path /path/to/Qwen3.5/ --save_path /path/to/Qwen3.5-INT8/ --recipe /path/to/Qwen3.5-recipe.yaml
二. GLM-5的W8A8-INT8量化
编写GLM-5-recipe.yaml。
--- quant_stage: quant_modifiers: generalDay0Modifier: ignore: ["re:.*lm_head", "re:.*embed_tokens", "re:.*mlp.gate$", "re:.*mlp.shared_expert_gate$", "re:.*linear_attn.*", "re:.*self_attn.*"] scheme: W8A8 ...输入原始模型路径和量化模型路径,进行W8A8-INT8 量化。
qlean --model_name zai-org/GLM-5 --model_path /path/to/GLM-5/ --save_path /path/to/GLM-5-INT8/ --recipe /path/to/GLM-5-recipe.yaml
该文章对您有帮助吗?