已合并
【FEAT】预检工具新增 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 校验提示 #4988
刘家旺创建于 3月10日
【FEAT】预检工具新增 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 校验提示 #4988
已合并
刘家旺创建于 3月10日
刘家旺
刘家旺成员
3月10日

关联 issue:https://gitcode.com/Ascend/msit/issues/394

当 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 为 TRUE,且 pagesize 为 4096 时,提示用户配置了没有用
自验证:
image.png

当 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 为 TRUE,且 pagesize 为 65536 时,告警用户配置了会 OOM
image.png

当 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 不为 TRUE,且 pagesize 为 65536 时,提示用户换一个 pagesize
image.png

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 刘家旺 的贡献)
刘家旺刘家旺成员
3月10日 创建了 pull request,commit 93274551
刘家旺刘家旺成员
3月10日 关联了issue:[Feature]: msprechecker 工具增加对环境变量HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT的预检
ascend-robotascend-robot成员
3月10日 添加了label:stat/needs-squash
ascend-robot
ascend-robot成员
3月10日 评论:

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
repo-Ascend/msit ✅ jhon-117, minghang_c (2/2) ✅ jhon-117 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
ascend-robotascend-robot成员
3月10日 添加了label:ascend-cla/yes
刘家旺刘家旺成员
3月10日 修改标题为 “【FEAT】 add page size validation and operator support”,原标题为“fix(mindie): add system page size validation for HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT variable”
ascend-robot
ascend-robot成员3月10日进行代码检视1
msprechecker/msprechecker/cmate/custom_fn.py
@@ -54,1 +54,4 @@
54+ 
55+def get_conf_pagesize():
56+ return os.sysconf('SC_PAGESIZE')
ascend-robot
ascend-robot3月10日评论:
注释与文档: 新增的 `get_conf_pagesize` 函数缺少文档字符串(docstring)。同一文件中的其他函数(如 `path_exists`, `is_port_in_use`)虽然也没有文档字符串,但这是一个改进代码可维护性和可读性的机会。缺少文档字符串使得其他开发者难以理解该函数的目的、返回值含义以及可能抛出的异常。
问题类型: 注释与文档
文件路径: msprechecker/msprechecker/cmate/custom_fn.py
行号: 56
问题代码:
def get_conf_pagesize():
    return os.sysconf('SC_PAGESIZE')
修改建议:
为 `get_conf_pagesize` 函数添加文档字符串,说明其功能、返回值和可能的异常。例如:

def get_conf_pagesize():
"""
获取系统内存页面大小(以字节为单位)。

Returns:
    int: 系统配置的页面大小。如果获取失败,返回一个默认值(如4096)。
"""
try:
    return os.sysconf('SC_PAGESIZE')
except (OSError, ValueError):
    return 4096</pre><div style='margin-top: 4px; font-size: 9px; color: #999;'>---<br>此评论由代码审查工具自动生成</div></div>
likedislike
刘家旺刘家旺成员
3月10日 修改标题为 “【FEAT】预检工具新增 HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT 校验提示”,原标题为“【FEAT】 add page size validation and operator support”
ascend-robot
ascend-robot成员
3月10日 评论:

问题/功能描述

本次PR主要包含两项功能增强。首先,为CMATE表达式引擎增加了对逻辑“非”运算符(not)的支持,解决了现有引擎无法处理逻辑否定运算的问题。其次,新增了系统内存页大小获取能力,并基于此在MindIE配置检查规则中,新增了对HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT环境变量与系统页大小组合的配置校验,旨在避免在特定页大小(4KB/64KB)下因配置不当导致的性能劣化或内存碎片化引发OOM的风险。

修改方案描述

修改方案分为两部分。一是在表达式求值器的运算符映射表中新增逻辑“非”运算符(not)的处理逻辑,并新增get_conf_pagesize自定义函数以通过os.sysconf获取系统内存页大小。二是在配置检查规则文件中,利用获取的页大小,新增了三条断言规则,用于在校验时根据页大小(4KB或64KB)对HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT环境变量的配置给出提示、报错或建议,从而引导用户进行正确配置。

likedislike
刘家旺
刘家旺成员
3月10日 评论:

compile

likedislike
ascend-robotascend-robot成员
3月10日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
3月10日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
3月10日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
3月10日 评论:
流水线 PR-pipeline_msit#2708 已完成
阶段 任务名 状态 详情
恶意代码检查 Antipoison_msit ✅ >>>
编码安全与规范检查 CodeCheck_msit ✅ >>>
开源片段检查 SCA_msit ✅ >>>
开发者测试 UT_msit ✅ >>>
流水线 PR-pipeline_msit ✅ >>>
likedislike
刘家旺刘家旺成员
3月10日 预合并成功(commit_id: 2f7273b85123dba562ad2ec4ae6dcdda1b591ce4)
刘家旺刘家旺成员
3月10日 强制推送  1 个提交:0dd93a03-feat(mindie): add system page size validation for HCCL_RDMA_PCIE_DIRECT_POST_NOSTRICT variable
刘家旺
刘家旺成员
3月10日 评论:

compile

likedislike
刘家旺刘家旺成员
3月10日 预合并成功(commit_id: 3e04bd80e74fe2555d9e8d526b46504f8ddb5eba)
ascend-robotascend-robot成员
3月10日 删除了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
3月10日 评论:

Notification

This pull request source branch has changed, so removes the following label(s): ci-pipeline-passed.

likedislike
ascend-robot
ascend-robot成员
3月10日 评论:

CLA Signature Pass

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

likedislike
ascend-robotascend-robot成员
3月10日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
3月10日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
3月10日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
3月10日 评论:
流水线 PR-pipeline_msit#2709 已完成
阶段 任务名 状态 详情
恶意代码检查 Antipoison_msit ✅ >>>
编码安全与规范检查 CodeCheck_msit ✅ >>>
开源片段检查 SCA_msit ✅ >>>
开发者测试 UT_msit ✅ >>>
流水线 PR-pipeline_msit ✅ >>>
likedislike
Masaka
Masaka成员
3月10日 评论:

/lgtm

likedislike
kai1949
kai1949成员
3月10日 评论:

/approve

likedislike
ascend-robotascend-robot成员
3月10日 添加了label:approvedlgtm
ascend-robot
ascend-robot成员
3月10日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: jhon-117.
Reviewers who wrote a comment of /lgtm are: jhon-117, minghang_c.

likedislike
ascend-robotascend-robot成员
3月10日 合入了pull request,合并节点 SHA:278cec230febb97562923eaf000b6545e2e9f72e