Merge blocked
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
⚠️ 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-cann/torchtitan-npu | ❌ (0/2)(You can also ask: 盛楠, xuyujun, zzyyjj012, zhaowei1936, lrwei0709) | ❌ (0/1)(You can also ask: 盛楠, xuyujun, hwcaifubi, 徐道鸿, zzyyjj012) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
jiangna1111, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


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


compile


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


流水线分析报告 — torchtitan-npu run#3590
流水线: https://gitcode.com/CANN/torchtitan-npu/actions/runs/ddef48e959644df59be52818c77484ff | PR#1482 | 2026-12-04 18:13:17 ~ 2026-12-04 18:15:53 | 失败 Job 2 个
定界结论: 代码问题、工程问题(共 2 个根因)
根因 #1(代码问题 / 代码检查错误)
- 根因: codecheck 检查不通过
- 处置: 通知 PR 提交者修复(见各根因的具体建议)
- 影响 Job: Codecheck_dt
根因 #2(工程问题 / GitCode平台限流)
- 根因: API 限流
- 处置: 转 CI 维护者处理
- 影响 Job: PostBuild
失败根因分析
根因 #1: 代码问题 / 代码检查错误 — 2026-12-04 18:15:32,598 - INFO [codechec
- 判据: codecheck 检查不通过
- 定位步骤:
3_Codecheck_dt.log - 影响 Job: Codecheck_dt
- 根因证据(日志原文):
[2026-12-04 18:15:32.618+08:00] 2026-12-04 18:15:32,598 - INFO [codecheck 2026-12-04 18:15:32] codecheck result: no pass.
- Codecheck 报告(查看具体违规项): https://www.openlibing.com/apps/entryCheckDashCode/MR_5521b3d7179842298c5d9ac07a2728bd/a351c969c86bb87ea3133d464eb45fd4?projectId=300033&codeHostingPlatformFlag=gitcode
- PR 变更范围(4 个文件):
docs/feature_guides/sdc.md、docs/user-guides/sdc.md、tests/smoke_tests/conftest.py、tests/smoke_tests/sdc/test_sdc_smoke.py - 建议: 打开上述 Codecheck 报告定位具体违规项,修复后重新推送触发流水线;PostBuild 的 429 为平台限流,非代码问题,无需处理。
根因 #2: 工程问题 / GitCode平台限流 — API 请求失败: HTTP 429
- 判据: API 限流
- 定位步骤:
1_query_pipeline.log - 影响 Job: PostBuild
- 根因证据(日志原文):
[2026-12-04 18:15:50.507+08:00] API 请求失败: HTTP 429
结构化定界摘要
[
{
"repo": "torchtitan-npu",
"run_number": 3590,
"Failed_Type": "代码问题",
"Failed_Sub_Type": "代码检查错误",
"Failed_Reason": "codecheck 检查不通过",
"evidence": "[2026-12-04 18:15:32.618+08:00] 2026-12-04 18:15:32,598 - INFO [codecheck 2026-12-04 18:15:32] codecheck result: no pass.",
"suggestion": "通知 PR 提交者修复(见各根因的具体建议)",
"jobs": "Codecheck_dt"
},
{
"repo": "torchtitan-npu",
"run_number": 3590,
"Failed_Type": "工程问题",
"Failed_Sub_Type": "GitCode平台限流",
"Failed_Reason": "API 限流",
"evidence": "[2026-12-04 18:15:50.507+08:00] API 请求失败: HTTP 429",
"suggestion": "转 CI 维护者处理",
"jobs": "PostBuild"
}
]
由门禁失败定界分析自动生成 | repo: torchtitan-npu | run: ddef48e959644df59be52818c77484ff | PR#1482


用户指南里的接入示例在 0.4.0 上跑不起来。这里用 Trainer.Config() 再给 compile 赋值,实际会先报少了必填的 model;就算绕过构造,上游配置也没有 compile 字段,赋值还是会报错。这是改之前就有的问题,不过这个 PR 正好改了这几行(含 L25–26)。建议像 smoke 和 CPU 单测那样,用 SimpleNamespace 构造这份配置。


描述
修复 #238 中 SDC smoke 测试在 TorchTitan 0.4.0 迁移后的配置与断言不兼容问题,并同步清理 SDC 文档中遗留的 0.3.0 编译配置写法。
dev_0.4.0升级 PR!1171将torchtitan_npu/extensions/components/sdc/sdc.py的编译配置校验从旧版compile.enable/compile.components切换为原生compile.model,同步更新了 CPU 单测tests/unit_tests/test_sdc.py,但未同步更新tests/smoke_tests/sdc/test_sdc_smoke.py及两篇sdc.md文档,导致 8 个 SDC smoke 实例全部因配置校验或错误断言失败并被临时跳过。tests/smoke_tests/sdc/test_sdc_smoke.py:_config()改用 0.4.0 原生CompileConfig(model=ModelCompileConfig(backend="inductor") if compiled else None);_check_invalid_config()错误断言更新为"compile.model";加固 FP32 checksum 分支输出的换行与解析逻辑(兼容[rank0]:等分布式/运行时前缀,失败时输出完整stdout/stderr)。tests/smoke_tests/conftest.py:移除_DEFERRED_SMOKE_TESTS中全部 6 个 SDC smoke 函数(8 个实例),恢复默认 smoke 执行。docs/feature_guides/sdc.md、docs/user-guides/sdc.md:将遗留的compile.enable/compile.components/compile.backend示例更新为compile.model写法。类型
Checklist:
如何测试
ruff check、ruff format --check、codespell、架构边界检查、OAT 合规检查、git diff --check均通过。torch==2.15.0+cpu、torchtitan==0.4.0): 结果:35 passed, 0 skipped(0.48s)。--run-deferred-smoke,Ascend 910B4 单卡、CANN 9.2.2、torch==2.15.0+cpu、torch_npu==2.15.0.dev20261116、torchtitan==0.4.0): 结果:12 passed, 0 skipped(332.74s),原 8 个延迟跳过的实例全部通过,test_fp32_checksum_preserves_compiled_results_and_detects_output_faults输出FP32 native checksum branch: V-ABFT。精度和性能验证结果
不涉及