已关闭
[Bug-Report|缺陷反馈]: AccumulateNV2 golden 三方绑定 eager 直调 TF stub 算子必报 no registered kernels,三方比对无法执行 #4251
wangweidong创建于 7 天前关闭于 6 天前
7 天前 添加了label:bug-report
wangweidong
7 天前 评论:
7 天前 评论:
/assign @gcw_YBIAEfqJ


7 天前 将 gcw_YBIAEfqJ 设为负责人
6 天前 关闭了 issue
6 天前 添加了label:resolved
Describe the current behavior / 问题描述
math/accumulate_nv2/tests/assets/golden.py(master 基线 cb6b7761)ThirdPartyTF 三方绑定存在两处缺陷:golden.py:199以self._accumulate = tf.raw_ops.AccumulateNV2直接 eager 调用 raw op。而tf.raw_ops.AccumulateNV2是 TF 从未编译过 kernel 的 stub 占位算子(官方源码列入OPS_WITHOUT_KERNEL_ALLOWLIST):图模式由AccumulateNV2RemovePass(accumulate_n_optimizer.cc,PRE_PLACEMENT 优化 pass)重写为 TemporaryVariable+AssignAdd 顺序累加链;eager 模式 Python wrapper 直接回退add_n。因此 TTK xpu-server 三方执行直接调用 raw op 必报 "no registered kernels"(两台 GPU server 与本地 CPU 均实测复现),与 TF 版本、服务器环境无关。golden.py:209对所有输入先np.asarray拉回 host 做 numpy broadcast 再转回 TF 张量,三方执行并未真正在 dispatch 设备(GPU)上运行,--xpu-perf采集的三方数据不代表真实 GPU 执行。影响:TTK 三方比对(浮点 cross_check L1 必须三方参与)对 AccumulateNV2 无法执行;三方性能数据失真。
Environment / 环境信息
OPS_WITHOUT_KERNEL_ALLOWLIST、accumulate_n_optimizer.cc)Steps to reproduce the issue / 重现步骤
no registered kernels,比对失败。Describe the expected behavior / 预期结果
tf.function包一层走图模式路径:由 TF 官方AccumulateNV2RemovePass重写为 TemporaryVariable+AssignAdd 链执行,原始 dtype 顺序累加、不升精度。tf.broadcast_to对齐,TF 拒绝的高秩组合回退 numpy。--xpu-perfdevice_us=6.99 真实 GPU 执行)。Related log / screenshot / 日志 / 截图
<no registered kernels>(eager raw op 调用)golden.py:199(eager 直调绑定)、golden.py:209(np.asarray主机绕行)Special notes for this issue/备注
关联 PR:https://gitcode.com/cann/ops-math/pull/6705(上游 !6584 已合并,本缺陷为其 golden 三方绑定的遗留问题)