已合并
[Fix] static kernel install path decoupled from static_kernel_compile_outputs #3439
rich创建于 7月23日
[Fix] static kernel install path decoupled from static_kernel_compile_outputs #3439
已合并
rich创建于 7月23日
rich
rich成员
7月23日

[Fix] static kernel install path decoupled from static_kernel_compile_outputs

1.静态kernel算子安装和产物路径解耦,避免cache_compile失效场景清理产物时删除已安装的静态kernel算子。
2._owns_install_path 之前使用bool值表示当前rank是否需要管理安装路径,修改为pid,表示管理安装路径的进程。规避子进程继承父进程变量值退出时清理的风险。
3.使用静态编译时需要对进程执行路径拥有完整权限,(生成static_kernel_compile_outputs目录和执行生成的run包等)本次修改在资料中加以明确。

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 rich 的贡献)
richrich成员
7月23日 创建了 pull request,commit b4091a40
atomgit-bot
atomgit-bot
7月23日 评论:

变更摘要

该 PR 主要将静态 kernel 算子的安装路径与编译产物路径解耦,避免因缓存失效清理产物时误删已安装的静态 kernel。同时将 _owns_install_path 从布尔类型改为进程 PID,以规避子进程继承父进程变量值后退出时错误触发清理的风险。

主要改动

  • 安装路径与编译产物路径解耦:_get_or_create_install_path 不再基于 result_root 参数构建路径,改为使用当前工作目录下的固定 static_kernel_install 目录,避免 cache_compile 清理产物时波及已安装的静态 kernel 算子。
  • _owns_install_path 改为 PID 机制:将 _owns_install_path 的默认值从 False 改为 None,赋值从 True 改为 os.getpid();在 uninstall_static_kernel 中通过 _owns_install_path == os.getpid() 精确判断当前进程是否为安装路径的管理者,防止子进程继承父进程值后误清理。
  • 安装路径创建增加异常处理:在 _get_or_create_install_path 中为 mkdir 操作添加 try/except OSError,失败时抛出明确的 RuntimeError,提升错误可诊断性。
  • 调用侧同步适配:_install_run_packages 中调用 _get_or_create_install_path() 时移除 result_root 参数,与新的函数签名保持一致。
likedislike
不准确?
atomgit-bot
atomgit-bot
7月23日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
ascend-robotascend-robot成员
7月23日 添加了label:smoke-pipeline-running
ascend-robotascend-robot成员
7月23日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
7月23日 评论:

CLA Signature Pass

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

likedislike
ascend-robot
ascend-robot成员
7月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
docs ✅ fu-hao-huawei, dingdairong, lyz0328 (3/2) ✅ fu-hao-huawei (1/1)
repo-Ascend/torchair ✅ dingdairong, fu-hao-huawei (2/2) ✅ fu-hao-huawei (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
rich
rich成员
7月23日 评论:

compile

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

ascend docs pipeline is running...

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

ascend docs pipeline is running...

likedislike
ascend-robot
ascend-robot成员
7月23日 评论:

❌ 文档门禁未通过!

检查项 检查结果 详情
markdownlint ❌ 未通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情

💡 本次检查出 1 项错误,详情内容如下:

序号 错误详情
1 [文件路径]:docs/zh/npugraph_ex/basic/static_kernel_compile.md
[检查类型]:markdownlint
[错误位置]:第 69 行
[错误信息]:MD032:列表前后应该换行
[错误内容]:>- 用户需要对进程工作目录具有读、写和执行权限。
likedislike
ascend-robotascend-robot成员
7月23日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月23日 添加了label:docs-ci-pipeline-failed
ascend-robot
ascend-robot成员
7月23日 评论:

❌ 文档门禁未通过!

检查项 检查结果 详情
markdownlint ❌ 未通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情

💡 本次检查出 1 项错误,详情内容如下:

序号 错误详情
1 [文件路径]:docs/zh/npugraph_ex/basic/static_kernel_compile.md
[检查类型]:markdownlint
[错误位置]:第 69 行
[错误信息]:MD032:列表前后应该换行
[错误内容]:>- 用户需要对进程工作目录具有读、写和执行权限。
likedislike
richrich成员
7月23日 预合并成功(commit_id: 5c72180512f8af17ac8de28252935a9d6837caf7)
richrich成员
7月23日 强制推送  1 个提交:64b2672b-[Fix] static kernel install path decoupled from static_kernel_compile_outputs
richrich成员
7月23日 预合并成功(commit_id: 149b1c0609ec61a3872c61c5de59c549ba46605d)
ascend-robotascend-robot成员
7月23日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
7月23日 删除了label:smoke-pipeline-running
ascend-robot
ascend-robot成员
7月23日 评论:
流水线 PR-pipeline_torchair_smoke#303 [ commitID:b23bcb1a ] 已终止运行
⚠️ 流水线执行结果已过期,当前 PR 最新 commit 为 64b2672b,请重新运行流水线
阶段 任务名 状态 详情
编译构建 Build_x86 🟨 >>>
Build_ARM ✅ >>>
开发者测试 smoke 🟨 >>>
流水线 PR-pipeline_torchair_smoke 🟨 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • smoke : 运行流水线
likedislike
ascend-robot
ascend-robot成员
7月23日 评论:
流水线 PR-pipeline_torchair#3487 [ commitID:b23bcb1a ] 已终止运行
⚠️ 流水线执行结果已过期,当前 PR 最新 commit 为 64b2672b,请重新运行流水线
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_x86 ✅ >>>
Build_ARM ✅ >>>
恶意代码检查 Antipoison ✅ >>>
编码安全与规范检查 CodeCheck ✅ >>>
CodeCheck_pre-commit ✅ >>>
开源片段检查 SCA ✅ >>>
流水线 PR-pipeline_torchair 🟨 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
ascend-robot
ascend-robot成员
7月23日 评论:

ascend docs pipeline is running...

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

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
7月23日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月23日 添加了label:docs-ci-pipeline-success
rich
rich成员
7月23日 评论:

compile

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

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robot
ascend-robot成员
7月23日 评论:

ascend docs pipeline is running...

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

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
7月23日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月23日 添加了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
7月23日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
7月23日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
7月23日 评论:
流水线 PR-pipeline_torchair#3488 [ commitID:64b2672b ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_x86 ✅ >>>
Build_ARM ✅ >>>
恶意代码检查 Antipoison ✅ >>>
编码安全与规范检查 CodeCheck ✅ >>>
CodeCheck_pre-commit ✅ >>>
开源片段检查 SCA ✅ >>>
流水线 PR-pipeline_torchair ✅ >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
lyz0328
lyz0328成员
7月23日 评论:

/lgtm

likedislike
dingdairong成员
7月23日 评论:

/lgtm

likedislike
fu_hao
fu_hao成员
7月23日 评论:

/approve

likedislike
ascend-robotascend-robot成员
7月23日 添加了label:approvedlgtm
ascend-robotascend-robot成员
7月23日 合入了pull request