Repository navigation
feat(examples): add quantization examples for glm5_3_flash_w4a8_int8 - #9
Merged
Merged
Conversation
Contributor
Author
|
@zhengyq-git Please review it, thanks |
There was a problem hiding this comment.
AI Review
🟢 未发现有明确证据的问题
在已提供并完成审查的 diff 范围内未形成可确认问题。
变更概览
本次变更主要包含:
- 在 examples/glm 示例文档中新增 GLM-5.3-Flash INT4 w4a8 通道量化脚本的调用示例,并将既有 w8a8 示例的输出目录名称大小写调整。
- 新增 GLM-5.3-Flash 的 FP8 到混合精度 INT4(INT4-channelwise W4A8)/INT8 权重量化转换示例脚本,可见部分定义 int4 对称量化常量(scale=abs_max/7、零点8)及 compressed_tensors 缺失时等价的 pack_to_int32 内嵌打包实现。
- examples/glm/quantize_glm5_3_flash_int4_channel.py 新增常量定义、scale/packed 权重命名辅助函数,以及按张量后缀与层号识别量化目标的函数(routed experts 限 layer 3-44 走 INT4,MLA 投影保 BF16,linear-attn/indexer 走 INT8)。
- 新增 GLM-5.3 flash 量化示例脚本的基础算子:FP8 128x128 blockwise 反量化、对称 INT8/INT4 per-output-channel 量化,以及 INT4 的 int32 打包实现,供单 shard 转换函数调用。
文件审查摘要
| 文件 | 变更 | 审查结果 |
|---|---|---|
examples/glm/quantize_glm5_3_flash_int4_channel.py |
新增 · +1161/-0 | — |
examples/qwen/quantize_qwen3_8_flash_next_int4_w4a16.py |
修改 · +18/-3 | — |
examples/glm/README.md |
修改 · +5/-1 | — |
审查信息
- 变更统计:3 个文件,+1184/-4。
- 覆盖情况:共 3 个文件,已完整审查 3 个。
- 候选问题:2 项;证据复核过滤:2 项;发布前敏感信息保护:0 项。
- 本服务以 GitHub 提供的 PR diff 为审查主体,PR 描述与按相关性选取的仓库片段仅用于核验;未执行代码或重跑测试,结论仍需维护者核验。
AI Review审查尚未完整完成,无法给出整体结论;当前没有可发布的已确认问题,不代表代码没有问题。
|
zhengyq-git
approved these changes
Oct 8, 2026
zhengyq-git
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.