已合并
test: add ShapeEnv API alignment tests for symbolic_shapes #38160
liuhaodong-2026创建于 6月10日
test: add ShapeEnv API alignment tests for symbolic_shapes #38160
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 liuhaodong-2026 的贡献)6月10日 创建了 pull request,commit a1de29fc
6月10日 关联了issue:【开源实习】Torch-NPU API一致性对齐:补齐测试用例、API功能对齐、补齐文档(18)
ascend-robot
6月10日 评论:
6月10日 评论:
6月10日 添加了label:ascend-cla/yes
ascend-robot
6月10日 评论:
6月10日 评论:
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 |
|---|---|---|
| test | ✅ suhaibo, huangjingwei (2/2) | ✅ suhaibo (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
liuhaodong-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍


ascend-robot
6月10日 评论:
6月10日 评论:
当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.9.0 | ||
| v2.11.0 | ||
| v2.10.0 | ||
| v2.12.0 | ||
| v2.7.1 | ||
| v2.7.1-26.1.0 | ||
| v2.9.0-26.1.0 | ||
| v2.12.0-26.1.0 | ||
| v2.11.0-26.1.0 | ||
| v2.10.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月10日 评论:
6月10日 评论:
Ascend docs pipeline is running...


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


6月10日 删除了label:docs-ci-pipeline-running
6月10日 添加了label:docs-ci-pipeline-success
6月11日 修改了pull request 的描述
6月16日 修改了pull request 的描述
Jingwei Huang
6月18日 评论:
6月18日 评论:
/lgtm


liuhaodong-2026
6月18日 评论:
6月18日 评论:
compile


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


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


6月18日 删除了label:docs-ci-pipeline-running
6月18日 添加了label:docs-ci-pipeline-success
6月19日 删除了label:ci-pipeline-running
6月19日 添加了label:ci-pipeline-passed
ascend-robot
6月19日 评论:
6月19日 评论:
流水线 PR-pipeline_pytorch#33552 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 | ✅ | >>> |


liuhaodong-2026
6月29日 评论:
6月29日 评论:
compile


6月29日 删除了label:ci-pipeline-passed
6月29日 添加了label:ci-pipeline-running
ascend-robot
6月29日 评论:
6月29日 评论:
ascend docs pipeline is running...


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


6月29日 删除了label:docs-ci-pipeline-running
6月29日 添加了label:docs-ci-pipeline-success
6月29日 删除了label:ci-pipeline-running
6月29日 添加了label:ci-pipeline-passed
ascend-robot
6月29日 评论:
6月29日 评论:
流水线 PR-pipeline_pytorch#39888 [ commitID:28adc08a ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


ascend-robot
6月29日 评论:
6月29日 评论:
流水线 PR-pipeline_pytorch#39888 [ commitID:28adc08a ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


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


6月29日 添加了label:approvedlgtm
6月29日 合入了pull request
ascend-robot
6月29日 评论:
6月29日 评论:
流水线 pytorch_gitcode_PR_multiVersion#11544 [ commitID:28adc08a ] 已完成


【合入来源】
关联 issue: #1624
【修改方案】
为 torch.fx.experimental.symbolic_shapes.ShapeEnv 的 5 个 API 补齐测试用例:
新增测试文件
test/fx/test_shape_env_apis.py,覆盖以下 API:torch.fx.experimental.symbolic_shapes.ShapeEnv.deserialize_symexprtorch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_symexprtorch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expressiontorch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_for_argstorch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_sym_node用例完备性分析:
ShapeEnv.evaluate_guards_expression:PyTorch 社区已有相关用例,位于test/test_dynamic_shapes.py,主要为符号表达式验证,不涉及 NPU 张量。本 PR 补充直接 API 调用验证。ShapeEnv.evaluate_sym_node:PyTorch 社区已有相关用例,位于test/dynamo/test_dynamic_spec.py,主要为错误行为验证。本 PR 补充正常路径 API 调用验证。ShapeEnv.deserialize_symexpr、ShapeEnv.evaluate_symexpr、ShapeEnv.evaluate_guards_for_args:PyTorch 社区无直接测试用例,本 PR 补充对应直接调用测试。测试场景覆盖:
size_oblivious参数下的求值验证。【资料变更】
不涉及(文档已在独立 PR #38301 中提交)
【接口变更】
不涉及
【功能验证】
在 NPU 环境下执行新增测试文件:
python test/fx/test_shape_env_apis.py执行结果:
Ran 14 tests in 1.119s OK【CheckList】