已合并
dynamic_mx_quant fix aicerr #6938
季骏创建于 7月2日
dynamic_mx_quant fix aicerr #6938
已合并
季骏创建于 7月2日
季骏
季骏
7月2日

描述

DynamicMxQuant fuzz测试存在aicerr

关联的Issue

#3836

测试

已通过st测试,fuzz测试

文档更新

NA

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 季骏 的贡献)
季骏季骏
7月2日 创建了 pull request,commit 1d830ba3
CANN-robotCANN-robot成员
7月2日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月2日 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
atomgit-bot
atomgit-bot
7月2日 评论:

变更摘要

此 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 块时留有缓冲余量。
likedislike
atomgit-bot
atomgit-bot
7月2日 评论:

代码审查

审查总结

本次审查覆盖了 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 远大于此值,触发概率极低。建议添加防御性检查以增强代码健壮性。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
此处折叠了55条消息 查看更多
chenqi317成员
7月6日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
7月6日 添加了label:lgtm
CANN-robotCANN-robot成员
7月6日 关闭了关联的issue
CANN-robotCANN-robot成员
7月6日 合入了pull request
CANN-robot
CANN-robot成员
7月6日 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike