Pull Request has been successfully merged by CANN-robot.
(Thank you for qzzzy1's contribution.)变更摘要
本 PR 修复 ops-transformer 内置 AICPU 产物在卸载后残留的问题。此前 opp/built-in/op_impl/aicpu/config/aicpu_transformer.json 与 opp/built-in/op_impl/aicpu/kernel/libtransformer_aicpu_kernels.so 无法随包卸载清理;而在打包侧把整个 config/kernel 目录声明为 copy_entity 又会使共享目录被整体处理,可能影响基础 CANN 包同目录文件。因此本次在 scripts/package/ops_transformer/scripts/opp_uninstall.sh 中新增按文件精确删除的卸载逻辑,并把该逻辑挂入 remove_ops_transformer 主流程。
主要改动
- 新增
remove_builtin_aicpu_files函数: 在opp_uninstall.sh中基于TARGET_OPP_BUILT_IN}/op_impl/aicpu路径,用rm -f精确删除config/aicpu_transformer.json与kernel/libtransformer_aicpu_kernels.so这两个 ops-transformer 自身安装的文件。 - 目录按空判定后再删除: 依次检查
config、kernel、aicpu目录,仅当目录存在且ls -A结果为空时才rm -rf,从而避免误删基础 CANN 包共享目录内容。 - 卸载流程接入新函数: 在
remove_ops_transformer中于remove_init_py之后、remove_whl_package之前调用remove_builtin_aicpu_files,使内置 AICPU 产物随卸载一并清理。
🧩 本次 Review 已使用自定义 Skill:


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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| scripts | ✅ wang-minbo, zzzzzzyf_ (2/2) | ✅ wang-minbo (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
qzzzy1, thanks for your pull request. All authors of the commits have signed the CLA. 👍


描述
修复 ops-transformer built-in AICPU 产物卸载残留问题,同时避免影响基础 CANN 包在共享 AICPU 目录下的文件。
AICPU built-in 产物安装路径为:
此前这些文件无法随 ops-transformer 卸载被清理。若将整个
config/kernel目录声明为copy_entity,又会把共享目录作为整体处理,存在影响基础包文件(如aicpu_hccl.tar.gz)权限或内容的风险。本 PR 修改卸载脚本,精确删除 ops-transformer 自己安装的两个文件:
随后仅在目录为空时删除:
因此不会影响同目录下的基础 CANN 包文件。
关联的Issue
7166
测试
构建命令
source /home/anaconda3/etc/profile.d/conda.sh conda activate pec_py310 source /home/qzy/cann/set_env.sh bash build.sh --pkg --soc=ascend910_93 -n mixed_quant_sparse_flash_mla_metadata,block_sparse_attention -j16TC-01 打包
结果:通过。
TC-02 安装
安装前模拟基础包共享文件:
权限设置为
644。安装命令:
结果:通过,
install_exit=0。安装后包含:
TC-03 卸载
命令:
结果:通过,
uninstall_exit=0。日志:
TC-04 卸载后检查
查找:
结果:均不存在,已卸载。
TC-05 共享文件保护
卸载后:
结论:
644750最终目录:
验证结果汇总
aicpu_hccl.tar.gz保留且权限不变文档更新
无
类型标签