已合并
fix(test): correct expected buffer size calculation in test_hccl_shared_buffer #39511
fix(test): correct expected buffer size calculation in test_hccl_shared_buffer #39511
已合并
limuan创建于 6月29日
limuan
limuan成员
6月29日
# 【合入来源】 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 用例中,原来内存占用的预期值为:groupnum*buffer_size + tol (tol为100,在通信域较多,可能无法coverbuffersize外的通信域内存开销),现在改为 每个通信域多预留100MB,100MB远远小于用例本身buffersize的400MB,可以看护共享内存功能 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 修改后用例通过 ![image.png](https://raw.gitcode.com/user-images/assets/7404318/da3a7a44-a61b-48cf-bc56-a8e90e02ce06/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常
likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 limuan 的贡献)
limuanlimuan成员
6月29日 创建了 pull request,commit 1a9f62a7
ascend-robotascend-robot成员
6月29日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
6月29日 评论:

CLA Signature Pass

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

likedislike
ascend-robotascend-robot成员
6月29日 添加了label:needs-issue
ascend-robot
ascend-robot成员
6月29日 评论:

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 /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
ascend-robot
ascend-robot成员
6月29日 评论:

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 .

likedislike
ascend-robot
ascend-robot成员
6月29日 评论:

当前仓库存在以下 保护分支

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,将立即执行同步操作

注意:

  1. /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
  2. 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭
likedislike
ascend-robotascend-robot成员
6月29日 添加了label:ci-pipeline-running
atomgit-bot
atomgit-bot
6月29日 评论:

变更摘要

此 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,使容差随不同 buffer group 的数量等比例缩放。
  • 修正 pg2 内存期望值公式: 同 pg1,将容差从全局一次性叠加改为按 group 累积。
  • 修正 pg3 内存期望值公式: 同 pg1/pg2,保持三处公式一致(第三处还包含一个多余空格的格式微调)。
likedislike
ascend-robot
ascend-robot成员
6月29日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月29日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月29日 评论:

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

likedislike
ascend-robotascend-robot成员
6月29日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月29日 添加了label:docs-ci-pipeline-success
atomgit-bot
atomgit-bot
6月29日 评论:

代码审查

Now let me do the final silent sweep:

  • Boundary: num_different_buffer_group starts at 0, always incremented to ≥1 before expected computation. No division-by-zero or negative value concerns.
  • Hot-path: Test code, not applicable.
  • Co-located: Double-checked lines 316, 328, 341 — only the formula issue found, which is already reported. The [0] indexing on memory_info_before and mem_after tuples from mem_get_info is consistent (unchanged code).

审查总结

优先级 数量
P0 0
P1 0
P2 1
P3 0

已审查文件:

  • test/distributed/test_hccl_shared_buffer.py — 发现 1 个问题(P2)

整体风险评估: 中等风险。该变更将 tol(注释明确为固定输入/框架开销的容差)从全局加数变为随 buffer group 数量放大的乘数,在 num_different_buffer_group > 1 时使测试的 expected 上界更宽松(多出 buffer_size * 0.25 的额外松弛),可能降低测试对内存回归的检测能力。同时姐妹函数 _test_buffer_memory_with_deleted_pg 未同步更新,形成代码不一致。建议确认 tol 的真实语义后统一处理。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
limuan
limuan成员
6月29日 评论:

compile

likedislike
ascend-robotascend-robot成员
6月29日 删除了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月29日 评论:
流水线 PR-pipeline_pytorch#39791 [ commitID:b00e6a96 ] 已终止运行
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 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 🟨 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, huangjingwei, liangsongwei, yashi999, culechan, Dring, wuyouqi1, L1919_snow, qq_52711437, WhiteNight12, nomiz, xiu_21, ffmh, wanglijun55, hss-shuai, husichao, smallsilly, lanshaozuishuai, jimmyisme1, lzy0920232, alpha-junh, Sunshine_Youngster, wei_zhuoyi, zhangyihuiben, zyw-hw, zzzkeke, rmch, yangch0324, LucciC, AACAES, renyujin, wjlflyer, senzhen-town, pengjingyou, qsc97, limuan, yule100, xiaoqi-zhou, kuhn7, chenxingying, hanye02, zichun_ye, anyrenwei, kkjocker, wangzili121, Lu_G, yvjc, puddingfjz, HandsoemLemon, bigprestigee1, huawuyi, zhenyu10, dairenjie, du-jin-hang, zou-jieyu, adelaideliu, TrHan, wanlinan, Windwindzzz, pengqihw, kisnwang, yuheng_wang, honghao_wang, jizewei, zhangguoguang, sunyu-xuan, chenrayray, hbhu_bin, liujunzhu, c_34, LiNuoh, maoyuanpeng1, zzhongmin, zhaoyu65, bellatan, jiabaolin, zhuofanshen, wencaiwen, lu_zhuge, caoshuyang, molly12, lyx324521, LQ1206, gitcode-chenjiao, cai-weiwei1989, CHDong, ogqin, yuanlipingGit, xuqinglin1, lqz2, zouwei1, chaoluoa, paradox325, jackzhang1116, yaoyao, akh, yujiacheng, dengjie0116, Hubert11111, Shine_Ws, wslhj555, longqiand, OYtao666, JiaqingQiang, luyyyy, Kingbelial, zhanghaiyu0101, wenxp1018, yanliu-luoluo, ksun_sekiro, liyong328, wgzheng, tangky, vivi_is_coding, aoiaoisola, weixin_44494597, wangmengmengwang65667, hid57809721, qq_35468730, comeonup, C547032, gcw_m5OQChA4, yao_yao_ling_xian, cnnbwcy, szqfes_12, cora_19, cann_lilin, can]评论有效
  • compile、compile_inductor、compile_torchair : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
ascend-robotascend-robot成员
6月29日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月29日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月29日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月29日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月29日 评论:

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

likedislike
ascend-robotascend-robot成员
6月29日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月29日 添加了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月29日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
6月29日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
6月29日 评论:
流水线 PR-pipeline_pytorch#39803 [ commitID:b00e6a96 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 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 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, huangjingwei, liangsongwei, yashi999, culechan, Dring, wuyouqi1, L1919_snow, qq_52711437, WhiteNight12, nomiz, xiu_21, ffmh, wanglijun55, hss-shuai, husichao, smallsilly, lanshaozuishuai, jimmyisme1, lzy0920232, alpha-junh, Sunshine_Youngster, wei_zhuoyi, zhangyihuiben, zyw-hw, zzzkeke, rmch, yangch0324, LucciC, AACAES, renyujin, wjlflyer, senzhen-town, pengjingyou, qsc97, limuan, yule100, xiaoqi-zhou, kuhn7, chenxingying, hanye02, zichun_ye, anyrenwei, kkjocker, wangzili121, Lu_G, yvjc, puddingfjz, HandsoemLemon, bigprestigee1, huawuyi, zhenyu10, dairenjie, du-jin-hang, zou-jieyu, adelaideliu, TrHan, wanlinan, Windwindzzz, pengqihw, kisnwang, yuheng_wang, honghao_wang, jizewei, zhangguoguang, sunyu-xuan, chenrayray, hbhu_bin, liujunzhu, c_34, LiNuoh, maoyuanpeng1, zzhongmin, zhaoyu65, bellatan, jiabaolin, zhuofanshen, wencaiwen, lu_zhuge, caoshuyang, molly12, lyx324521, LQ1206, gitcode-chenjiao, cai-weiwei1989, CHDong, ogqin, yuanlipingGit, xuqinglin1, lqz2, zouwei1, chaoluoa, paradox325, jackzhang1116, yaoyao, akh, yujiacheng, dengjie0116, Hubert11111, Shine_Ws, wslhj555, longqiand, OYtao666, JiaqingQiang, luyyyy, Kingbelial, zhanghaiyu0101, wenxp1018, yanliu-luoluo, ksun_sekiro, liyong328, wgzheng, tangky, vivi_is_coding, aoiaoisola, weixin_44494597, wangmengmengwang65667, hid57809721, qq_35468730, comeonup, C547032, gcw_m5OQChA4, yao_yao_ling_xian, cnnbwcy, szqfes_12, cora_19, cann_lilin, can]评论有效
  • compile、compile_inductor、compile_torchair : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
limuanlimuan成员
6月29日 修改标题为 “fix(test): correct expected buffer size calculation in test_hccl_shared_buffer”,原标题为“Apply test_hccl_shared_buffer.py changes to hccl_shared_ut_v2.12.0”
limuanlimuan成员
6月29日 修改了pull request 的描述
limuan
limuan成员
7月7日 评论:

compile

likedislike
ascend-robotascend-robot成员
7月7日 删除了label:ci-pipeline-passed
ascend-robotascend-robot成员
7月7日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
7月7日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
7月7日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
7月7日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
7月7日 评论:

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

likedislike
ascend-robotascend-robot成员
7月7日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月7日 添加了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
7月7日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
7月7日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
7月7日 评论:
流水线 PR-pipeline_pytorch#41757 [ commitID:b00e6a96 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 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 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, huangjingwei, liangsongwei, yashi999, culechan, Dring, wuyouqi1, L1919_snow, qq_52711437, WhiteNight12, nomiz, xiu_21, ffmh, wanglijun55, hss-shuai, husichao, smallsilly, lanshaozuishuai, jimmyisme1, lzy0920232, alpha-junh, Sunshine_Youngster, wei_zhuoyi, zhangyihuiben, zyw-hw, zzzkeke, rmch, yangch0324, LucciC, AACAES, renyujin, wjlflyer, senzhen-town, pengjingyou, qsc97, limuan, yule100, xiaoqi-zhou, kuhn7, chenxingying, hanye02, zichun_ye, anyrenwei, kkjocker, wangzili121, Lu_G, yvjc, puddingfjz, HandsoemLemon, bigprestigee1, huawuyi, zhenyu10, dairenjie, du-jin-hang, zou-jieyu, adelaideliu, TrHan, wanlinan, Windwindzzz, pengqihw, kisnwang, yuheng_wang, honghao_wang, jizewei, zhangguoguang, sunyu-xuan, chenrayray, hbhu_bin, liujunzhu, c_34, LiNuoh, maoyuanpeng1, zzhongmin, zhaoyu65, bellatan, jiabaolin, zhuofanshen, wencaiwen, lu_zhuge, caoshuyang, molly12, lyx324521, LQ1206, gitcode-chenjiao, cai-weiwei1989, CHDong, ogqin, yuanlipingGit, xuqinglin1, lqz2, zouwei1, chaoluoa, paradox325, jackzhang1116, yaoyao, akh, yujiacheng, dengjie0116, Hubert11111, Shine_Ws, wslhj555, longqiand, OYtao666, JiaqingQiang, luyyyy, Kingbelial, zhanghaiyu0101, wenxp1018, yanliu-luoluo, ksun_sekiro, liyong328, wgzheng, tangky, vivi_is_coding, aoiaoisola, weixin_44494597, wangmengmengwang65667, hid57809721, qq_35468730, comeonup, C547032, gcw_m5OQChA4, yao_yao_ling_xian, cnnbwcy, szqfes_12, cora_19, cann_lilin, can, shawnylee233, fanglanyue0916]评论有效
  • compile、compile_inductor、compile_torchair : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
renyujin成员
7月7日 评论:

/lgtm
/approve

likedislike
ascend-robotascend-robot成员
7月7日 添加了label:approved
senzhen-town成员
7月7日 评论:

/lgtm

likedislike
ascend-robotascend-robot成员
7月7日 添加了label:lgtm
limuanlimuan成员
7月7日 关联了issue:HCCL 通信域创建占用内存,A2,A3存在差异,需分析
ascend-robotascend-robot成员
7月7日 删除了label:needs-issue
ascend-robotascend-robot成员
7月7日 合入了pull request