Files
WSs_321 ded4a2298b [CI] add inductor version exclusion and 26.2.0 branch support for PR pipeline
Co-authored-by: w30057661<wangshusheng7@h-partners.com>



# message auto-generated for no-merge-commit merge:
!46985 merge master into master

[CI] add inductor version exclusion and 26.2.0 branch support for PR pipeline

Created-by: WSs_321
Commit-by: w30057661
Merged-by: ascend-robot
Description: ### 关联 Issue

Closes #5079

### 修改内容

- `check_inductor.yml`:新增版本排除判断,`base.ref` 包含 `v2.12.0` / `v2.13.0` / `v2.14.0` 子串(正则 `v2\.(12|13|14)\.0`)即跳过 inductor 测试,支持 `v2.12.0-26.0.0` 这类后缀分支
- `PR-pipeline_pytorch.yml`:UT_inductor_01~04 移除 `!startsWith(env.target_branch, 'v2.12.0')` 条件,排除逻辑统一下沉到 check_inductor
- `find_torchair.yml`:支持 PR 评论 `compile_torchair` 快速触发,保留 torchair 标签查询兜底
- `PR-pipeline_pytorch.yml`:评论触发支持 `compile_inductor` / `compile_torchair`,新增 2.14.0 镜像
- `get_count.yml`:case 分支改为 `*-26.2.0` glob 匹配,覆盖所有 26.2.0 后缀分支

### test patch 验证(新增)

- `check_patch.yml`:检测 modify_files.txt 中 `test_upstream` 相关改动,输出 `need_patch`
- `test_patch_job.yml`:下载对应版本 pytorch 包,校验 `test_upstream` 的 patch 是否可用,按 `apply_test_patch.sh` 是否存在选择新旧 patch 脚本
- `PR-pipeline_pytorch.yml`:stage_2 接入 check_patch,stage_3 在 `need_patch == 'yes'` 时触发 test_patch(x86 节点)

### 测试说明

- CI 流水线配置变更,验证依赖分支 PR 触发


See merge request: Ascend/pytorch!46985
2026-09-24 18:17:25 +08:00

67 lines
2.0 KiB
YAML

name: UT Job
on:
workflow_call:
inputs:
py_version:
required: false
type: string
default: "3.10"
pr_id:
required: false
type: string
default: ${{ atomgit.event.pull_request.number }}
CP_DOCKER_IMG:
required: true
type: string
torch_branch:
required: true
type: string
runs_on_arch:
required: false
type: string
default: "x64"
runs_on_spec:
required: false
type: string
default: "cpu=32"
jobs:
JOB_UT:
name: JOB_UT
select: selected_by_default
runs-on: [ self-hosted, op_plugin, "${{ inputs.runs_on_arch }}", "${{ inputs.runs_on_spec }}" ]
container:
image: swr.cn-north-4.myhuaweicloud.com/frameworkptadapter/${{ inputs.CP_DOCKER_IMG }}
steps:
- name: checkout torch_npu
uses: checkout
with:
ref: refs/merge-requests/${{ inputs.pr_id }}/merge
fetch-depth: 1
path: ./CODE
allow-unsafe-pr-checkout: true
- name: UT torch_npu
id: ut_npu
run: |
branch="${{ inputs.torch_branch }}"
test_branch="${branch%%-*}"
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/test/github/${test_branch}/pytorch.tar.gz
tar -zxvf pytorch.tar.gz
if [ ! -d CODE/test_upstream ]; then
echo "torch_branch:${branch} 无 test_upstream,跳过 patch 验证"
exit 0
fi
cp -rf CODE/test_upstream pytorch
cd pytorch/test_upstream
if [ -f apply_test_patch.sh ]; then
chmod +x apply_test_patch.sh torch_env_patch.sh
pip3.10 install torch==${test_branch#v}+cpu --index-url https://download.pytorch.org/whl/cpu
./torch_env_patch.sh --python=3.10
./apply_test_patch.sh
else
chmod +x apply_patch.sh
./apply_patch.sh
fi