Closed
[Requirement|需求建议]: SparseApplyAdagrad 补充算子 kernel example #6772
clinglai0517Add on  Oct 16Closed at  Oct 19
clinglai0517
clinglai0517Collaborators
Oct 16 Create

Backgroud(背景信息)

SparseApplyAdagrad 缺少可通过仓库构建脚本运行的算子 kernel example,README 中也缺少对应的图模式调用示例入口。需要参考其他 optim 算子的 kernel example,补齐该算子的调用示例和文档。

Origin(信息来源)

算子团队。

Benefit / Necessity (价值/作用)

提供可直接编译、运行和校验结果的示例,方便开发者理解 SparseApplyAdagrad 的输入、属性及输出,并验证 kernel 的运行结果。

Design(设计方案)

  1. 参考 SparseApplyAdagradV2、SparseApplyRMSProp 的 GE 图模式示例,新增 optim/sparse_apply_adagrad/examples/test_geir_sparse_apply_adagrad.cpp。
  2. 构造 var、accum、lr、grad、indices 五个输入;设置 use_locking=false,分别覆盖 update_slots=true 和 false。
  3. 使用无重复索引,按算子公式计算 CPU 期望值,校验 var、accum 输出的形状、数据类型和数值,同时检查未更新行。
  4. 沿用仓库 example 构建机制,在安装算子包后通过以下命令编译并运行:
bash build.sh --run_example sparse_apply_adagrad graph --soc=ascend950
  1. 更新算子 README,补充示例链接和运行命令;在 Ascend 950PR 环境验证示例编译、运行及数值校验通过。
likedislike
clinglai0517clinglai0517Collaborators
Oct 16 Added label: requirement
clinglai0517clinglai0517Collaborators
Oct 16 Modify description of issue
clinglai0517clinglai0517Collaborators
Oct 16 Modify description of issue
yuning_chenyuning_chenCollaborators
Oct 16 Assign clinglai0517 as responsible person
CANN-robotCANN-robotCollaborators
Oct 19 Close issue
CANN-robotCANN-robotCollaborators
Oct 19 Added label: resolved