已关闭
[confusion_matrix] 转测验证发现:输入校验缺口与 golden 实现问题(修复见关联 PR) #3578
shengle创建于  18 天前关闭于  18 天前
shengle
shengle成员
18 天前 创建

问题描述

ConfusionMatrix(Ascend950/arch35,!5444 合入)转测验证轮发现以下问题:

1. batch_load 策略 ResetBins 缺越界守卫

op_kernel/arch35/confusion_matrix_simt_not_full_load_ub.h 的 ResetBins 缺 blockIdx_ >= resetBinsCoreNum_ 早退,与 full_load / not_full_load_gm 两策略不一致。当前 tiling 判据下为 benign,但核数关系或参数调整后多余核会以越界 headIndex 零写 GM。

2. InferShape 输入校验缺失

labels/predictions 的秩(仅接受 1D)、shape 一致性、weights shape 一致性均无校验,非法输入静默进内核。

3. weights dtype 校验位置不当(GEIR.02)

weights 与输出 dtype 的一致性校验放在 InferDataType,会对空 weights 张量(合法组合,缺省权重 1)误拒。校验应移到 tiling CheckDtype 且仅对非空 weights 生效。

4. tiling 门禁缺输入 dtype 独立校验(INFER-EXC-001)

tiling CheckDtype 未独立校验 labels/predictions 输入 dtype(五类合法集 + 两两一致),依赖前置门禁,非法 dtype 组合存在静默进内核的路径。

5. golden 实现与注释问题

  • 出口按 output_dtypes 二次 astype:三方比对(Promote)下为 no-op 且隐式依赖 TTK 传递行为;
  • _Compose docstring 声称"浮点输出 cast 回 NPU 输出 dtype"与代码不符(浮点路径实际无 cast);
  • 模块 docstring "int32 中转防 scatter_add 回绕"措辞失实(回绕恰是目标语义,等价依据是模 2^n 环同态)。

环境信息

  • 算子:math/confusion_matrix(Ascend950 / arch35 / SIMT)
  • 基线:529263d53(!5444 squash 合入)
  • 验证环境:Ascend950DT_9592 V120,CANN 9.2.0,TTK 2.8.0

修复

见关联 PR。

likedislike
shengle
shengle成员
18 天前 评论:

修复 PR:#6337(feat/confusion-matrix 分支,含 UT 20/20、ST 真机 12/12、GEIR 55/55 回归验证)

likedislike
shengleshengle成员
18 天前 将 SeanDictionary 设为负责人
CANN-robotCANN-robot成员
18 天前 关闭了 issue
CANN-robotCANN-robot成员
17 天前 添加了label:resolved