已合并
[Bugfix][build] Skip TIK ops when msopgen TBE template is missing #641
yjy_ac创建于 20 天前
[Bugfix][build] Skip TIK ops when msopgen TBE template is missing #641
已合并
yjy_ac创建于 20 天前
yjy_ac
yjy_ac成员
20 天前

Which issue(s) this PR fixes or accomplishes

Fixes #365

关联 Issue:https://gitcode.com/Ascend/MindIE-SD/issues/365

Purpose

部分 CANN toolkit 不再交付 TBE/TIK 工程骨架 tools/op_project_templates/op_project_tmpl,msopgen gen(默认 -lan py)在生成 flash_attention_tik 空工程时失败并退出 101,导致 build/build_ops.sh 在 AscendC 已经编完之后整次失败。

本 PR 在 build/build_tik_ops.sh 中、CMake 版本检查之后、调用 msopgen 之前探测该目录:不存在则 WARNING 并 return 0,AscendC 后续流程继续;目录存在时行为与原来一致。探测路径与 build_ops.sh 使用的 local_toolkit 对齐。tools/op_project_templates/ascendc/ 与 tools/ascend_project 不是该模板的替代。

模块 文件 说明
构建 build/build_tik_ops.sh 缺 op_project_tmpl 时跳过 TIK 构建

Test Plan

  1. 确认模板目录
    • ls "${ASCEND_HOME_PATH}/tools/op_project_templates/"
    • 缺模板环境应无 op_project_tmpl;可编 TIK 的环境应有该目录。
  2. 缺模板时全量 ops 构建
    • python setup.py bdist_wheel 或 bash build/build_ops.sh "$(pwd)/build"
    • 期望:打印 Skipping build_tik_ops 的 WARNING,AscendC 构建完成,不再出现 Get template file path failed / 退出码 101。
  3. 有模板时回归(可选)
    • 在仍包含 op_project_tmpl 的 toolkit 上走同一构建路径,期望仍生成并安装 TIK 算子。

Test Report

在支持TIK模板的CANN上构建能编译出tik算子
image.png

在不支持的CANN上构建则绕过,并编译通过
image.png

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 yjy_ac 的贡献)
yjy_acyjy_ac成员
20 天前 创建了 pull request,commit 5e3d220a
yjy_acyjy_ac成员
20 天前 关联了issue:[Installation]: CANN 缺少 TBE 工程模板时全量 ops 编译失败
atomgit-bot
atomgit-bot
20 天前 评论:

变更摘要

本 PR 修复构建缺陷:部分 CANN toolkit 不再交付 TBE/TIK 工程骨架 tools/op_project_templates/op_project_tmpl,导致 msopgen gen(默认 -lan py)生成 flash_attention_tik 空工程时失败并退出 101,进而使 build/build_ops.sh 在 AscendC 已编完后整次失败。改动在 build/build_tik_ops.sh 的 build_tik_ops() 函数中、CMake 版本检查之后、调用 msopgen 之前新增模板目录探测:目录不存在时打印 WARNING 并 return 0 跳过 TIK 构建,使 AscendC 后续流程继续;目录存在时行为与原来一致。探测路径与 build_ops.sh 使用的 local_toolkit 对齐。

主要改动

  • 新增模板目录探测变量:定义 tik_proj_tmpl="${local_toolkit}/tools/op_project_templates/op_project_tmpl",探测路径与 build_ops.sh 使用的 local_toolkit 保持一致,并注明 ascendc/ 与 tools/ascend_project 不能替代该 TBE 骨架。
  • 缺模板时跳过 TIK 构建:通过 if [ ! -d "${tik_proj_tmpl}" ] 判断目录不存在时打印 WARNING: TIK/TBE project template not found 及跳过说明,随后 return 0,避免 msopgen gen 因找不到模板失败退出 101 导致整次构建失败。
  • 保持原有构建路径不变:探测逻辑插入在 CMake 版本检查之后、msopgen 调用(create_empty_custom_project 等)之前,目录存在时继续执行原有 TIK 算子生成与安装流程,不改变既有行为。
likedislike
不准确?
yjy_acyjy_ac成员
20 天前 关联了看板:MindIE-SD
atomgit-bot
atomgit-bot
20 天前 评论:

🤖 本次改动均为数据 / 生成 / 二进制文件(如测试用例、锁文件、媒体资源),没有可审查的代码逻辑,已跳过 AI 代码审查。

likedislike
不准确?
xiangjie10成员
20 天前 评论:
🔍 PR 规范审计未通过,以下项目需要修正:
  • ⚠️ PR 代码变更未包含测试用例(变更文件路径中均不包含 test 或 ut),请确认已经备注原因!

请修正后重新提交,或联系仓库管理员。

likedislike
ascend-robotascend-robot成员
20 天前 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
20 天前 评论:

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.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-Ascend/MindIE-SD ✅ weixin_44144262, changetheway (2/2) ✅ weixin_44144262 (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成员
20 天前 评论:

CLA Signature Pass

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

likedislike
AtlasAccountAtlasAccount成员
20 天前 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
20 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
20 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
20 天前 评论:

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

likedislike
ascend-robotascend-robot成员
20 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
20 天前 添加了label:docs-ci-pipeline-success
yjy_acyjy_ac成员
20 天前 修改了pull request 的描述
AtlasAccountAtlasAccount成员
20 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
20 天前 添加了label:ci-pipeline-passed
AtlasAccount
AtlasAccount成员
20 天前 评论:
流水线 PR-pipeline_MindIE-SD_gitcode#2048 [ commitID:d6b74c33 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_linux_x86_abi1 ✅ COMPLETED >>>
Build_linux_arm_abi1 ✅ COMPLETED >>>
Build_linux_arm_abi0 ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_linux_arm ✅ COMPLETED >>>
流水线 PR-pipeline_MindIE-SD_gitcode ✅ COMPLETED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
changetheway成员
20 天前 评论:

/lgtm

likedislike
lijinxi
lijinxi成员
19 天前 评论:

/lgtm

likedislike
ascend-robotascend-robot成员
19 天前 添加了label:lgtm
lijinxi
lijinxi成员
19 天前 评论:

/approve

likedislike
ascend-robotascend-robot成员
19 天前 添加了label:approved
blian
blian成员
19 天前 评论:

/merge

likedislike
ascend-robotascend-robot成员
19 天前 添加了label:keeper_approved
ascend-robotascend-robot成员
19 天前 关闭了关联的issue
ascend-robotascend-robot成员
19 天前 合入了pull request