| fix: propagate aclgraph early-start to sub-op compile
Co-authored-by: yrz1027<yangruizhi5@huawei.com>
# message auto-generated for no-merge-commit merge:
!2535 merge fix/aclgraph-force-early-start into master
fix: propagate aclgraph early-start to sub-op compile
Created-by: yrz1027
Commit-by: yrz1027
Merged-by: cann-robot
Description: ## 描述
本次改动调整 aclgraph super kernel early-start 的启用方式,放弃解析 SetNextTaskStart / WaitPreTaskEnd 模板参数 FORCE 的方案,改为由顶层 early-start 选项控制是否为子算子开启 early-start 宏。
主要改动:
- aclgraph 路径新增 early-start=0/1 二值选项解析,默认不启用;early-start=1 时根据子算子源码扫描结果注入 __ASCENDC_SUPERKERNEL_EARLY_START_V3 以及对应的 __ASCENDC_ENABLE_SET_NEXT_TASK_START / __ASCENDC_ENABLE_WAIT_PRE_TASK_END。
- SetNextTaskStart / WaitPreTaskEnd 支持 V3 runtime mask 路径;在未启用宏时仍保留 FORCE=true 的兜底语义。
- dav_3510 的 V3 WaitPreTaskEnd 不再依赖 __ASCENDC_DAVID_SPLIT_CORE__ 编译期宏选择 tight/loose,而是通过 earlyStartConfig 的 bit15 控制:置位走 loose sync,不置位走 tight sync。bit15 由 autofusion host 侧写入。
- V3 mask 注释更新为 low 16 bits 布局,明确 ctrl/aivqueue/aicqueue 的 bit 区间。
- GE/aclgraph 共用源码扫描逻辑,识别带模板参数的 SetNextTaskStart<...>() / WaitPreTaskEnd<...>() 调用,保留历史 >2 命中阈值。
- 同步更新 asc_op_compiler 和 adapter 两套实现及对应 UT,覆盖 aclgraph enable/disable 和 set-only / wait-only 宏注入。
## 关联的Issue
无
## 测试
- git diff --cached --check
- python3 -m py_compile tools/build/asc_op_compile_base/asc_op_compiler/kernel_info_infer.py tools/build/asc_op_compile_base/asc_op_compiler/super_kernel_option_parse.py tools/build/asc_op_compile_base/asc_op_compiler/super_kernel_sub_op_compile.py tools/build/asc_op_compile_base/adapter/kernel_info_infer.py tools/build/asc_op_compile_base/adapter/super_kernel_option_parse.py tools/build/asc_op_compile_base/adapter/super_kernel_sub_op_compile.py
- python3 -m pytest --import-mode=importlib tests/python/asc_op_compiler/test_ascendc_compile_base.py tests/python/adapter/test_ascendc_compile_base.py -k "gen_sub_super_kernel_early_start_compile_options":提升权限后通过,结果 2 passed, 24 deselected, 144 warnings;普通沙箱下因 CANN/TBE 导入时 psutil.net_if_addrs() 权限受限失败。
## 文档更新
无独立文档更新;代码注释中补充了 V3 early-start mask 的 low 16 bits 布局说明。
## 类型标签
<!-- [x] 表示选中 -->
- [x] 🐛 fix: Bug 修复
- [ ] ✨ feat: 新功能
- [ ] ⚡ perf: 性能优化
- [ ] ♻️ refactor: 代码重构
- [x] 🧪 test: 新增或修改测试
- [ ] 📝 docs: 文档更新
- [ ] 🔧 ci: CI/CD 配置修改
- [ ] ↩️ revert: 回退
- [ ] 🧹 chore: 其他,请具体描述
See merge request: cann/asc-devkit!2535 | 7 天前 |