Pull Request已成功合入, 合并人@ascend-robot
(感谢 limuan 的贡献)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, senzhen-town (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
limuan, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Linking Issue Notice
@limuan , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .


当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.9.0 | ||
| v2.9.0-26.1.0 | ||
| v2.7.1 | ||
| v2.7.1-26.1.0 | ||
| v2.10.0-26.1.0 | ||
| v2.11.0-26.1.0 | ||
| v2.10.0 | ||
| v2.12.0 | ||
| v2.11.0 | ||
| v2.12.0-26.1.0 | ||
| ci-test | ||
| sync-pr28113--to-v2.9.0 |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


变更摘要
此 PR 修复了 test_hccl_shared_buffer.py 中三处内存期望值的计算公式,将容差 tol 从之前仅在末尾加一次的方式,改为按不同 buffer group 数量累积计算,使期望值能正确反映多 group 场景下的累计误差。
主要改动
- 修正
pg1段内存期望值计算:将expected = buffer_size * num_different_buffer_group + tol改为expected = (buffer_size + tol) * num_different_buffer_group,容差按 group 数累积。 - 修正
pg2段内存期望值计算:采用相同的公式变更,使同 buffer 复用时(num_different_buffer_group未递增)的期望值计算保持一致。 - 修正
pg3段内存期望值计算:同样将容差纳入乘法因子,确保不同 buffer 新增 group 后预期内存差值正确。


ascend docs pipeline is running...


✅ 跳过 docs ci 检查,没有需要检查的文档文件


代码审查
审查总结
已审查文件: test/distributed/test_hccl_shared_buffer.py — 已审查,发现 2 个问题。
| 优先级 | 数量 | 说明 |
|---|---|---|
| P2 | 1 | _test_buffer_memory 与 _test_buffer_memory_with_deleted_pg 之间的容差公式不一致 —— 伴随方法未随此 diff 更新。对于 num_different_buffer_group = 2,新公式使上界放宽了 0.25 * buffer_size,可能掩盖共享缓冲区内存测试中的回归问题。 |
| P3 | 1 | 第 341 行存在多余空格(仅格式问题,无功能影响)。 |
总体风险评估: 中等。不一致性表明此变更可能不完整 —— 要么两个伴随方法都应使用新公式,要么都不应使用。如果是有意仅更新一个方法,则需提供理由;否则应统一处理。所幸在 _test_buffer_memory_with_deleted_pg 中,num_different_buffer_group 始终为 1,因此该方法的实际行为不受影响。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 : 停止流水线


compile


ascend docs pipeline is running...


✅ 跳过 docs ci 检查,没有需要检查的文档文件


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | 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 : 停止流水线


/lgtm


【合入来源】
【修改方案】
用例中,原来内存占用的预期值为:groupnum*buffer_size + tol (tol为100,在通信域较多,可能无法coverbuffersize外的通信域内存开销),现在改为
每个通信域多预留100MB,100MB远远小于用例本身buffersize的400MB,可以看护共享内存功能
【资料变更】
不涉及
【接口变更】
不涉及
【功能验证】
修改后用例通过

【CheckList】