已合并
dynamic_mx_quant 小尾轴场景性能优化 #10030
季骏创建于 29 天前
dynamic_mx_quant 小尾轴场景性能优化 #10030
已合并
季骏创建于 29 天前
季骏
季骏
29 天前

描述

-2轴量化,尾轴很小时,当前实现性能比较差,本PR通过多行合并计算的方式提升了性能

关联的Issue

#5715

测试

已通过ST测试

文档更新

不涉及

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 季骏 的贡献)
季骏季骏
29 天前 创建了 pull request,commit 90c26a1d
atomgit-bot
atomgit-bot
29 天前 评论:

变更摘要

本 PR 针对 dynamic_mx_quant 在 2 轴量化中尾轴很小时性能较差的问题进行性能优化,核心思路是通过多行合并计算的方式提升计算效率。改动涉及 op_kernel/arch35 下的两个内核头文件:dynamic_mx_quant_not_tail_axis_optimize_high_perf_large_tail.h 中调整了 half 转 bfloat16_t 的转换 trait 命名及调用,dynamic_mx_quant_not_tail_axis_optimize_high_perf_small_tail.h 则进行了大规模改动以实现小尾轴场景下的性能优化。

主要改动

  • 重命名转换 trait: 在 dynamic_mx_quant_not_tail_axis_optimize_high_perf_large_tail.h 中,将 static constexpr Reg::CastTrait castTraitCublsHalf2Bf16 重命名为 castTraitCeilAlgHalf2Bf16,保持原有 CAST_RINT 舍入配置与 ZEROING 掩码合并模式不变。
  • 更新转换调用点: 同步更新该文件中两处 Reg::Cast<bfloat16_t, xDtype, ...> 调用(对 x0AbsU16、x1AbsU16 的 half 绝对值数据做 bfloat16_t 转换),使其引用重命名后的 castTraitCeilAlgHalf2Bf16。
  • 小尾轴场景大规模优化: 对 dynamic_mx_quant_not_tail_axis_optimize_high_perf_small_tail.h 进行大幅改动(新增 2001 行、删除 1156 行),依据 PR 描述通过多行合并计算方式优化尾轴很小时的量化计算性能。
likedislike
不准确?
atomgit-bot
atomgit-bot
29 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
29 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
29 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


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
CANN-robotCANN-robot成员
29 天前 将zengjuan,sxb154714,chenfeng61,chaotang233,crystalhu,yangyang016,fanqirui,su-yueming,zhajianqing123,chenqi317,LinPX,wang-xing001,liubo75,tangweiwei2,wangzitao_leo,xubinglin,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,liuyang_806设为评审人
CANN-robotCANN-robot成员
29 天前 将sxb154714,chenfeng61,su-yueming,zhajianqing123,LinPX,wang-xing001,wangzitao_leo,xubinglin,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,liuyang_806设为审查人
季骏
季骏
29 天前 评论:

compile

likedislike
季骏季骏
29 天前 预合并成功(commit_id: ffd885b7734e6e162a70343b82d335f0deeedee4)
CANN-robot
CANN-robot成员
29 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
29 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-failed
yuning_chen
yuning_chen成员
29 天前 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
季骏季骏
29 天前 预合并成功(commit_id: 8260cf5a5f179d26ff811ac33a2afa1a7b2a6b90)
季骏季骏
29 天前 强制推送  1 个提交:b134f4bf-dynamic_mx_quant prof optimize
季骏季骏
29 天前 预合并成功(commit_id: 6b9a82240ed7128a8cae2cae923e79adeebff017)
CANN-robotCANN-robot成员
29 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
29 天前 添加了label:cann-cla/yes
季骏
季骏
29 天前 评论:

compile

likedislike
季骏季骏
29 天前 预合并成功(commit_id: e3cd4f3dcfafed3602212aeff6696471255c8d95)
CANN-robot
CANN-robot成员
29 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
29 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
29 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-passed
yuning_chen
yuning_chen成员
29 天前 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
季骏季骏
28 天前 修改了pull request 的描述
季骏
季骏
28 天前 评论:

/check-pr

likedislike
CANN-robot
CANN-robot成员
28 天前 评论:

The following labels are not ready.

lgtm: Please wait for committers to review the code.

approved: Please wait for committers to review the code.

likedislike
su-yueming成员
26 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
26 天前 添加了label:approved
wang-xing001成员
26 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
26 天前 添加了label:lgtm
CANN-robotCANN-robot成员
26 天前 关闭了关联的issue
CANN-robotCANN-robot成员
26 天前 合入了pull request