Closed
[Bug-Report|缺陷反馈]: Sort arch35 正负零符号恢复失效及归并偏移溢出 #4738
黄晓彬Add on  8 days agoClosed at  5 days ago
黄晓彬
黄晓彬Collaborators
8 days ago Create

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

一、问题描述 (必填)

Sort arch35 存在两处正确性隐患:

  • 正负零恢复时两次 UpdateMask 共用被修改的计数,导致索引 mask 为空,-0.0 符号恢复失效。
  • 归并路径的行号及 GM 偏移乘积在 32 位计算,超限时可能回绕;赋值给 64 位变量不能避免中间溢出。

二、环境信息 (可选)

Ascend950DT_9574,TTK v3.0.0。

三、重现步骤 (可选)

  • 正负零:FP16 输入 (1600, 6, 296),axis=0、稳定升序、int64 索引,注入混合正负零并逐位比较输出。
  • 溢出:静态检查归并轮次、并行行数及轴长的乘积类型;超出 uint32 范围时存在回绕风险。

四、预期结果 (可选)

保留原始正负零符号和稳定排序索引,行号及 GM 偏移使用 64 位运算避免回绕。

💡 备注(选填)

修复 PR:https://gitcode.com/cann/ops-math/merge_requests/7400

likedislike
黄晓彬黄晓彬Collaborators
8 days ago Added label: bug-report
黄晓彬黄晓彬Collaborators
7 days ago Associated pull request
CANN-robotCANN-robotCollaborators
5 days ago Close issue
CANN-robotCANN-robotCollaborators
5 days ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
5 days ago Added label: resolved