已合并
[sync] PR-40339: modify _dynamo_device.py for benchmarks multi process set device error #40450
ascend-robot创建于 7月8日
[sync] PR-40339: modify _dynamo_device.py for benchmarks multi process set device error #40450
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 ascend-robot 的贡献)7月8日 创建了 pull request,commit e2f059b0
7月8日 关联了issue:[Bug]: A5 跑benchmark的triton 后端 BERT_pytorch模型,plog报set_device卡死
atomgit-bot
7月8日 评论:
7月8日 评论:
变更摘要
此 PR 修复了 NpuInterface.exchange_device 静态方法在多进程场景下可能出现的 set device 错误。原实现无条件调用 set_device(device),在目标设备与当前设备相同时仍会执行设备切换,导致多进程 benchmark 运行出错。变更通过在调用 set_device 前增加设备一致性判断来避免冗余的设备切换操作。
主要改动
NpuInterface.exchange_device增加设备一致性检查: 在torch_npu/utils/_dynamo_device.py中,exchange_device方法原先无条件调用set_device(device),现改为仅当curr_device != device时才执行set_device(device),避免在目标设备与当前设备相同时重复切换设备,从而消除多进程场景下的 set device 错误。


不准确?
atomgit-bot
7月8日 评论:
7月8日 评论:
ascend-robot
7月8日 评论:
7月8日 评论:
7月8日 添加了label:ascend-cla/yes
ascend-robot
7月8日 评论:
7月8日 评论:
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 | ✅ htchu, ffmh (2/2) | ✅ htchu (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies 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. 👍


7月8日 添加了label:ci-pipeline-running
ascend-robot
7月8日 评论:
7月8日 评论:
ascend docs pipeline is running...


7月8日 添加了label:docs-ci-pipeline-running
ascend-robot
7月8日 评论:
7月8日 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


7月8日 删除了label:docs-ci-pipeline-running
7月8日 添加了label:docs-ci-pipeline-success
7月8日 删除了label:ci-pipeline-running
7月8日 添加了label:ci-pipeline-passed
ascend-robot
7月8日 评论:
7月8日 评论:
流水线 PR-pipeline_pytorch#42268 [ commitID:78f1ad34 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


7月9日 添加了label:approved
ffmh
7月9日 评论:
7月9日 评论:
/lgtm


7月9日 添加了label:lgtm
7月9日 合入了pull request
ascend-robot
7月9日 评论:
7月9日 评论:
流水线 pytorch_gitcode_PR_multiVersion#12289 [ commitID:78f1ad34 ] 已完成


1. Origin pull request:
https://gitcode.com/Ascend/pytorch/merge_requests/40339
2. Original pull request related issue(s):
https://gitcode.com/Ascend/pytorch/issues/2645
3. Original pull request related commit(s):