Pull Request已成功合入, 合并人@CANN-robot
(感谢 季骏 的贡献)Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| quant | ✅ 苏跃明, 陈琦 (2/2) | ✅ 陈琦, 苏跃明 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ji-jun1, thanks for your pull request. All authors of the commits have signed the CLA. 👍


变更摘要
此 PR 主要修复了 DynamicMxQuantTailAxisTiling 在计算 maxUbBlockNum 时因未预留 UB(统一缓冲区)空间而可能导致 AI Core 运行时错误(aicerr)的问题。通过在 UB 大小中扣除 2KB 的预留空间后再进行块数划分,避免缓冲区溢出。
主要改动
- 新增
RESERVED_UB_SIZE常量:在dynamic_mx_quant_tail_axis_tiling_arch35.cpp中新增constexpr int64_t RESERVED_UB_SIZE = 2 * 1024,为 UB 计算预留 2KB 安全空间。 - FP4 和 FP8 目标类型的
maxUbBlockNum计算修正:在DoTiling()中,针对 FP4(DT_FLOAT4_E2M1/DT_FLOAT4_E1M2)和 FP8(DT_FLOAT8_E5M2/DT_FLOAT8_E4M3FN)两种目标类型分支,将tilingParam_.maxUbBlockNum的计算由tilingParam_.ubSize / ...改为(tilingParam_.ubSize - RESERVED_UB_SIZE) / ...,确保在划分 UB 块时留有缓冲余量。


代码审查
审查总结
本次审查覆盖了 1 个变更文件:
| 文件 | 审查结果 |
|---|---|
quant/dynamic_mx_quant/op_host/arch35/dynamic_mx_quant_tail_axis_tiling_arch35.cpp |
1 个 P2 问题 |
问题统计:P0: 0, P1: 0, P2: 1, P3: 0
整体风险评估:低风险。该变更的核心逻辑(在 UB 分配中预留 2KB 空间以防止 UB 溢出)是正确的,与同仓库中另一个 tiling 文件已有的 RESERVED_UB_SIZE 用法一致。唯一需要注意的是 (ubSize - RESERVED_UB_SIZE) 在理论边界(ubSize ≤ 2048)下缺乏防御校验,但在真实 Ascend 硬件上 UB 远大于此值,触发概率极低。建议添加防御性检查以增强代码健壮性。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
DynamicMxQuant fuzz测试存在aicerr
关联的Issue
#3836
测试
已通过st测试,fuzz测试
文档更新
NA
类型标签
AI/Agent生成声明