已合并
[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
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 rich 的贡献)atomgit-bot
7月23日 评论:
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参数,与新的函数签名保持一致。


不准确?
atomgit-bot
7月23日 评论:
7月23日 评论:
7月23日 添加了label:smoke-pipeline-running
7月23日 添加了label:ascend-cla/yes
ascend-robot
7月23日 评论:
7月23日 评论:
ascend-robot
7月23日 评论:
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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


rich
7月23日 评论:
7月23日 评论:
compile


7月23日 添加了label:ci-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
ascend docs pipeline is running...


7月23日 添加了label:docs-ci-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
ascend docs pipeline is running...


ascend-robot
7月23日 评论:
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:列表前后应该换行 [错误内容]: >- 用户需要对进程工作目录具有读、写和执行权限。 |


7月23日 删除了label:docs-ci-pipeline-running
7月23日 添加了label:docs-ci-pipeline-failed
ascend-robot
7月23日 评论:
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:列表前后应该换行 [错误内容]: >- 用户需要对进程工作目录具有读、写和执行权限。 |


7月23日 预合并成功(commit_id: 5c72180512f8af17ac8de28252935a9d6837caf7)
7月23日 预合并成功(commit_id: 149b1c0609ec61a3872c61c5de59c549ba46605d)
7月23日 删除了label:ci-pipeline-running
7月23日 删除了label:smoke-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
流水线 PR-pipeline_torchair_smoke#303 [ commitID:b23bcb1a ] 已终止运行
⚠️ 流水线执行结果已过期,当前 PR 最新 commit 为 64b2672b,请重新运行流水线
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_x86 | 🟨 | >>> |
| Build_ARM | ✅ | >>> | |
| 开发者测试 | smoke | 🟨 | >>> |
| 流水线 | PR-pipeline_torchair_smoke | 🟨 | >>> |
- smoke : 运行流水线


ascend-robot
7月23日 评论:
7月23日 评论:
流水线 PR-pipeline_torchair#3487 [ commitID:b23bcb1a ] 已终止运行
⚠️ 流水线执行结果已过期,当前 PR 最新 commit 为 64b2672b,请重新运行流水线
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_x86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| CodeCheck_pre-commit | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 流水线 | PR-pipeline_torchair | 🟨 | >>> |
- compile : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


ascend-robot
7月23日 评论:
7月23日 评论:
ascend docs pipeline is running...


7月23日 删除了label:docs-ci-pipeline-failed
7月23日 添加了label:docs-ci-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
7月23日 删除了label:docs-ci-pipeline-running
7月23日 添加了label:docs-ci-pipeline-success
rich
7月23日 评论:
7月23日 评论:
compile


7月23日 添加了label:ci-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
ascend-robot
7月23日 评论:
7月23日 评论:
ascend docs pipeline is running...


7月23日 删除了label:docs-ci-pipeline-success
7月23日 添加了label:docs-ci-pipeline-running
ascend-robot
7月23日 评论:
7月23日 评论:
7月23日 删除了label:docs-ci-pipeline-running
7月23日 添加了label:docs-ci-pipeline-success
7月23日 删除了label:ci-pipeline-running
7月23日 添加了label:ci-pipeline-passed
ascend-robot
7月23日 评论:
7月23日 评论:
流水线 PR-pipeline_torchair#3488 [ commitID:64b2672b ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_x86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| CodeCheck_pre-commit | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 流水线 | PR-pipeline_torchair | ✅ | >>> |
- compile : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


lyz0328
7月23日 评论:
7月23日 评论:
/lgtm


dingdairong
7月23日 评论:
7月23日 评论:
/lgtm


fu_hao
7月23日 评论:
7月23日 评论:
/approve


7月23日 添加了label:approvedlgtm
7月23日 合入了pull request
[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包等)本次修改在资料中加以明确。