已合并
[sync] PR-39043: [fix] 连续性判断 #39102
[sync] PR-39043: [fix] 连续性判断 #39102
已合并
ascend-robot创建于 6月23日
ascend-robot
ascend-robot成员
6月23日

1. Origin pull request:

https://gitcode.com/Ascend/pytorch/merge_requests/39043

https://gitcode.com/Ascend/pytorch/issues/2456

Sha Datetime Message
5b0f3512 2026-06-23 15:06:24 +0800 CST update: 更新文件 combine_tensors.py


Signed-off-by: l1919_snow lixinyu68@huawei.com
d4aa904e 2026-06-23 15:01:01 +0800 CST update: 更新文件 combine_tensors.py


Signed-off-by: l1919_snow lixinyu68@huawei.com
a41d3f48 2026-06-23 14:55:42 +0800 CST update: 更新文件 combine_tensors.py
格式

Signed-off-by: l1919_snow lixinyu68@huawei.com
c484f60f 2026-06-23 14:48:30 +0800 CST update: 更新文件 combine_tensors.py
格式修改

Signed-off-by: l1919_snow lixinyu68@huawei.com
e44f6486 2026-06-22 15:32:19 +0800 CST 连续性判断
likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 ascend-robot 的贡献)
ascend-robotascend-robot成员
6月23日 创建了 pull request,commit 6ad156f8
ascend-robotascend-robot成员
6月23日 关联了issue:[Usage]: 接口输入非内存连续实际无校验,但文档描述必须为内存连续,需要加一个校验:输入非连输入校验。
ascend-robotascend-robot成员
6月23日 添加了label:ascend-cla/yes
ascend-robotascend-robot成员
6月23日 添加了label:stat/needs-squash
ascend-robot
ascend-robot成员
6月23日 评论:

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
torch_npu/utils liangsongwei, htchu (2/2) liangsongwei, htchu (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

ascend-ds-bot, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robot
ascend-robot成员
6月23日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月23日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月23日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月23日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月23日 添加了label:docs-ci-pipeline-success
L1919_snow成员
6月23日 评论:

compile

likedislike
ascend-robotascend-robot成员
6月23日 update merge request[project id: 7404318, iid: 39102, commit_id: 2cc3ea49d9e505bdd80871ceaaaacb73f6b7f53e] virtual merging success
ascend-robotascend-robot成员
6月23日 强制推送  16 个提交:b558dfa3-11 commits from branch v2.9.0d1b6dee6-连续性判断,b3fa3c44-update: 更新文件 combine_tensors.py,41adbce2-update: 更新文件 combine_tensors.py,1f87a692-update: 更新文件 combine_tensors.py,7caebd30-update: 更新文件 combine_tensors.py
ascend-robotascend-robot成员
6月23日 update merge request[project id: 7404318, iid: 39102, commit_id: eb68ddca07dcf27e6f08d4610843c2acc5942237] virtual merging success
ascend-robotascend-robot成员
6月23日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月23日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月23日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月23日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月23日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robot
ascend-robot成员
6月23日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月23日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月23日 添加了label:docs-ci-pipeline-success
ascend-robot
ascend-robot成员
6月23日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月23日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
6月23日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
6月23日 评论:
流水线 PR-pipeline_pytorch#38598 已完成
阶段 任务名 状态 详情
编译构建 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 >>>
likedislike
atomgit-bot
atomgit-bot
6月24日 评论:

变更摘要

此 PR 从原始 PR-39043 同步,修复了 torch_npu/utils/combine_tensors.py 中张量连续性判断缺失的问题。主要改动是在 npu_combine_tensorsis_combined_tensor_valid 两个函数中新增对张量连续性(is_contiguous())的校验,确保在合并张量操作及合并后张量有效性校验时,非连续张量能够被正确识别并拒绝,避免后续数据操作出现异常。

主要改动

  • npu_combine_tensors 新增连续性检查:在遍历待合并张量列表时,新增 if not tensor.is_contiguous() 判断,若非连续张量则直接抛出 RuntimeError,防止非连续张量参与合并导致数据指针操作异常
  • is_combined_tensor_valid 新增连续性校验:在验证合并张量有效性的条件链中追加 not tensor.is_contiguous() 判断,确保非连续张量被判定为无效,使有效性校验逻辑更为完备
  • 格式调整:伴随行尾续行符 or \ 的新增,对 is_combined_tensor_valid 中条件表达式的格式进行了相应调整
likedislike
atomgit-bot
atomgit-bot
6月24日 评论:

代码审查

✅ 未发现问题

likedislike
梁松伟
梁松伟成员
6月24日 评论:

/approve

likedislike
ascend-robotascend-robot成员
6月24日 添加了label:approved
htchu成员
6月25日 评论:

/approve

likedislike
ascend-robotascend-robot成员
6月25日 添加了label:lgtm
ascend-robotascend-robot成员
6月25日 合入了pull request
ascend-robot
ascend-robot成员
6月25日 评论:
流水线 pytorch_gitcode_PR_multiVersion#11257 [ commitID:7caebd30 ] 已完成
likedislike