Merged
fix(tests): remove duplicate os import in test_glm_ffn_shared_expert_quant.py #1104
fix(tests): remove duplicate os import in test_glm_ffn_shared_expert_quant.py #1104
Merged
liangjinxuan-2026Add on 7 days ago
liangjinxuan-2026
7 days ago

Fixes #420

Summary

Remove redundant duplicate import os statement(s) already imported earlier in tests/ops/glm_v4_5/test_glm_ffn_shared_expert_quant.py (ruff F811).

Verification

  • Verified syntax with ast.parse.
  • Verified ruff check --isolated --select F811 reports 0 issues.
  • Scope strictly limited to tests/ops/glm_v4_5/test_glm_ffn_shared_expert_quant.py.
likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for liangjinxuan-2026's contribution.)
liangjinxuan-2026liangjinxuan-2026
7 days ago Created pull request, commit a18c9e0e
liangjinxuan-2026liangjinxuan-2026
7 days ago Associated issue: [Bug]: Duplicate os import in tests/ops/glm_v4_5/test_glm_ffn_shared_expert_quant.py
CANN-robotCANN-robotCollaborators
7 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
7 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.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/pypto-gym ✅ congqiannan, liulufang_gitcode (2/2) ✅ congqiannan, liulufang_gitcode (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
7 days ago Set xinweiliu,pan-boyi,lim-jiunnbin,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,li-shengxian3,yinjie27_,liulufang_gitcode,congqiannan,tsungl4,gaoxingwang,zhangxiangjie,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
CANN-robotCANN-robotCollaborators
7 days ago Set xinweiliu,pan-boyi,lim-jiunnbin,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,li-shengxian3,yinjie27_,liulufang_gitcode,congqiannan,tsungl4,gaoxingwang,zhangxiangjie,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
liangjinxuan-2026
liangjinxuan-2026
6 days ago Comments:

/compile

likedislike
liangjinxuan-2026liangjinxuan-2026
6 days ago Pre merge succeeded (commit_id: 5eea893fc7a48b4ba7b3a72d68d2c2f6a7a6975c)
CANN-robot
CANN-robotCollaborators
6 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
6 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
6 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
6 days ago Added label: ci-pipeline-failed
CANN-robot
CANN-robotCollaborators
6 days ago Comments:

流水线分析报告 — pypto-gym run#1300

流水线: https://gitcode.com/cann/pypto-gym/actions/runs/206bbcc33a6a499b866c808391f40a36 | PR#1104 | 2026-11-25 00:39:30 ~ 01:21:44 | 失败 Job 1 个

定界结论: 代码问题 / 冒烟用例失败 — mhc_post_fwd 精度用例 1x4096x7168 输出未写入
  • 失败类型: 代码问题(冒烟精度用例失败),与 PR#1104 改动无关
  • 根因: PreSmoke_A5 执行 ops/pro/deepseek_v4_1/* 全量冒烟,mhc_post_fwd::test_precision_p0[1x4096x7168] 输出全为哨兵 -1.0(kernel 未产生任何 work)而失败
  • 与 PR 关系: PR#1104 仅删除 tests/ops/glm_v4_5/test_glm_ffn_shared_expert_quant.py 中重复的 import os(ruff F811);而本次冒烟 pytest 只收集 ops/pro/deepseek_v4_1/* 7 个 pro 算子,未执行 PR 改动的文件,故该失败为基线分支既有问题,非本 PR 引入
  • 处置建议: ① 转 mhc_post_fwd(ops/pro/deepseek_v4_1)算子责任人,定位 n0=1、h=7168 形状下 kernel 未发工作的问题;② PR#1104 改动本身正确,待底层算子修复后重触发流水线即可
  • 排除项: 非环境/网络问题(编译成功、191 个用例通过);非 PR 变更引入

失败根因分析

根因 #1: 代码问题 / 冒烟用例失败 — mhc_post_fwd 精度用例输出全为哨兵
  • 判据: 1 failed, 191 passed;失败用例 test_precision_p0[1x4096x7168] 触发哨兵断言
  • 定位步骤: PreSmoke_A5 → 4_smoke executor.log → pytest 汇总 FAILED ...::test_precision_p0[1x4096x7168]
  • 影响 Job: PreSmoke_A5
  • 影响文件: ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py(断言位于 tests/assets/mhc_post_fwd_precision.py:74)
  • 根因证据(日志原文):
ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py:127: in run_case
    assert_written(out, SENTINEL)
...
out = tensor([[[[-1., -1., -1.,  ..., -1., -1., -1.], ...
       dtype=torch.bfloat16)
>       raise AssertionError("output is entirely the sentinel: kernel emitted no work")
E       AssertionError: output is entirely the sentinel: kernel emitted no work
  • 增强论证(同组形状对照,说明为特定形状问题而非偶发):

    case 结果
    test_precision_p0[1x4096x1280] PASSED
    test_precision_p0[1x4096x2560] PASSED
    test_precision_p0[1x4096x5120] PASSED
    test_precision_p0[1x4096x7168] FAILED(输出全 -1.0)
    test_precision_p0[2x4096x7168] PASSED

    仅 n0=1, h=7168 触发,h=7168(=7×1024)在 n0=1 时疑似分块/tail 分支未下发工作,n0=2 同高度通过,指向该形状的 tiling/kernel 分支缺陷,非随机抖动。

结构化定界摘要
[
  {
    "repo": "pypto-gym",
    "run_number": 1300,
    "Failed_Type": "代码问题",
    "Failed_Sub_Type": "冒烟用例失败",
    "Failed_Reason": "PR#1104 仅删除 glm 测试重复 import,未触及 mhc_post_fwd;冒烟跑 ops/pro/deepseek_v4_1 全量,mhc_post_fwd 精度用例 1x4096x7168 输出全为哨兵 -1.0(kernel 未发工作)失败,属基线既有问题。",
    "evidence": "FAILED ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py::test_precision_p0[1x4096x7168] - AssertionError: output is entirely the sentinel: kernel emitted no work ... 1 failed, 191 passed",
    "suggestion": "转 mhc_post_fwd(deepseek_v4_1) 算子责任人修复 n0=1、h=7168 形状 kernel 未发工作问题,修复后重触发流水线;PR#1104 改动本身无问题。",
    "jobs": "PreSmoke_A5"
  }
]

由门禁失败定界分析自动生成 | repo: pypto-gym | run: 206bbcc33a6a499b866c808391f40a36 | PR#1104

likedislike
liangjinxuan-2026
liangjinxuan-2026
5 days ago Comments:

/compile

likedislike
CANN-robot
CANN-robotCollaborators
5 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
5 days ago Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
5 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
5 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
5 days ago Added label: ci-pipeline-passed
congqiannan
congqiannanCollaborators
12 hours ago Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
12 hours ago Added label: approved
liulufang_gitcode
liulufang_gitcodeCollaborators
12 hours ago Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
12 hours ago Added label: lgtm
CANN-robotCANN-robotCollaborators
12 hours ago Removed label: ci-pipeline-passed
CANN-robot
CANN-robotCollaborators
12 hours ago Comments:

The following label is not ready.

ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.

likedislike
liangjinxuan-2026
liangjinxuan-2026
10 hours ago Comments:

/compile

likedislike
liangjinxuan-2026liangjinxuan-2026
10 hours ago Pre merge succeeded (commit_id: 90deae4d361a86121380b48550dd8f8021fac608)
CANN-robot
CANN-robotCollaborators
10 hours ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
10 hours ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
10 hours ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
10 hours ago Added label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
10 hours ago Merged pull request