| Files | Last commit | Last update |
|---|---|---|
feat(confusion_matrix): golden 注册 e2e(tf) 通路并真机验证 Co-authored-by: SeanDictionary<b24081019@njupt.edu.cn> # message auto-generated for no-merge-commit merge: !6983 merge feat/confusion-matrix into master feat(confusion_matrix): golden 注册 e2e(tf) 通路并真机验证 Created-by: SeanDictionary Commit-by: SeanDictionary Merged-by: cann-robot Description: ## 描述 补齐 ConfusionMatrix 的 e2e(tf) 通路 golden 注册与真机验证,共 2 个提交: 1. **注册 e2e(tf) 通路**(d8dd47bcf): __spec__ 新增 tf.math.confusion_matrix → ConfusionMatrixTfE2eSpec,参照仓内 left_shift 的 LeftShiftTfSpec 范式——tf 仅为**驱动接口**,精度标杆对标算子语义,真值与 kernel/geir 共用同一套 torch 标杆 _compute;third_party 复用 _Compose,tolerance 与 kernel 一致;通路支持表 e2e 行同步(tf ✅ / torch ❌)。 2. **位置实参解析修复**(8751c1fba):TTK e2e 依 API 签名顺序组装实参,标量属性 const-fold 为位置实参(num_classes 落第 3 位、dtype 落第 5 位),golden 改按签名位置解析 labels/predictions/num_classes/weights/dtype——修复整数用例 dtype 丢失导致比对 0% 的问题。 路由事实(已写入 Spec 注释):CANN 9.2.0 GE 的 support_fusion_pass.json 白名单不含 ConfusionMatrixFusionPass,950 上 tf.math.confusion_matrix 分解图不融合、本算子不参与该通路执行;本通路验证 **tf 前端 API 语义在 NPU 上的正确性**,命中算子的通路仍为 GE 图模式(geir)。 本 PR 仅改动 tests/assets/golden.py,不触碰算子本体(op_host/op_kernel/op_graph 零变更)。 ## 关联的Issue [#4396](https://gitcode.com/cann/ops-math/issues/4396) ## 测试 真机 Ascend950DT_9592 V120(CANN 9.2.0,TF 2.6.5 + npu_device 2.6.5,TTK 3.0.0): - **TTK e2e(tf.math.confusion_matrix)**:7/7 PASS——float32/float16/int32/int8/uint8 五种输出 dtype × 有/无 weights × nc=1 边界;整数 binary_equal 逐位,浮点两方 close(cross_check 三方对标因当前环境 GPU 竞品端点缺失暂以两方替代,判据声明不变)。 - **golden 单测**:4 位/5 位实参、np.str_ 标量、标量张量、tf.DType 对象、kwargs 等形态解析全部通过;TTK TestSpecManager validate PASS。 - Eager 分解图在 NPU 上逐原语执行正常(Cast/Pack/Transpose/SparseTensorDenseAdd 执行清单实测)。 ## 文档更新 - golden.py 通路支持表与路由注释更新(e2e(tf) 支持性与融合白名单事实)。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:测试通路扩展(e2e tf 通路 golden 注册与真机验证) See merge request: cann/ops-math!6983 | 9 days ago | |
feat(confusion_matrix): golden 注册 e2e(tf) 通路并真机验证 Co-authored-by: SeanDictionary<b24081019@njupt.edu.cn> # message auto-generated for no-merge-commit merge: !6983 merge feat/confusion-matrix into master feat(confusion_matrix): golden 注册 e2e(tf) 通路并真机验证 Created-by: SeanDictionary Commit-by: SeanDictionary Merged-by: cann-robot Description: ## 描述 补齐 ConfusionMatrix 的 e2e(tf) 通路 golden 注册与真机验证,共 2 个提交: 1. **注册 e2e(tf) 通路**(d8dd47bcf): __spec__ 新增 tf.math.confusion_matrix → ConfusionMatrixTfE2eSpec,参照仓内 left_shift 的 LeftShiftTfSpec 范式——tf 仅为**驱动接口**,精度标杆对标算子语义,真值与 kernel/geir 共用同一套 torch 标杆 _compute;third_party 复用 _Compose,tolerance 与 kernel 一致;通路支持表 e2e 行同步(tf ✅ / torch ❌)。 2. **位置实参解析修复**(8751c1fba):TTK e2e 依 API 签名顺序组装实参,标量属性 const-fold 为位置实参(num_classes 落第 3 位、dtype 落第 5 位),golden 改按签名位置解析 labels/predictions/num_classes/weights/dtype——修复整数用例 dtype 丢失导致比对 0% 的问题。 路由事实(已写入 Spec 注释):CANN 9.2.0 GE 的 support_fusion_pass.json 白名单不含 ConfusionMatrixFusionPass,950 上 tf.math.confusion_matrix 分解图不融合、本算子不参与该通路执行;本通路验证 **tf 前端 API 语义在 NPU 上的正确性**,命中算子的通路仍为 GE 图模式(geir)。 本 PR 仅改动 tests/assets/golden.py,不触碰算子本体(op_host/op_kernel/op_graph 零变更)。 ## 关联的Issue [#4396](https://gitcode.com/cann/ops-math/issues/4396) ## 测试 真机 Ascend950DT_9592 V120(CANN 9.2.0,TF 2.6.5 + npu_device 2.6.5,TTK 3.0.0): - **TTK e2e(tf.math.confusion_matrix)**:7/7 PASS——float32/float16/int32/int8/uint8 五种输出 dtype × 有/无 weights × nc=1 边界;整数 binary_equal 逐位,浮点两方 close(cross_check 三方对标因当前环境 GPU 竞品端点缺失暂以两方替代,判据声明不变)。 - **golden 单测**:4 位/5 位实参、np.str_ 标量、标量张量、tf.DType 对象、kwargs 等形态解析全部通过;TTK TestSpecManager validate PASS。 - Eager 分解图在 NPU 上逐原语执行正常(Cast/Pack/Transpose/SparseTensorDenseAdd 执行清单实测)。 ## 文档更新 - golden.py 通路支持表与路由注释更新(e2e(tf) 支持性与融合白名单事实)。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:测试通路扩展(e2e tf 通路 golden 注册与真机验证) See merge request: cann/ops-math!6983 | 9 days ago | |
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 | 28 days ago |