已合并
feat: add get_p2p_stream_id interface for HCCL backend #32201
pengjingyou创建于 3月23日
feat: add get_p2p_stream_id interface for HCCL backend #32201
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 pengjingyou 的贡献)3月23日 创建了 pull request,commit ee23c030
AtlasAccount
3月23日 评论:
3月23日 评论:
ascend-robot
3月23日 评论:
3月23日 评论:
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 |
|---|---|---|
| test | ✅ renyujin, wjlflyer (2/2) | ✅ renyujin (1/1) |
| torch_npu/csrc/distributed | ✅ renyujin, wjlflyer (2/2) | ✅ renyujin (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
pengjingyou, thanks for your pull request. All authors of the commits have signed the CLA. 👍


3月23日 添加了label:ascend-cla/yes
pengjingyou
3月23日 评论:
3月23日 评论:
compile


3月23日 添加了label:ci-pipeline-running
3月23日 删除了label:ci-pipeline-running
3月23日 添加了label:ci-pipeline-failed
ascend-robot
3月23日 评论:
3月23日 评论:
流水线 PR-pipeline_pytorch#12038 运行失败
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| Build_LibTorch_x86 | ✅ | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | 🛑 | >>> |
| UT_X86_Part_02 | 🛑 | >>> | |
| UT_ARM_A3_Part_01 | 🛑 | >>> | |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_DIST_X86_Part_01 | ✅ | >>> | |
| UT_DIST_X86_Part_02 | ✅ | >>> | |
| UT_DIST_X86_Part_03 | ✅ | >>> | |
| UT_DIST_X86_Part_04 | ❌ | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Part_02 | ✅ | >>> | |
| 流水线 | PR-pipeline_pytorch | ❌ | >>> |


pengjingyou
3月24日 评论:
3月24日 评论:
compile


3月24日 删除了label:ci-pipeline-failed
此处折叠了7条事件消息 查看更多
3月24日 添加了label:ci-pipeline-passed
ascend-robot
3月24日 评论:
3月24日 评论:
流水线 PR-pipeline_pytorch#12072 (重试第2次)已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| Build_LibTorch_x86 | ✅ | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | 🛑 | >>> |
| UT_X86_Part_02 | 🛑 | >>> | |
| UT_ARM_A3_Part_01 | 🛑 | >>> | |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_DIST_X86_Part_01 | ✅ | >>> | |
| UT_DIST_X86_Part_02 | ✅ | >>> | |
| UT_DIST_X86_Part_03 | ✅ | >>> | |
| UT_DIST_X86_Part_04 | ✅ | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Part_02 | ✅ | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


3月25日 添加了label:approvedlgtm
ascend-robot
3月25日 评论:
3月25日 评论:
3月25日 合入了pull request
【合入来源】
为 HCCL 后端新增 get_p2p_stream_id 接口,用于获取 P2P 通信的 NPU stream ID,方便用户在分布式训练场景下进行 stream 级别的同步和管理。
【修改方案】
在 ProcessGroupHCCL 类中新增 getP2PStreamId 方法,支持两种模式:
在 Init.cpp 中添加 Python 绑定,暴露 get_p2p_stream_id 接口到 Python 层
【资料变更】
【接口变更】
设备 peer: int - 对端 rank
is_batched: int - 是否批量模式 (1=批量, 0=非批量)
【功能验证】
新增测试文件 test/distributed/test_get_p2p_stream_id.py ,包含以下测试场景:
python -m pytest test/distributed/test_get_p2p_stream_id.py

调用dist.send/recv方法进行p2p通信后,通过该新增接口get_p2p_stream_id()获取p2p stream id,拿到id对应的Stream实例,指定在该Stream上进行计算操作。
通过profiling文件可以看到计算在p2p stream上进行
【CheckList】