| Files | Last commit | Last update |
|---|---|---|
fix(confusion_matrix): 转测验证轮修复——输入校验加固 + golden 按 TTK 三方比对规范收敛 Co-authored-by: SeanDictionary<b24081019@njupt.edu.cn> # message auto-generated for no-merge-commit merge: !6337 merge feat/confusion-matrix into master fix(confusion_matrix): 转测验证轮修复——输入校验加固 + golden 按 TTK 三方比对规范收敛 Created-by: SeanDictionary Commit-by: SeanDictionary Merged-by: cann-robot Description: ## 描述 上一轮合入(!5444,squash 529263d53)后转测验证发现的修复,共 5 个提交: 1. **kernel ResetBins 越界守卫**(956061214): confusion_matrix_simt_not_full_load_ub.h 的 ResetBins 补 blockIdx_ >= resetBinsCoreNum_ 早退,与另两策略对齐,消除核数关系变化时的越界零写风险。 2. **InferShape 输入校验**(956061214):labels/predictions 一维 + shape 一致 + weights shape 一致校验,非法输入报 GRAPH_FAILED;proto 注释同步修正(y 为 2D [nc,nc],dtype 由 dtype/weights 映射决定,原注释继承了 canndev 历史笔误)。 3. **GEIR.02**(b72e7ab57):weights dtype 校验从 InferDataType 移到 tiling CheckDtype——仅非空 weights 校验与输出 dtype 一致,空张量豁免(空 weights 任何 dtype 合法,与 A2 语义一致)。 4. **INFER-EXC-001**(6b5f7f962):tiling CheckDtype 独立校验 labels/predictions 输入 dtype(五类合法集 + 两两一致),堵住非法 dtype 组合静默进内核。 5. **golden 规范化**(0081d4af5):出口零 cast(_compute 已按 TTK 下发的 output_dtypes 决定累加/窄回精度,去除 Promote 下为 no-op 的二次 astype);@staticmethod 加固;修正 _Compose 与模块 docstring 中与代码不符的描述。等价性验证:新旧 golden 全 dtype×weights×两方/三方 20/20 逐位一致。 6. **clang-format**(d628520fe):3 个文件按 CI 同版本 clang-format 18.1.8 重排,纯换行调整无语义变化。 ## 关联的Issue [#3578](https://gitcode.com/cann/ops-math/issues/3578) ## 测试 Ascend950DT_9592 真机(TTK 2.8.0,Rev d628520fe): - **UT**:build.sh -u --ophost --ops=confusion_matrix --soc=ascend950 **20/20 PASS**(tiling 12 含新增 empty_weights_dtype_exempt / weights_dtype_mismatch / input_dtype_mismatch / input_dtype_unsupported;infershape 8 含 shape_mismatch / rank2_rejected / weights_shape_mismatch)。 - **ST 真机**:仓内 12 例(5 f32 + 2 f16 + 5 整数)**12/12 PASS**。 - **GEIR 通路**:55 例**全部通过**——整数 32/32 binary_equal(原判据);浮点 23/23 两方比对 close PASS(三方 cross_check 因当前环境 GPU 竞品端点缺失以两方比对替代,判据声明不变)。 - **golden 等价性**:新旧实现 5 输出 dtype × 有无 weights × 两方/三方 20 组逐位一致;TTK TestSpecManager validate PASS。 ## 文档更新 - README.md 约束说明同步(weights==y dtype 一致性声明)。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6337 | 1 month ago |