已关闭
[Bug-Report|缺陷反馈]: InplaceApplyAdagradDA 算子 dtype 一致性校验缺失 #4406
zhongheng创建于  7月29日关闭于  7月29日
zhongheng
7月29日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

InplaceApplyAdagradDA 算子 def.cpp 中 10 个 tensor 输入/输出的 DataType 声明为 4 元组 {DT_FLOAT, DT_FLOAT16, DT_FLOAT, DT_FLOAT16},允许 var 与其他 tensor dtype 不一致(如 var=fp32、grad=fp16)通过图编译期校验。但 kernel 模板按单一 dtype 实例化,dtype 不一致时会导致数据错乱。

对标 CANNDEV ApplyAdagradDAD(apply_adagrad_da_d.py)通过 compare_tensor_dict_key 强制 tensor dtype 一致,当前实现存在校验缺口。

另:README 声明"支持 0~8 维输入",但 CANNDEV 无此限制,文档与实现不一致。

Environment / 环境信息 (Mandatory / 必填)

Ascend950DT / CANN 9.2.0
算子路径: optim/inplace_apply_adagrad_da/

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 构造 var(float32) + grad(float16) 的输入
  2. 图编译通过(未拦截)
  3. kernel 按 T=float 实例化,grad 的 fp16 数据被当 fp32 读取,数据错乱

Describe the expected behavior / 预期结果 (Mandatory / 必填)

def.cpp 收紧为 2 元组 {DT_FLOAT, DT_FLOAT16},框架层强制所有 tensor dtype 一致,对齐 CANNDEV。README 删除维度上限限制。

def.cpp L32: .DataType({ge::DT_FLOAT, ge::DT_FLOAT16, ge::DT_FLOAT, ge::DT_FLOAT16})
CANNDEV apply_adagrad_da_d.py L241-243: compare_tensor_dict_key(var, gradient_accumulator, "dtype")

Special notes for this issue/备注 (Optional / 选填)

likedislike
zhongheng
7月29日 评论:

/assign

likedislike
CANN-robotCANN-robot成员
7月29日 将 zhongheng 设为负责人
Zzhongheng
7月29日 关联了pull request:fix(inplace_apply_adagrad_da): 收紧 dtype 组合对齐 CANNDEV,删除 README 维度限制
CANN-robotCANN-robot成员
7月29日 关闭了 issue
CANN-robotCANN-robot成员
7月29日 添加了label:resolved
Zzhongheng
7月31日 修改标题为 “[Bug-Report|缺陷反馈]: InplaceApplyAdagradDA 算子 dtype 一致性校验缺失”,原标题为“[Bug-Report|缺陷反馈]: InplaceApplyAdagradDA 算子 dtype 一致性校验缺失,对齐 CANNDEV”
Zzhongheng
7月31日 issue状态由 进行中 改变为 已解决