Pull Request has been successfully merged by CANN-robot.
(Thank you for ChaoyangJi's contribution.)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/ops-tilelang | ✅ kevin365, jiawei_zhuang (2/2) | ✅ kevin365 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ChaoyangJi, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


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


流水线分析报告 — ops-tilelang run#109
流水线: https://gitcode.com/CANN/ops-tilelang/actions/runs/0d173d3d924b4301b15b60b44e9b5887 | PR#47 | 2026-10-23 20:07:38 ~ 2026-10-23 20:12:25 | 失败 Job 1 个
定界结论: 环境问题 / 设备NPU异常 — Runner 上 NPU 设备 3 启动失败(err 507033)
- 失败类型: 环境问题(设备/NPU异常, 可重试)
- 根因: ST_test 以 6 个 xdist worker 运行于 NPU 设备 2,3, 分配到设备 3 的 3 个 worker(gw1/gw3/gw5)在首个 NPU 调用处瞬时失败: TsdOpen/rtSetDevice 报 device retain error(错误码 507033, Failed to start the device); 跑在健康设备上的用例全部通过
- 处置建议: ① 直接重新触发流水线(设备瞬时占用/异常, 大概率恢复)
② 重试仍失败 → 联系 CI/环境维护者检查该 Runner 的 NPU 设备 3(npu-smi 确认设备健康状态与占用, 排除同机并发任务占用) - 排除项: 排除代码问题 — 两轮 pytest session 失败用例集合不同(hidden=3072 第一轮通过/第二轮失败, hidden=2560 反之), 失败仅与 worker/设备绑定相关, 与用例内容无关; 失败均为设备初始化错误(非断言/编译/逻辑错误), PR 变更用例在健康 worker 上全部执行通过
失败根因分析
根因 #1: 环境问题 / 设备NPU异常 — NPU devId=3 启动失败(TsdOpen/rtSetDevice, err 507033)
- 判据: 设备启动失败: rtSetDevice execution failed(device retain error) + TsdOpen failed devId=3, 错误码 507033; 失败按 worker 而非按用例聚簇
- 定位步骤:
3_run_st_test.log - 影响 Job: ST_test
- 关键上下文:
Running regular pytest cases on NPU 2,3 with 6 workers(6 个 worker 共用设备 2,3)- 第一轮(TILELANG_DEFAULT_TARGET=auto): 3 failed, 4 passed; 失败 worker 为 gw1/gw3/gw5(用例 6144/2560/7168, 均在 session 启动后 1 秒内瞬时失败)
- 第二轮(TILELANG_DEFAULT_TARGET=pto): 3 failed, 4 passed; 失败 worker 仍为 gw1/gw3/gw5(用例变为 3072/6144/7168) — 用例分配随调度变化, 失败 worker 恒定
- 跑在 gw0/gw2/gw4(健康设备)上的用例(两轮共 4 个不同参数用例及 compile 用例)全部通过
- 根因证据(日志原文):
[2026-10-23 20:10:27.817+08:00] Running regular pytest cases on NPU 2,3 with 6 workers
[2026-10-23 20:10:46.552+08:00] [gw5] [ 14%] FAILED tests/engram/test_engram_fused_weight.py::test_engram_fused_weight[hc=4,hidden=6144,] ← session 启动后 <1s 瞬时失败
E RuntimeError: LazySetDevice:../torch_npu/csrc/core/npu/NPUFunctions.cpp:342 NPU function error: err, error code is 507033
E [ERROR] 2026-10-23-20-10-46 (PID:1607796, Device:0, RankID:-1) ERR00100 PTA call acl api failed
E [Error]: Failed to start the device.
E TsdOpen failed. devId=3, tdt error=1.[FUNC:PrintfTsdError][FILE:runtime.cc][LINE:2194]
E Check param failed, dev can not be NULL![FUNC:DeviceRetain][FILE:runtime.cc][LINE:3238]
E rtSetDevice execution failed, reason=device retain error[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:76]
结构化定界摘要
[{"repo": "ops-tilelang", "run_number": 109, "Failed_Type": "环境问题",
"Failed_Sub_Type": "设备/NPU异常",
"Failed_Reason": "ST_test 的 6 个 xdist worker 运行于 NPU 设备 2,3, 分配到设备 3 的 gw1/gw3/gw5 在首个 NPU 调用处瞬时失败: TsdOpen/rtSetDevice device retain error(错误码 507033, Failed to start the device); 两轮 session 失败用例集合随调度变化而失败 worker 恒定, 健康设备上的用例全部通过",
"evidence": "TsdOpen failed. devId=3, tdt error=1.[FUNC:PrintfTsdError][FILE:runtime.cc][LINE:2194] Check param failed, dev can not be NULL! rtSetDevice execution failed, reason=device retain error",
"suggestion": "重新触发流水线; 若复现联系 CI/环境维护者检查该 Runner 的 NPU 设备 3 健康状态与占用",
"jobs": "ST_test"}]
由门禁失败定界分析自动生成 | repo: ops-tilelang | run: 0d173d3d924b4301b15b60b44e9b5887 | PR#47


compile


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


流水线分析报告 — ops-tilelang run#114
流水线: https://gitcode.com/CANN/ops-tilelang/actions/runs/917120e5ff3440cc825dfdf9afe5b85d | PR#47 | 2026-10-26 11:39:05 ~ 2026-10-26 11:44:37 | 失败 Job 1 个
定界结论: 环境问题 / 设备/NPU异常 — runner 侧 NPU 设备3启动失败(TsdOpen/rtSetDevice, 507033)
- 失败类型: 环境问题(设备/NPU异常)
- 根因: ST_test 以 6 个 pytest-xdist worker 共用 NPU 设备 2、3 执行
tests/engram/test_engram_fused_weight.py, 落到 devId=3 的 worker 在首个 NPU 算子(torch.randn(..., device=get_device()),tests/engram/test_engram_fused_weight.py:19)处设备启动失败——TsdOpen failed. devId=3, tdt error=31→Check param failed, dev can not be NULL![DeviceRetain]→rtSetDevice execution failed, reason=device retain error(torch_npu 错误码 507033, "Failed to start the device")。失败集合跟随 worker→设备分配而非用例身份(同一用例在 auto/pto 两轮目标模式下成败互换), 是设备侧故障不是代码缺陷。 - 处置建议: ① 直接重新触发流水线(设备瞬时状态异常/占用, 大概率恢复); ② 重试仍失败 → 转 CI/环境维护者检查该 runner 的 NPU 设备 3(
npu-smi info健康状态/占用进程/驱动日志), 修复后重跑。 - 排除项(为何不是代码问题):
- PR#47 新增的
test_engram_fused_weight_compile(新torch.library.custom_op+npugraph_ex编译路径)两轮均 PASSED——PR 新代码在健康设备上工作正常; - 失败的参数化用例是 PR 未修改的既有 eager 用例, 失败点在设备初始化(测试逻辑执行之前), 非断言/逻辑错误;
- 同一参数化用例结果随模式翻转(hidden=4096: auto 轮 PASSED / pto 轮 FAILED; hidden=7168: auto 轮 FAILED / pto 轮 PASSED), 失败由设备分配决定, 与用例代码无关;
- 本 run 其余 11 个 Job(含 CodeCheck/precommit/SCA/Antipoison)全部 COMPLETED, 唯 ST_test 失败。
- PR#47 新增的
失败根因分析
根因 #1: 环境问题 / 设备/NPU异常 — NPU 设备3启动失败: TsdOpen devId=3 tdt error=31, rtSetDevice device retain error(507033)
-
判据:
rtSetDevice execution failed, reason=device retain error/TsdOpen failed. devId=3/[Error]: Failed to start the device.→ 环境问题/设备/NPU异常(device); 表层 pytest FAILED 条目由设备初始化失败传导, 非用例断言失败 -
定位步骤:
3_run_st_test.log(Job ST_test, 唯一失败 Job) -
影响 Job: ST_test
-
失败用例(两轮共 6 个 FAILED 条目, 去重 4 个参数化用例):
tests/engram/test_engram_fused_weight.py::test_engram_fused_weight[hc=4,hidden=6144,](auto/pto 两轮均败)tests/engram/test_engram_fused_weight.py::test_engram_fused_weight[hc=4,hidden=2560,](auto/pto 两轮均败)tests/engram/test_engram_fused_weight.py::test_engram_fused_weight[hc=4,hidden=7168,](仅 auto 轮败)tests/engram/test_engram_fused_weight.py::test_engram_fused_weight[hc=4,hidden=4096,](仅 pto 轮败)
-
两轮对照(同一份代码, 结果随设备分配翻转):
参数化用例 auto 轮(TILELANG_DEFAULT_TARGET=auto, 11:43) pto 轮(TILELANG_DEFAULT_TARGET=pto, 11:44) hidden=6144 FAILED(gw5) FAILED(gw3) hidden=2560 FAILED(gw1) FAILED(gw1) hidden=7168 FAILED(gw3) PASSED(gw0) hidden=4096 PASSED(gw4) FAILED(gw5) hidden=2048 / 3072 PASSED PASSED test_engram_fused_weight_compile(PR 新增) PASSED PASSED 两轮失败测试全部落在 gw1/gw3/gw5 三个 worker, 且所有错误块均指向 devId=3——失败因子是该设备, 而非用例代码。
-
环境上下文:
Running regular pytest cases on NPU 2,3 with 6 workers; 两轮汇总均为3 failed, 4 passed(auto 轮 53.53s, pto 轮 33.27s)。 -
根因证据(日志原文):
[2026-10-26 11:43:47.412+08:00] E RuntimeError: LazySetDevice:../torch_npu/csrc/core/npu/NPUFunctions.cpp:342 NPU function error: err, error code is 507033
[2026-10-26 11:43:47.412+08:00] E [ERROR] 2026-10-26-11:43:07 (PID:771415, Device:0, RankID:-1) ERR00100 PTA call acl api failed
[2026-10-26 11:43:47.412+08:00] E [Error]: Failed to start the device.
[2026-10-26 11:43:47.412+08:00] E Rectify the fault based on the error information in the ascend log.
[2026-10-26 11:43:47.412+08:00] E TsdOpen failed. devId=3, tdt error=31.[FUNC:PrintfTsdError][FILE:runtime.cc][LINE:2194]
[2026-10-26 11:43:47.412+08:00] E Check param failed, dev can not be NULL![FUNC:DeviceRetain][FILE:runtime.cc][LINE:3238]
[2026-10-26 11:43:47.412+08:00] E rtSetDevice execution failed, reason=device retain error[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:76]
触发点(首个 NPU 算子, 测试逻辑执行之前):
def generate_test_data(params):
hc_mult = params['hc']
hidden_size = params['hidden']
> wh_data = torch.randn(hc_mult, hidden_size, dtype=torch.bfloat16, device=get_device())
E RuntimeError: LazySetDevice:../torch_npu/csrc/core/npu/NPUFunctions.cpp:342 NPU function error: err, error code is 507033
tests/engram/test_engram_fused_weight.py:19: RuntimeError
结构化定界摘要
[{"repo": "ops-tilelang", "run_number": 114, "Failed_Type": "环境问题",
"Failed_Sub_Type": "设备/NPU异常",
"Failed_Reason": "ST_test 6个pytest worker共用NPU 2,3, 落到devId=3的用例在首个NPU算子处设备启动失败: TsdOpen failed devId=3 tdt error=31, rtSetDevice device retain error(507033, Failed to start the device); 同一用例在auto/pto两轮成败互换, 与代码无关",
"evidence": "RuntimeError: LazySetDevice:../torch_npu/csrc/core/npu/NPUFunctions.cpp:342 NPU function error: err, error code is 507033 | TsdOpen failed. devId=3, tdt error=31.[FUNC:PrintfTsdError][FILE:runtime.cc][LINE:2194] | rtSetDevice execution failed, reason=device retain error[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:76]",
"suggestion": "先重新触发流水线(设备瞬时异常大概率恢复); 重试仍失败则转CI/环境维护者检查该runner的NPU设备3(npu-smi健康状态/占用进程/驱动日志)",
"jobs": "ST_test"}]
由门禁失败定界分析自动生成 | repo: ops-tilelang | run: 917120e5ff3440cc825dfdf9afe5b85d | PR#47


/compile


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


/lgtm


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/lgtm: wangliwei12


当前PR是否有AI参与:
[x] 否
[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :
PR功能描述 / 为什么需要这个合入**:
该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #
希望检视人员了解:
改动类型 / Change Type
测试信息 / Testing
检查清单 / Checklist