Closed
fix(normalize_bbox): 修复FP16大除数精度并补齐推导校验 #13275
raoliang_sacAdd on 21 days agoClosed at 18 days ago
fix(normalize_bbox): 修复FP16大除数精度并补齐推导校验 #13275
Closed
raoliang_sacAdd on 21 days agoClosed at 18 days ago
raoliang_sac
raoliang_sacCollaborators
21 days ago

描述

在Ascend 950上复现了FP16精度问题:boxes=1000、INT32高宽为65536时,旧内核把除数转为FP16后溢出为Inf,三个编译路径均输出0,正确结果应为0.0152587890625。旧GPU参考重复了同样的转换,导致cross_check误判通过。

  • 高宽保留FP32,FP16坐标提升为FP32后做除法,最后舍入一次;同步计算所需UB和最小容量校验,TilingData布局不变。
  • 修正数学参考和GPU参考,避免复制内核中的有损转换。
  • 在InferShape校验已知rank、shape_hw结构、batch及坐标维;在op_graph的InferDataType校验输入类型,保留未知维、未知rank和合法空Tensor。
  • 非法参数使用已有的语义诊断宏,错误只在根因处上报;补充对应UT及一个8条小shape的ST CSV。

关联的Issue

https://gitcode.com/cann/ops-nn/issues/7869

测试

  • 最新主线源码构建未修改包,复现上述FP16错误;用修正后的参考验证旧内核仍失败。
  • 950 Kernel:26条小用例,dyn/cst/bin均通过,含普通/反向布局、rank8、空Tensor、尾块和真正次正规数。
  • 950 GE:26/26通过;动态shape/rank 4/4通过;FP16/FP32在同一Session、同一图中完成rank3→2→4→8→3复用并核对输出。
  • 最终注册回调21/21符合预期;13条新增负向诊断均核对参数字段和单次首报。Host 54条、Graph 1条UT通过ASan,未启用泄漏检测。
  • 交付C++示例FP16/FP32实际运行并核对输出;A3存量包4/4 GE兼容用例通过。
  • 标准预编译包构建及安装通过,构建并行度4;安装内容与CPack payload核对一致,最终包GE冒烟通过。pre-commit通过。

本地CI(2026-11-02):受测提交825bef907433a4a2d75cfce7709dfe1ab950dada,基线为本次从主仓拉取的master 38c4bfb26461bf4b4f012e47ff32b4f7f6b5cb01。已先squash为单提交并核对原基点下完整binary diff及Git tree不变,再rebase;range-diff一致、无冲突。统一入口/workspace/CI-skills/ci_local_check.sh通过,覆盖ascend950、ascend910b的定向编包与相关UT,完整pre-commit、隔离OAT、链接/SKIP契约和golden语法检查均通过。Host UT各54条、Graph ASan各1条实际执行通过(0跳过);ASan未启用泄漏检测。使用任务内CANN 9.3.0 C25B114,构建并行度4;本次未新增TTK/NPU ST,也不将本地通过表述为线上通过。

文档更新

按现行官方模板及文档修改指引修正调用表头,将产品差异保留在已有约束列表中。纠正5类存量产品被标为不支持的问题:主线canndev仍有对应实现配置,原静态shape、3D及非空限制保留。A3已实测,其他存量产品仅核查源码配置。不把内部TF插件列为用户接口。

类型标签

AI/Agent生成声明

likedislike
The current Pull Request has been closed by raoliang_sac.
raoliang_sacraoliang_sacCollaborators
21 days ago Created pull request, commit 85d7a1f2
raoliang_sacraoliang_sacCollaborators
21 days ago Modify description of pull request
CANN-robotCANN-robotCollaborators
21 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
21 days ago Comments:

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

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
*/*/README.md ❌ (0/2)(You can also ask: 范其瑞, 杨露, 冯英, 杜慧萍, 苏跃明) ❌ (0/1)(You can also ask: 杨露, 陈娇, 杜慧萍, 冯英, 蔡雯雯)
vfusion ❌ (0/2)(You can also ask: 陈展熹, 汤平川, 杨东, 於欣洁, 胡碧霞) ❌ (0/1)(You can also ask: 杨东, 陈展熹, 汤平川, 钱泽洪, 上官秦南)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

raoliang_sac, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
21 days ago Set zengjuan,u010470851,chenfeng61,chaotang233,crystalhu,yu-xinjie62,yangyang016,fanqirui,gitee-duhuiping,su-yueming,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,gitcode-chenjiao,east_yang,pingchuantang,qianzehong,fengying555682,caiwenwen,yanglu-1 as approver
11 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
19 days ago Removed label: stat/needs-squash
CANN-robot
CANN-robotCollaborators
19 days ago Comments:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: cann-cla/yes
6 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
19 days ago Added label: cann-cla/yes
raoliang_sac
raoliang_sacCollaborators
19 days ago Comments:

compile

likedislike
raoliang_sacraoliang_sacCollaborators
19 days ago Pre merge succeeded (commit_id: 92bcdd4b42e1a459101a34e16ada58bb7def6359)
CANN-robot
CANN-robotCollaborators
19 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-passed
yuning_chen
yuning_chenCollaborators
19 days ago Comments:
likedislike
raoliang_sacraoliang_sacCollaborators
18 days ago Close pull request