Merged
docs: mark torch.layout as supported on Ascend 950DT #46016
zhangjiahao-2026Add on Sep 8
docs: mark torch.layout as supported on Ascend 950DT #46016
Merged
Pull Request has been successfully merged by ascend-robot.
(Thank you for zhangjiahao-2026's contribution.)Sep 8 Created pull request, commit 0bcd0522
Sep 8 Associated issue: 【API一致性任务】torch.layout 社区已有用例且无需额外 NPU 适配
atomgit-bot
Sep 8 Comments:
Sep 8 Comments:
变更摘要
本 PR 为纯资料更新,在 master 分支的原生 API 文档中将公开非计算类接口 torch.layout 在 Ascend 950DT 上的支持状态由「不支持」更新为「支持」。修改涉及 docs/zh/api/native_api/ 下 PyTorch 2.7.1、2.11.0、2.12.0、2.13.0 四个版本的 Tensor-Attributes.md 文件,每个文件仅改动 torch.layout 的 Ascend 950DT 支持标记;Atlas A2、Atlas A3 的支持标记保持不变,不新增 A5/950PR 产品字段。由于该 API 为非计算类接口、与张量数据类型无关,资料中不填写数据类型限制。
主要改动
- 更新 PyTorch 2.7.1 资料: 在
docs/zh/api/native_api/pytorch_2-7-1/Tensor-Attributes.md中将torch.layout的Ascend 950DT支持标记由「不支持」改为「支持」 - 更新 PyTorch 2.11.0 资料: 在
docs/zh/api/native_api/pytorch_2-11-0/Tensor-Attributes.md中将torch.layout的Ascend 950DT支持标记由「不支持」改为「支持」 - 更新 PyTorch 2.12.0 资料: 在
docs/zh/api/native_api/pytorch_2-12-0/Tensor-Attributes.md中将torch.layout的Ascend 950DT支持标记由「不支持」改为「支持」 - 更新 PyTorch 2.13.0 资料: 在
docs/zh/api/native_api/pytorch_2-13-0/Tensor-Attributes.md中将torch.layout的Ascend 950DT支持标记由「不支持」改为「支持」


Incorrect?
atomgit-bot
Sep 8 Comments:
Sep 8 Comments:
🤖 本次改动均为数据 / 生成 / 二进制文件(如测试用例、锁文件、媒体资源),没有可审查的代码逻辑,已跳过 AI 代码审查。


Incorrect?
Sep 8 Added label: ascend-cla/yes
70 messages are collapsed here。 See more
Oct 10 Merged pull request
ascend-robot
Oct 10 Comments:
Oct 10 Comments:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


Oct 10 Removed label: docs-ci-pipeline-running
Oct 10 Added label: docs-ci-pipeline-success
AtlasAccount
Oct 10 Comments:
Oct 10 Comments:
流水线 pytorch_gitcode_PR_multiVersion-onetrack#309 [ commitID:94596025 ] 已完成


【合入来源】
关联任务issue: https://gitcode.com/Ascend/pytorch/issues/3378
【修改方案】
在 master 资料中更新公开非计算类 API
torch.layout的 Ascend 950DT 支持情况。修改文件:
具体修改内容:
torch.layout的Ascend 950DT由「不支持」改为「支持」;本 PR 仅修改目标 API 的 950DT 支持标记,不批量修改同一文件中其他历史 API 的资料内容。
【资料变更】
资料检查结果:master 下的原生 API 资料已收录
torch.layout,Atlas A2、Atlas A3 标记为支持,Ascend 950DT 原标记为不支持。本次已补充 A5(Ascend950PR)实机验证并通过,因此将以下版本目录
Tensor-Attributes.md中torch.layout的 Ascend 950DT 更新为支持:该 API 为公开非计算类接口,与张量数据类型无关,不填写数据类型限制。
【接口变更】
不涉及
【功能验证】
torch.layout是表示torch.Tensor内存布局的 PyTorch 原生类型。本任务验证现有社区用例覆盖的torch.zeros + torch.strided路径。PyTorch 官方社区在以下用例中已有相关验证:
torch.layout由 PyTorch 框架公共代码注册,不包含 NPU 专属 kernel 或设备分支,不需要修改 Torch-NPU 功能实现,也不需要新增测试文件或test_upstreampatch。API 功能、社区用例情况、NPU 适配分析和各版本验证结果见说明 Issue:
https://gitcode.com/Ascend/pytorch/issues/3378
A5 硬件验证信息如下。
验证设备:
验证环境:
验证命令:
验证场景:对齐社区用例
test_zeros_dtype_layout_device_match,在 NPU 上使用layout=torch.strided调用torch.zeros((2, 3), ...),覆盖以下 7 种 dtype:torch.booltorch.uint8torch.int16torch.int64torch.float16torch.float32torch.complex64每种 dtype 均校验返回 Tensor 的
dtype、layout、device与入参一致。运行截图:
验证结论:
torch.layout的torch.zeros + torch.strided路径在上述 A5(Ascend950PR)环境中 7 种 dtype 均验证通过。本结论不扩大为所有稀疏 layout 及其相关算子均已完成兼容性验证。【CheckList】