Open
[feat][ops] norm_multiply_dropout反向用例/示例与构建接入 #235
[feat][ops] norm_multiply_dropout反向用例/示例与构建接入 #235
Open
penghuiyangAdd on 5 days ago
penghuiyangCollaborators
5 days ago

合入来源

问题/功能描述

norm_multiply_dropout 算子迁移(系列 PR 5/6):新增反向算子测试用例与 aclnn/torch 调用示例,并挂载算子目录构建。

本系列 6 个 PR 基于同一基线独立拆分,每个 PR 的 diff 仅包含自身变更(均 <1000 行),建议按 P1→P6 顺序合入;目录 CMakeLists 挂载在 P5 生效,SOC 白名单与全部文档在 P6 生效。

修改方案描述

  • 新增反向 pytest 用例(含 @pytest.mark.ci 标记、set_device 默认 0):非法参数校验、dropout_ratio/eps 开闭区间边界用例(dropout_ratio=1.0 断言梯度全 0 且有限,对齐 PyTorch native_dropout_backward 语义)、泛化 shape/dtype、测试实现与 RecSDK 对齐
  • 新增反向 aclnn 两段式接口调用示例与 torch 接口示例,均可通过 run_examples.sh --ops norm_multiply_dropout 自动发现执行
  • 构建接入(公共修改):新增算子聚合目录 CMakeLists(挂载前反向子目录)、前/反向目录 CMakeLists(vendor 打包与 op_host/op_kernel 挂载);本 PR 合入后整组算子编译生效(SOC 白名单见 P6)

是否涉及UT/ST

开发自检

likedislike
Merge blocked
ascend-robot
ascend-robotCollaborators
5 days ago Comments:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robotCollaborators
5 days ago Added label: docs-ci-pipeline-running
PpenghuiyangCollaborators
5 days ago Force-pushed 1 commits:bf9b6d60-[feat][ops] add norm_multiply_dropout backward tests/examples and enable build integration
PpenghuiyangCollaborators
5 days ago Force-pushed 1 commits:1c0a7595-[feat][ops] add backward tests/examples and enable build integration
ascend-robotascend-robotCollaborators
5 days ago Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
5 days ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-Ascend/ops-rec ❌ (0/2)(You can also ask: zmingh, xuyan235, zxorange_321, caohuanqi, lihao_huawei) ❌ (0/1)(You can also ask: yangzhen92a, 曾伟, 项攀霄, imhandsome1, 蒋皓洋)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
AtlasAccountAtlasAccountCollaborators
5 days ago Added label: ci-pipeline-running
ascend-robot
ascend-robotCollaborators
5 days ago Comments:

CLA Signature Pass

huiyangpeng, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
PpenghuiyangCollaborators
5 days ago Change title to "6 [feat][ops] norm_multiply_dropout反向用例/示例与构建接入", originally titled "[feat][ops] norm_multiply_dropout反向用例/示例与构建接入".
PpenghuiyangCollaborators
5 days ago Modify description of pull request
PpenghuiyangCollaborators
5 days ago Change title to "[feat][ops] norm_multiply_dropout反向用例/示例与构建接入", originally titled "6 [feat][ops] norm_multiply_dropout反向用例/示例与构建接入".
ascend-robot
ascend-robotCollaborators
5 days ago Comments:

ascend docs pipeline is running...

likedislike
ascend-robot
ascend-robotCollaborators
5 days ago Comments:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robotCollaborators
5 days ago Removed label: docs-ci-pipeline-running
5 event messages are collapsed here。 See more
AtlasAccountAtlasAccountCollaborators
4 days ago Added label: ci-pipeline-passed
AtlasAccount
AtlasAccountCollaborators
4 days ago Comments:
流水线 PR-pipeline_ops-rec#1093 [ commitID:1c0a7595 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 PR-build-SAST-check ✅ COMPLETED >>>
Build-2.7.1_arm ✅ COMPLETED >>>
Build-2.10.0_arm ✅ COMPLETED >>>
Build-2.7.1_X86 ✅ COMPLETED >>>
Build-2.10.0_X86 ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 pre-commit ✅ COMPLETED >>>
clang-tidy ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 presmoke ✅ COMPLETED >>>
流水线 PR-pipeline_ops-rec ✅ COMPLETED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
zengxiongCollaborators4 days agoStart code review1
ascendc/activation/norm_multiply_dropout/norm_multiply_dropout_backward/test/pytest/test_norm_multiply_dropout_backward.py
@@ -0,0 +328,4 @@
328+ compare_data_with_double_pole(f"{msg}, b_grad", b_fused.grad.cpu(), b_npu.grad.cpu(), b_pt_grad)
329+ 
330+ 
331+@pytest.mark.ci
zengxiong4 days agoComments:

[P2] 29 个测试函数仅 1 个带 @pytest.mark.ci,CI 实际执行面≈仅 4×512 fp16 冒烟(PR 模板硬性项)

问题
本文件 29 个 def test_* 中只有 test_norm_multiply_dropout_backward_ci(L332,run_case(4, 512, fp16))打了 @pytest.mark.ci;backward_double_pole 泛化 42 组合(L336-341)、graph 用例(L344+)、以及 L409 起约 20 个边界校验用例全部无 ci 标记。PR 模板自检项明确要求「pytest 测试用例需包含 @pytest.mark.ci 标记,以便 CI 流水线识别并执行」。

影响
CI -m ci 过滤下,反向 kernel 的 dtype 矩阵、dropout_ratio=1.0 全零梯度语义(本 PR 声称的核心行为)、d_out/shape 校验回归均不执行;后续破坏不会拦截。#234 前向文件同款(20 个函数仅 4 个带 ci),可一并处理。

建议
模块级 pytestmark = [pytest.mark.ci],graph 用例叠加 @pytest.mark.graph;大 dim0(927750/1e6)组合如担心时长可拆出独立非 ci 用例或用例内 skip 重参数,但不要整体裸奔。

likedislike