Pull Request has been successfully merged by CANN-robot.
(Thank you for 板糖's contribution.)Hi @lunachai0528, welcome to submitting your first PR to CANN!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.
%!(EXTRA string=https://atomgit.com/cann/community/blob/master/en/sig-infrastructure/command.md)


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 | ✅ liulufang_gitcode, congqiannan (2/2) | ✅ liulufang_gitcode, congqiannan (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
lunachai0528, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


流水线分析报告 — CANN/pypto-gym run#1415
流水线: https://gitcode.com/cann/pypto-gym/actions/runs/5112d4fe22f04ac4b2805a8877500f3f | PR#1038 | 2026-11-27 09:26:44 ~ 09:39:57 | 失败 Job 1 个
定界结论: 代码问题 / LLT 测试失败 — mhc_post_fwd 在 ascend950 上 test_precision_p0[1x4096x5120] 报 “kernel emitted no work”(存量偶发),与本 PR 变更无关
- 失败类型: 代码问题 →
LLT测试失败(pytest 用例失败,承载于冒烟阶段PreSmoke_A5的smoke executor) - 根因小类: 算子 kernel 未产生任何写回——输出 buffer 全为哨兵值
-1.0(kernel emitted no work),不是数值精度偏差 - 一句话根因:
ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py::test_precision_p0[1x4096x5120]在 A5(Ascend950PR) 上执行run_case(1, 4096, 5120)时输出全为哨兵,assert_written抛AssertionError: output is entirely the sentinel: kernel emitted no work,导致PreSmoke_A5以 exit 1 失败(1 failed / 176 passed);同一套件其余 shape(含1x4096x1280/2560/7168、2x4096x*、test_precision_narrow_tail、test_multi_item_per_core)全部 PASSED。 - 影响范围: 仅
PreSmoke_A5(370s,09:33:25 ~ 09:39:35);PreSmoke_A3、Compile(x86/arm)、Antipoison、CodeCheck*、SCA、Test_image、PostBuild等其余 14 个 Job 全部 COMPLETED,无级联失败。 - 与本 PR 的关系: PR#1038(修正 openpangu_v5_7b / llada2_moe / kimi_linear_48b_a3b README 指向
src/pypto_gym/transformers的相对路径)仅修改 3 个 README(ops/pypto_tensor/{kimi_linear_48b_a3b,llada2_moe,openpangu_v5_7b}/README.md,各 +1/-1),不在本 Job 的 pytest 收集范围内——该 Job 只收集ops/pro/deepseek_v4_1/{atten_epilogue,engram_gate,mega_mhc,mhc_post_fwd,mhc_pre_fuse,quant_sparse_lightning_indexer}/tests,与失败路径无交集。 - 处置建议:
- 算子/用例责任人(
ops/pro/deepseek_v4_1/mhc_post_fwd)在 ascend950 上复现test_precision_p0[1x4096x5120],排查该 shape 下工作项派发/写回丢失(重点核对n0=1, h=5120的 tiling/block 分配与 kernel 实际发射)。 - CI 维护者将
mhc_post_fwd在 A5 上的kernel emitted no work登记为存量偶发失败,并核查 A5 节点稳定性。 - 本 PR 提交者: 无需为本次失败修改代码;重触发可能因偶发而变绿,但根治需算子侧修复。
- 算子/用例责任人(
- 排除项: 已排除编译/构建问题(x86、arm 两个 Compile 均 COMPLETED,codegen 与
tiling_checkOK)、已排除代码检查问题(Antipoison / CodeCheck* / SCA / precommit 全通过)、已排除设备健康问题(npu-smi显示Ascend950PR Health OK、无进程占用)、已排除取码问题(Checkout/OBS download 成功,pytest 已实际执行 177 例)。
失败根因分析
根因: 代码问题 / LLT 测试失败 — mhc_post_fwd 单 shape 输出全为哨兵(1 failed / 176 passed)
- 失败 Job 与阶段:
PreSmoke_A5(job_id13ffffe8517c40129d1907c02823ab88),耗时 370s(09:33:25 ~ 09:39:35 CST),失败 step 为4_smoke executor;其余 14 个 Job 全部 COMPLETED。 - 执行平台:
GYM_SMOKE_SOC=950,设备Ascend950PR Health OK;日志记录GYM_SMOKE_SOC=950: skip 910 smoke pytest cases,A5 实际执行 950 路径用例,A3 Job 独立 COMPLETED。 - pytest 收集范围:
python3 -m pytest <worker_dir>/cann/pypto-gym/ops/pro/deepseek_v4_1/{atten_epilogue,engram_gate,
mega_mhc,mhc_post_fwd,mhc_pre_fuse,quant_sparse_lightning_indexer}/tests
--mode torch --rootdir <worker_dir>/cann/pypto-gym -v --durations=0 -s --capture=no -m 'not jit_only'
- 根因证据(日志原文):
[2026-11-27 09:38:12.589+08:00] ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py::test_precision_p0[1x4096x5120]
[2026-11-27 09:38:14.613+08:00] FAILED
...
[2026-11-27 09:39:41.968+08:00] out = tensor([[[[-1., -1., -1., ..., -1., -1., -1.],
[2026-11-27 09:39:41.968+08:00] [-1., -1., -1., ..., -1., -1., -1.],
...
[2026-11-27 09:39:41.968+08:00] dtype=torch.bfloat16)
[2026-11-27 09:39:41.968+08:00] > raise AssertionError("output is entirely the sentinel: kernel emitted no work")
[2026-11-27 09:39:41.968+08:00] E AssertionError: output is entirely the sentinel: kernel emitted no work
[2026-11-27 09:39:41.968+08:00] ops/pro/deepseek_v4_1/mhc_post_fwd/tests/assets/mhc_post_fwd_precision.py:74: AssertionError
[2026-11-27 09:39:42.433+08:00] FAILED ops/pro/deepseek_v4_1/mhc_post_fwd/tests/test_mhc_post_fwd.py::test_precision_p0[1x4096x5120] - AssertionError: output is entirely the sentinel: kernel emitted no work
[2026-11-27 09:39:42.433+08:00] ============= 1 failed, 176 passed, 1 warning in 220.59s (0:03:40) =============
[2026-11-27 09:39:45.335+08:00] 20261127.093945 : run gym stest failed, exit code 1
- 用例意图:
assert_written是哨兵检查——执行前把输出填成-1.0,执行后若输出仍全为哨兵,说明 kernel 被调用但没有向输出写入任何结果(解析成功但“没发工作”的空过),与数值误差无关。 - 过程还原:
- 前置 Job(image / get-pr / pre_pipeline / upload-scripts)全部成功。
- 代码检查(Antipoison / CodeCheck* / SCA / precommit)与 x86/arm 编译并行执行,全部 COMPLETED。
PreSmoke_A3与PreSmoke_A5并行启动,A3 COMPLETED(259s),A5 依次完成 pto-isa 安装、pypto 构建、ascend950 打包安装、pytest 执行。09:38:12test_precision_p0[1x4096x5120]开始执行(1.97s call),09:38:14FAILED;同套件其余 176 例 PASSED(包括2x4096x5120)。09:39:42pytest 汇总 1 failed / 176 passed;build_ci.py抛CalledProcessError,A5 冒烟以 exit 1 失败。
交叉验证: 同算子同错误在多个 PR 的并行 run 中于不同用例间漂移,指向 ascend950 存量偶发缺陷
同仓库近期 run 中 mhc_post_fwd 的同类失败(失败用例在 run 之间漂移):
| run | PR | 失败用例 | 错误 |
|---|---|---|---|
| #1415(本次) | #1038 | mhc_post_fwd::test_precision_p0[1x4096x5120] |
kernel emitted no work |
| #1383 | #922 | mhc_post_fwd::test_multi_item_per_core |
kernel emitted no work |
| #1327 | #1091 | mhc_post_fwd::test_precision_p0[1x4096x5120] |
kernel emitted no work |
| #1326 | #1092 | mhc_post_fwd::test_precision_p0[1x4096x7168] |
kernel emitted no work |
- 判定要点:
- 各 PR 变更内容互不相同(README 修正、PANKO 脚本重构、测试文件删除重复 import 等),却集中失败在同一算子
mhc_post_fwd,且失败用例在 run 之间漂移(本次1x4096x5120,此前1x4096x7168、test_multi_item_per_core),符合 ascend950 上存量算子在特定 shape 下写回不稳定的特征。 - 近 72h 内 A5 冒烟还在 PR#888(run#1404)、PR#1053(run#1400)上失败,说明 A5 冒烟存在跨 PR 的复现性不稳定。
- 本次 PR 变更全部为
ops/pypto_tensor/*/README.md,与ops/pro/deepseek_v4_1/mhc_post_fwd的 kernel/tiling/用例无交集,且不在 pytest 收集范围内。 - 同一 run 内同套件 176 例通过、设备
Health OK,排除确定性回归与设备故障。
- 各 PR 变更内容互不相同(README 修正、PANKO 脚本重构、测试文件删除重复 import 等),却集中失败在同一算子
结构化定界摘要
[{"repo": "pypto-gym", "run_number": 1415, "Failed_Type": "代码问题", "Failed_Sub_Type": "LLT测试失败", "Failed_Reason": "PreSmoke_A5 在 ascend950 上执行 ops/pro/deepseek_v4_1/mhc_post_fwd 的 test_precision_p0[1x4096x5120] 时输出全为哨兵(-1.0), assert_written 抛 'output is entirely the sentinel: kernel emitted no work', 1 failed/176 passed; 同套件其余 176 例及 2x4096x5120 均通过, 且该算子同类错误在并行 run(#1326/#1327/#1383)间于不同用例漂移, 属 ascend950 存量偶发缺陷; 本 PR 仅修改 ops/pypto_tensor 下 3 个 README(+1/-1), 不在本 Job pytest 收集范围, 与失败路径无交集", "evidence": "AssertionError: output is entirely the sentinel: kernel emitted no work @ ops/pro/deepseek_v4_1/mhc_post_fwd/tests/assets/mhc_post_fwd_precision.py:74 / ============= 1 failed, 176 passed, 1 warning in 220.59s =============", "suggestion": "由 mhc_post_fwd 责任人在 ascend950 上复现 test_precision_p0[1x4096x5120], 排查该 shape 下工作项派发/写回丢失(tiling/block 分配与 kernel 发射); CI 维护者登记该算子为 A5 已知偶发失败并核查节点稳定性; 本 PR 无需修改代码, 重触发可能因偶发而变绿", "jobs": "PreSmoke_A5"}]
由门禁失败定界分析自动生成 | repo: pypto-gym | run: 5112d4fe22f04ac4b2805a8877500f3f | PR#1038


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


@congqiannan @liulufang_gitcode @li-shengxian3 三份 README 的相对路径刚顺手改好了,CI 已过,有空烦请看一下。


/approve


/approve


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.


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


流水线分析报告 — pypto-gym run#1518
流水线: https://gitcode.com/CANN/pypto-gym/actions/runs/364dab750c3a4372bd0f4b827f1cda5d | PR#1038 | 2026-11-30 22:34:08 ~ 2026-11-30 22:52:13 | 失败 Job 1 个
定界结论: 代码问题 / 编译错误 — FAILED ops/pro/deepseek_v4_1/indexer_pro
- 失败类型: 代码问题
- 根因: 编译任务中的 UT 配置检查失败: pytest 用例失败: ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py::test_precision_decode[b48-s6]
- 处置建议: 通知 PR 提交者修复(见各根因的具体建议)
失败根因分析
根因 #1: 代码问题 / 编译错误 — FAILED ops/pro/deepseek_v4_1/indexer_pro
- 判据: 编译任务中的 UT 配置检查失败: pytest 用例失败: ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py::test_precision_decode[b48-s6]
- 定位步骤:
4_smoke executor.log - 影响文件:
ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py - 影响 Job: PreSmoke_A5
- 根因证据(日志原文):
[2026-11-30 22:52:01.045+08:00] FAILED ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py::test_precision_decode[b48-s6] - AssertionError: 4 unexplained Q bytes
结构化定界摘要
[
{
"repo": "pypto-gym",
"run_number": 1518,
"Failed_Type": "代码问题",
"Failed_Sub_Type": "编译错误",
"Failed_Reason": "编译任务中的 UT 配置检查失败: pytest 用例失败: ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py::test_precision_decode[b48-s6]",
"evidence": "[2026-11-30 22:52:01.045+08:00] FAILED ops/pro/deepseek_v4_1/indexer_prologue_qw/tests/test_indexer_prologue_qw.py::test_precision_decode[b48-s6] - AssertionError: 4 unexplained Q bytes",
"suggestion": "通知 PR 提交者修复(见各根因的具体建议)",
"jobs": "PreSmoke_A5"
}
]
由门禁失败定界分析自动生成 | repo: pypto-gym | run: 364dab750c3a4372bd0f4b827f1cda5d | PR#1038


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


1、变更概述
修正 openpangu_v5_7b、llada2_moe 与 kimi_linear_48b_a3b 算子 README 中漏写 src/pypto_gym/ 前缀的 3 处相对链接。
2、变更类型
3、修改内容
修改文件:
ops/pypto_tensor/openpangu_v5_7b/README.md(L52-L58)ops/pypto_tensor/llada2_moe/README.md(L30-L34)ops/pypto_tensor/kimi_linear_48b_a3b/README.md(L31-L37)修改补丁:
--- a/ops/pypto_tensor/openpangu_v5_7b/README.md +++ b/ops/pypto_tensor/openpangu_v5_7b/README.md @@ -52,7 +52,7 @@ ## Integration The kernel is wired into the model through `PanguEmbeddedModel.forward` in -[modeling_openpangu_dense.py](../../../transformers/openpangu_v5_7b/modeling_openpangu_dense.py), +[modeling_openpangu_dense.py](../../../src/pypto_gym/transformers/openpangu_v5_7b/modeling_openpangu_dense.py), gated by `USE_PTO_FUSED_LAYER`. Prefill and the disabled case fall back to the PyTorch `PanguEmbeddedDecoderLayer`; decode (when enabled) iterates over layers and calls `self.fused_layers[i](...)` per layer. --- a/ops/pypto_tensor/llada2_moe/README.md +++ b/ops/pypto_tensor/llada2_moe/README.md @@ -30,5 +30,5 @@ The kernel is wired into the model through `_moe_infer_pypto()` on `LLaDA2MoeSparseMoeBlock` in -[modeling_llada2_moe.py](../../../transformers/llada2_moe/modeling_llada2_moe.py), +[modeling_llada2_moe.py](../../../src/pypto_gym/transformers/llada2_moe/modeling_llada2_moe.py), gated by the `USE_PTO_EXPERT_FFN` switch (opt-in). --- a/ops/pypto_tensor/kimi_linear_48b_a3b/README.md +++ b/ops/pypto_tensor/kimi_linear_48b_a3b/README.md @@ -31,7 +31,7 @@ ## Integration The kernel is wired into the model through the -[modeling_kimi.py](../../../transformers/kimi_linear_48b_a3b/modeling_kimi.py) +[modeling_kimi.py](../../../src/pypto_gym/transformers/kimi_linear_48b_a3b/modeling_kimi.py) dispatch hook: the ops package is injected as `sys.modules["kimi_linear_48b_a3b_pto_kernels"]`, exposing `USE_PTO_KDA` (opt-in switch, default off) and `kda_chunk_wrapper`; decode uses the unchanged upstream4、自测验证(CANN评审必填)
本地已核对修改后的文档路径及 Markdown 渲染效果。
5、合规检查
6、评审重点 & 备注
cann/pypto-gym主干master(d5838e5)修改,仅作局部修复,不影响原有对外接口。