已合并
feat(autocast): 支持float32作为自动混合精度计算的数据类型 #30513
liaolile创建于 2月4日
feat(autocast): 支持float32作为自动混合精度计算的数据类型 #30513
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 liaolile 的贡献)2月4日 关联了issue:[Feature]: 支持float32作为自动混合精度计算的数据类型
AtlasAccount
2月4日 评论:
2月4日 评论:
ascend-robot
2月4日 评论:
2月4日 评论:
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
以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入.
| Module List | Reviewers | Committers |
|---|---|---|
| test | medivh-x, huangyunlong2022, guoguanghao, rain-666, wangchao285 | li_jing_hw, chenhao_1209, anyrenwei, zichun_ye, wangqiang160 |
| repo-Ascend/pytorch | SCh_zx, zhanj, zqwenn, chuboning, duchengkun | li_jing_hw, dilililiwhy, wangchao430, wangchao285, wasd1111222 |


2月4日 添加了label:ascend-cla/yes
liaolile
2月4日 评论:
2月4日 评论:
compile


2月4日 添加了label:ci-pipeline-running
2月4日 删除了label:ci-pipeline-running
2月4日 添加了label:ci-pipeline-failed
ascend-robot
2月4日 评论:
2月4日 评论:
流水线 PR-pipeline_pytorch#6199 运行失败
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🕚 | >>> |
| Build_LibTorch | 🕚 | >>> | |
| Build_ARM | 🕚 | >>> | |
| Build_ARM_inductor | 🕚 | >>> | |
| Build_X86_py311 | 🕚 | >>> | |
| Build_ARM_py311 | 🕚 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🕚 | >>> |
| UT_X86_Part_01 | 🕚 | >>> | |
| UT_X86_Part_02 | 🕚 | >>> | |
| UT_ARM_A2_Part_01 | 🕚 | >>> | |
| UT_ARM_A2_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_01 | 🕚 | >>> | |
| UT_inductor_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_03 | 🕚 | >>> | |
| UT_inductor_Part_04 | 🕚 | >>> | |
| 流水线 | PR-pipeline_pytorch | ❌ | >>> |


2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 6d3ac19da1b70264c638a56bf44d2f8953c61885] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 6d3ac19da1b70264c638a56bf44d2f8953c61885] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3ced980bb5dfb82ad9d0870449fc968452b3e583] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3ced980bb5dfb82ad9d0870449fc968452b3e583] virtual merging success
2月5日 删除了label:ci-pipeline-failed
2月5日 添加了label:ci-pipeline-failed
liaolile
2月5日 评论:
2月5日 评论:
compile


2月5日 删除了label:ci-pipeline-failed
2月5日 添加了label:ci-pipeline-running
2月5日 删除了label:ci-pipeline-running
2月5日 添加了label:ci-pipeline-failed
ascend-robot
2月5日 评论:
2月5日 评论:
流水线 PR-pipeline_pytorch#6231 运行失败
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🕚 | >>> |
| Build_LibTorch | 🕚 | >>> | |
| Build_ARM | 🕚 | >>> | |
| Build_ARM_inductor | 🕚 | >>> | |
| Build_X86_py311 | 🕚 | >>> | |
| Build_ARM_py311 | 🕚 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🕚 | >>> |
| UT_X86_Part_01 | 🕚 | >>> | |
| UT_X86_Part_02 | 🕚 | >>> | |
| UT_ARM_A2_Part_01 | 🕚 | >>> | |
| UT_ARM_A2_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_01 | 🕚 | >>> | |
| UT_inductor_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_03 | 🕚 | >>> | |
| UT_inductor_Part_04 | 🕚 | >>> | |
| 流水线 | PR-pipeline_pytorch | ❌ | >>> |


2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: f650ba273ebc5f0fe3a8c4f65619636d956162c2] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: f650ba273ebc5f0fe3a8c4f65619636d956162c2] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3aac880a1669959089b91e0a2fc94ef44f247532] virtual merging success
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3aac880a1669959089b91e0a2fc94ef44f247532] virtual merging success
liaolile
2月5日 评论:
2月5日 评论:
compile


ascend-robot
2月5日 评论:
2月5日 评论:
2月5日 删除了label:ci-pipeline-failed
2月5日 添加了label:ci-pipeline-failed
2月5日 删除了label:ci-pipeline-failed
2月5日 添加了label:ci-pipeline-running
2月5日 删除了label:ci-pipeline-running
2月5日 添加了label:ci-pipeline-passed
ascend-robot
2月5日 评论:
2月5日 评论:
流水线 PR-pipeline_pytorch#6232 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_LibTorch | ✅ | >>> | |
| Build_ARM | ✅ | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| Build_X86_py311 | 🛑 | >>> | |
| Build_ARM_py311 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🛑 | >>> |
| UT_X86_Part_01 | ✅ | >>> | |
| UT_X86_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


2月5日 添加了label:lgtm
zhangqiongwen
2月5日 评论:
2月5日 评论:
/approve


2月5日 添加了label:approved
ascend-robot
2月5日 评论:
2月5日 评论:
2月5日 合入了pull request
【合入来源】
issue:支持float32作为自动混合精度计算的数据类型
【修改方案】
当前现状with autocast(device="npu", dtype=torch.float32)暂时不支持按照float32的精度获取结果。同liwei有过详细的讨论方案,并且确定了如下的支持思路
在autocast_utils.py中支持float32的数据类型支持。
【资料变更】
【接口变更】
【功能验证】
cd ${pytorch}/test && python -m unittest test_autocast.TestAutocastNPUfp32新增4个用例场景,验证暂无问题

整体test_autocast.py的用例执行结果

【CheckList】