已合并
enhancement(ci): 自动检测变更 patch 并优化 NPU 测试流水线 #37907
kerer-sk创建于 6月9日
enhancement(ci): 自动检测变更 patch 并优化 NPU 测试流水线 #37907
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 kerer-sk 的贡献)6月9日 关联了issue:enhancement(ci): 自动检测变更 patch 并优化 NPU 测试流水线
ascend-robot
6月9日 评论:
6月9日 评论:
6月9日 添加了label:ascend-cla/yes
ascend-robot
6月9日 评论:
6月9日 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/pytorch | ✅ liangsongwei, huangjingwei, sunyu-xuan (3/2) | ✅ liangsongwei (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
kerer-sk, thanks for your pull request. All authors of the commits have signed the CLA. 👍


ascend-robot
6月9日 评论:
6月9日 评论:
当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.7.1 | ||
| v2.10.0 | ||
| v2.11.0 | ||
| v2.9.0 | ||
| v2.12.0 | ||
| v2.7.1-26.1.0 | ||
| v2.10.0-26.1.0 | ||
| v2.9.0-26.1.0 | ||
| v2.11.0-26.1.0 | ||
| v2.12.0-26.1.0 | ||
| ci-test | ||
| sync-pr28113--to-v2.9.0 |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


ascend-robot
6月9日 评论:
6月9日 评论:
Ascend docs pipeline is running...


6月9日 添加了label:docs-ci-pipeline-running
ascend-robot
6月9日 评论:
6月9日 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


6月9日 删除了label:docs-ci-pipeline-running
6月9日 添加了label:docs-ci-pipeline-success
6月9日 update merge request[project id: 7404318, iid: 37907, commit_id: 2c57e07960f8a9c50c0597fca158e0d68691eb2d] virtual merging success
6月9日 update merge request[project id: 7404318, iid: 37907, commit_id: 2c57e07960f8a9c50c0597fca158e0d68691eb2d] virtual merging success
6月9日 update merge request[project id: 7404318, iid: 37907, commit_id: bbbcb4999f18b61184066e01bf954d1020334f37] virtual merging success
6月9日 update merge request[project id: 7404318, iid: 37907, commit_id: bbbcb4999f18b61184066e01bf954d1020334f37] virtual merging success
ascend-robot
6月9日 评论:
6月9日 评论:
Ascend docs pipeline is running...


6月9日 删除了label:docs-ci-pipeline-success
6月9日 添加了label:docs-ci-pipeline-running
ascend-robot
6月9日 评论:
6月9日 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


6月9日 删除了label:docs-ci-pipeline-running
6月9日 添加了label:docs-ci-pipeline-success
kerer-sk
6月9日 评论:
6月9日 评论:
compile


6月9日 添加了label:ci-pipeline-running
ascend-robot
6月9日 评论:
6月9日 评论:
Ascend docs pipeline is running...


6月9日 删除了label:docs-ci-pipeline-success
6月9日 添加了label:docs-ci-pipeline-running
ascend-robot
6月9日 评论:
6月9日 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


6月9日 删除了label:docs-ci-pipeline-running
6月9日 添加了label:docs-ci-pipeline-success
6月9日 删除了label:ci-pipeline-running
6月9日 添加了label:ci-pipeline-passed
ascend-robot
6月9日 评论:
6月9日 评论:
流水线 PR-pipeline_pytorch#30511 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| Build_LibTorch_x86 | ✅ | >>> | |
| Build_LibTorch_ARM | ✅ | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| patch_test | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| CodeCheck_lintrunner | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | ✅ | >>> |
| UT_X86_Part_02 | ✅ | >>> | |
| UT_ARM_A3_Part_01 | ✅ | >>> | |
| UT_ARM_A3_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_03 | ✅ | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Select_Part_02 | ✅ | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


Jingwei Huang
6月9日 评论:
6月9日 评论:
/lgtm


sunyu-xuan
6月9日 评论:
6月9日 评论:
/lgtm


6月9日 添加了label:lgtm
梁松伟
6月9日 评论:
6月9日 评论:
/approve


6月9日 添加了label:approved
6月9日 关闭了关联的issue
6月9日 合入了pull request
ascend-robot
6月9日 评论:
6月9日 评论:
流水线 pytorch_gitcode_PR_multiVersion#10300 [ commitID:a73ef4f6 ] 已完成


变更说明
优化 NPU 上游测试 CI 流水线,实现 PR 级别的自动增量测试触发,修复 JUnit XML 解析缺陷,调整资源参数。
变更内容
新增
.github/scripts/detect_changed_patches.sh:自动对比 PR base/head commit,识别test_upstream/下变更的 patch/diff 文件,推导对应测试文件修复
.github/scripts/run_npu_test_shard.py:正确处理pytest.xfail类型的 skipped 测试;修复 skipped/failure/error 只读 message 属性遗漏元素文本的问题优化
.github/workflows/torch-npu-upstream-test-trigger.yml:重构 trigger 工作流,使用 detect job 自动检测变更.github/workflows/_torch-npu-upstream-build.yml、prepare.yml:checkout 改用github.sha,移除硬编码 repository.github/workflows/_torch-npu-upstream-test-custom.yml:runner 升级至 16 卡,新增--max-workers 16.github/scripts/collect_all_cases.py:--distributed-shards默认值从 2 调整为 5.github/workflows/_torch-npu-upstream-test.yml、_torch-npu-upstream-collect.yml:distributed_shards 默认值同步调整.github/workflows/_torch-npu-upstream-test-regular.yml:移除调试环境变量 dump 步骤关联 Issue
Fixes https://gitcode.com/Ascend/pytorch/issues/2320