Merged
fix(dsl): 清理框架 UT 并隔离 UT 的 DSL 产物构建 #15464
zyh_gitcodeAdd on 3 days ago
fix(dsl): 清理框架 UT 并隔离 UT 的 DSL 产物构建 #15464
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for zyh_gitcode's contribution.)3 days ago Created pull request, commit 580488c2
atomgit-bot
3 days ago Comments:
3 days ago Comments:
变更摘要
本次变更将 DSL 框架的单元测试从“需要真实编译工具链的集成验证”收敛为纯逻辑回归:删除了在临时目录中重建 CMake 工程、伪造 Native/ACLNN runtime、调用编译器/链接器/nm/readelf 以及构建 wheel 的测试与辅助代码,仅保留针对发布缓存、回滚、资源归属和包结构校验的断言。三份测试文件均只涉及测试代码与导入的精简,未触及算子实现、CMake 脚本、CI 或发布 helper。
主要改动
- 简化 ACLNN 包校验 fixture:
test_cannbotdsl_aclnn.py中的publish_aclnn去掉了mode参数与全部 C++ 源码内容,改为按l0/l2开关只写入占位文件与package.jsonmanifest 所需路径,使包校验不再依赖可编译的 runtime。 - 删除 ACLNN 编译/链接/安装类测试:移除
aclnn_project工程生成器、publish_native以及test_aclnn_build_link_and_install、test_dual_host_caches_are_independent_and_aclnn_runs_without_python、test_reconfigure_removes_only_unselected_host_path、test_separate_declaration_publishes_public_api_with_existing_asc_inner_registration、test_l2_declaration_changes_do_not_republish_native_or_device,并清理ctypes、shutil、subprocess、Path等导入;保留发布层级、缓存与source_exports标记识别相关用例。 - 移除 CMake 执行辅助与可选依赖构建测试:
test_cannbotdsl_build.py删除cmake、build_install辅助函数及test_input_dependencies_preserve_cmake_paths,并移除_optional_dsl_project构建夹具与test_real_unavailable_probe_still_builds_and_installs_asc、test_real_unavailable_probe_cleans_owned_stale_resources_and_keeps_asc、test_discoverable_modules_do_not_hide_real_dsl_build_errors;保留原子替换回滚与sync_kernels归属保护用例。 - 删除 wheel 打包回归测试:
test_cannbotdsl_package.py移除了基于setup.py bdist_wheel的test_wheel_includes_recursive_dsl_sources_with_working_relative_imports,同时删除os、shutil、subprocess、zipfile导入,仅保留 custom Torch 包内相对导入的test_custom_builder_loads_without_base_package。
🧩 本次 Review 已使用自定义 Skill:


Incorrect?
3 days ago Added label: cann-cla/yes
CANN-robot
3 days ago Comments:
3 days ago Comments:
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 |
|---|---|---|
| cmake | ✅ 蒋礼锐, 刘丹 (2/2) | ✅ 蒋礼锐, 刘丹 (2/1) |
| tests | ✅ 蒋礼锐, 刘丹 (2/2) | ✅ 刘丹, 蒋礼锐 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
sky-zyh, thanks for your pull request. All authors of the commits have signed the CLA. 👍


3 days ago Set monologue815,jiang-lirui,Allan_Yu,wang-minbo,xtqh,liudan12,gaoxiang618,mabing1118,zzzzzzyf_ as approver
3 days ago Set monologue815,jiang-lirui,Allan_Yu,wang-minbo,xtqh,liudan12,gaoxiang618,mabing1118,zzzzzzyf_ as approver
43 messages are collapsed here。 See more
2 days ago Added label: approved
jiang-lirui
2 days ago Comments:
2 days ago Comments:
/approve
/lgtm


2 days ago Added label: lgtm
2 days ago Merged pull request
普通 UT 在 CMake 配置阶段会进入 DSL 产物发布;当 UT 环境的 OpKit 接口与工程不匹配时,测试用例执行前即因 opkit.build(mode=...) 失败。本 PR 将真实 DSL 编译与普通 UT 配置隔离,并删除原有模拟工程的框架 UT。
最终范围只有三份测试删除和公共 CMake 新增 4 行;未改算子实现、接口或 CI 镜像。
验证:本分支五种 UT 开关的定向 CMake 检查通过,正常模式仍执行 DSL 可用性检查;git diff --check 通过。另在 PR #15347 的 MQSMLA 源码上验证同一修复,使用匹配的 dev 0.8.2、全量 1008 个真实 DSL 特化完成设备编译,并经工程增量 --pkg 生成含设备二进制的 RUN 包、完成解包核对;该记录不等同于本 PR 的远端 CI 结果。未执行 NPU 数值或性能测试。