Merged
[Docs] Add support information for torch.utils.checkpoint.get_device_states #44713
Andy ZhangAdd on Aug 17
[Docs] Add support information for torch.utils.checkpoint.get_device_states #44713
Merged
Pull Request has been successfully merged by ascend-robot.
(Thank you for Andy Zhang's contribution.)Aug 17 Created pull request, commit 8ff70011
Aug 17 Associated issue: 【API一致性任务】8月社区任务第二期-Ascend for PyTorch API 一致性开发(28),[Usage]: 【API一致性任务】8月社区任务第二期-Ascend for PyTorch API 一致性开发(28)API一致性说明:torch.utils.checkpoint.get_device_states 支持情况及资料补齐说明
Aug 17 Associated issue: 【API一致性任务】8月社区任务第二期-Ascend for PyTorch API 一致性开发(28),[Usage]: 【API一致性任务】8月社区任务第二期-Ascend for PyTorch API 一致性开发(28)API一致性说明:torch.utils.checkpoint.get_device_states 支持情况及资料补齐说明
atomgit-bot
Aug 17 Comments:
Aug 17 Comments:
变更摘要
该 PR 属于文档类变更,主要目标是在 PyTorch 多版本的 API 支持资料中补充 torch.utils.checkpoint.get_device_states 的支持说明。改动覆盖 PyTorch 2.7.1、2.11.0、2.12.0、2.13.0 四个版本,将该 API 在 Atlas A2、Atlas A3、Ascend 950DT 设备上标记为支持。本次仅修改 API 支持资料,不涉及 API 实现调整,也未新增测试用例(现有 test/test_utils.py::TestCheckpoint::test_checkpoint_rng_cuda 已覆盖该 API 的核心功能)。
主要改动
- 补充
torch.utils.checkpoint.get_device_states支持记录:在 PyTorch 2.7.1、2.11.0、2.12.0、2.13.0 四个版本对应的支持资料中新增该 API 的支持说明。 - 标注硬件支持范围:将
torch.utils.checkpoint.get_device_states在 Atlas A2、Atlas A3 和 Ascend 950DT 上标记为支持。 - 仅更新文档类资料:本次变更只涉及 API 支持资料的修改(4 个文件、64 行新增、0 行删除),未修改 API 实现,也未新增或调整测试用例。


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


Incorrect?
85 messages are collapsed here。 See more
AtlasAccount
Oct 10 Comments:
Oct 10 Comments:
流水线 PR-pipeline_pytorch#72129 [ commitID:afb86092 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ⚪ IGNORED | >>> |
| Build_ARM | ⚪ IGNORED | >>> | |
| Build_X86_torchair | ⚪ IGNORED | >>> | |
| Build_ARM_torchair | ⚪ IGNORED | >>> | |
| patch_test | ⚪ IGNORED | >>> | |
| Build_X86_213 | ⚪ IGNORED | >>> | |
| Build_ARM_213 | ⚪ IGNORED | >>> | |
| 恶意代码检查 | Antipoison | ✅ COMPLETED | >>> |
| 编码安全与规范检查 | check_error | ✅ COMPLETED | >>> |
| lintrunner | ✅ COMPLETED | >>> | |
| 开源片段检查 | SCA | ✅ COMPLETED | >>> |
| 开发者测试 | UT_ARM_A2_Part_01 | ⚪ IGNORED | >>> |
| UT_ARM_A2_Part_02 | ⚪ IGNORED | >>> | |
| UT_ARM_A2_Part_03 | ⚪ IGNORED | >>> | |
| UT_inductor_Part_01 | ⚪ IGNORED | >>> | |
| UT_inductor_Part_02 | ⚪ IGNORED | >>> | |
| UT_inductor_Part_03 | ⚪ IGNORED | >>> | |
| UT_inductor_Part_04 | ⚪ IGNORED | >>> | |
| UT_DIST_ARM_Part_01 | ⚪ IGNORED | >>> | |
| UT_DIST_ARM_Part_02 | ⚪ IGNORED | >>> | |
| UT_DIST_ARM_Part_03 | ⚪ IGNORED | >>> | |
| UT_DIST_ARM_Part_04 | ⚪ IGNORED | >>> | |
| UT_ARM_A2_Select_Part_01 | ⚪ IGNORED | >>> | |
| UT_ARM_A2_Select_Part_02 | ⚪ IGNORED | >>> | |
| UT_inductor_Part1_213 | ⚪ IGNORED | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ COMPLETED | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


Oct 10 Merged pull request
ascend-robot
Oct 10 Comments:
Oct 10 Comments:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


ascend-robot
Oct 10 Comments:
Oct 10 Comments:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


AtlasAccount
Oct 10 Comments:
Oct 10 Comments:
流水线 pytorch_gitcode_PR_multiVersion-onetrack#326 [ commitID:afb86092 ] 已完成


修改内容
在以下 PyTorch 版本的
torch.utils.checkpoint支持资料中补充torch.utils.checkpoint.get_device_states:该 API 在 Atlas A2、Atlas A3 和 Ascend 950DT 上标记为支持。
社区用例情况
PyTorch 社区已有 checkpoint RNG 保存和恢复用例。
TorchNPU 的
test/test_utils.py::TestCheckpoint::test_checkpoint_rng_cuda已经使用 NPU 张量、NPU Dropout 和
torch.npu.get_rng_state()完成适配,能够通过 checkpoint 调用链覆盖
torch.utils.checkpoint.get_device_states的核心功能。现有用例覆盖充分,因此无需新增测试用例。
NPU 验证
验证环境:
验证结果:
test_checkpoint_rng_cuda:PASS其他检查
git diff --check通过。关联任务:
https://gitcode.com/Ascend/pytorch-ecosystem/issues/149
支持说明 Issue:
https://gitcode.com/Ascend/pytorch/issues/4089