已合并
feat(autocast): 支持float32作为自动混合精度计算的数据类型 #30513
liaolile创建于 2月4日
feat(autocast): 支持float32作为自动混合精度计算的数据类型 #30513
已合并
liaolile创建于 2月4日
liaolile
liaolile
2月4日

【合入来源】

(如有)请关联需求文档/issue链接

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个用例场景,验证暂无问题
image.png

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

【CheckList】

PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 liaolile 的贡献)
liaolileliaolile
2月4日 创建了 pull request,commit 609b7ae4
liaolileliaolile
2月4日 关联了issue:[Feature]: 支持float32作为自动混合精度计算的数据类型
ascend-robot
ascend-robot成员
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
likedislike
ascend-robotascend-robot成员
2月4日 添加了label:ascend-cla/yes
liaolile
liaolile
2月4日 评论:

compile

likedislike
ascend-robotascend-robot成员
2月4日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
2月4日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
2月4日 添加了label:ci-pipeline-failed
ascend-robot
ascend-robot成员
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 >>>
likedislike
liaolileliaolile
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 6d3ac19da1b70264c638a56bf44d2f8953c61885] virtual merging success
liaolileliaolile
2月5日 强制推送  1 个提交:c3f934d8-feat(autocast): 支持float32作为自动混合精度计算的数据类型
liaolileliaolile
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3ced980bb5dfb82ad9d0870449fc968452b3e583] virtual merging success
AtlasAccountAtlasAccount成员
2月5日 删除了label:ci-pipeline-failed
AtlasAccountAtlasAccount成员
2月5日 添加了label:ci-pipeline-failed
liaolile
liaolile
2月5日 评论:

compile

likedislike
ascend-robotascend-robot成员
2月5日 删除了label:ci-pipeline-failed
ascend-robotascend-robot成员
2月5日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
2月5日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
2月5日 添加了label:ci-pipeline-failed
ascend-robot
ascend-robot成员
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 >>>
likedislike
liaolileliaolile
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: f650ba273ebc5f0fe3a8c4f65619636d956162c2] virtual merging success
liaolileliaolile
2月5日 强制推送  1 个提交:af52942d-feat(autocast): 支持float32作为自动混合精度计算的数据类型
liaolileliaolile
2月5日 update merge request[project id: 7404318, iid: 30513, commit_id: 3aac880a1669959089b91e0a2fc94ef44f247532] virtual merging success
liaolile
liaolile
2月5日 评论:

compile

likedislike
ascend-robot
ascend-robot成员
2月5日 评论:

CLA Signature Pass

leland17, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
AtlasAccountAtlasAccount成员
2月5日 删除了label:ci-pipeline-failed
AtlasAccountAtlasAccount成员
2月5日 添加了label:ci-pipeline-failed
ascend-robotascend-robot成员
2月5日 删除了label:ci-pipeline-failed
ascend-robotascend-robot成员
2月5日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
2月5日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
2月5日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
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 >>>
likedislike
liwei386成员
2月5日 评论:

/approve

likedislike
ascend-robotascend-robot成员
2月5日 添加了label:lgtm
zhangqiongwen成员
2月5日 评论:

/approve

likedislike
ascend-robotascend-robot成员
2月5日 添加了label:approved
ascend-robot
ascend-robot成员
2月5日 评论:

Review Guide

This Pull-Request Passes Review.
Committers who wrote a comment of /approve are: liwei386, zqwenn.
Reviewers who wrote a comment of /lgtm are: zqwenn, liwei386.

likedislike
ascend-robotascend-robot成员
2月5日 合入了pull request