Pull Request has been successfully merged by CANN-robot.
(Thank you for LordOfMysteries's contribution.)变更摘要
本 PR 将 master 上已合入的三项 host ctrl-flow / stitch 热路径优化合并到 9.2.0 分支,目标是降低控制流录制与 stitch 录制阶段的无效开销。核心改动包括:将 host 侧 DEV_VERBOSE_* 日志宏与 device 侧对齐、统一由 DEV_IF_VERBOSE_LOG 在编译期裁剪;把 topo_dump::DumpEnabled() 提升为公共门控接口(device 侧恒为 false),用于按 runtime_debug_mode == VERIFY 决定是否执行 CheckStitch、stitch 边校验与 topo dump;以及让 CreateHostCtrlFlowCache 不再对整个 cache 区做一次性清零,只清元数据前缀,payload 改由 AllocateCache 按块清零。
主要改动
- host 日志宏编译期裁剪:
device_log.h中的DEV_VERBOSE_DEBUG_SPLIT、DEV_VERBOSE_DEBUG、DEV_VERBOSE_INFO改为包裹在DEV_IF_VERBOSE_LOG的do { ... } while (0)中,使ENABLE_COMPILE_VERBOSE_LOG=0时日志代码被编译剔除,避免 CF 录制时的假热。 - 新增对外 dump 门控接口: 在
dump_device_topo.h中声明bool DumpEnabled(),实现从匿名命名空间中移出,host 侧按CFG_RUNTIME_DBEUG_MODE == CFG_RUNTIME_DEBUG_VERIFY缓存结果,__DEVICE__分支返回false。 - stitch 热路径按 VERIFY 模式门控:
device_stitch_context.cpp与device_slot_context.cpp中,CheckStitch、ValidateAndDumpStitchEdge在非 dump 模式下直接return,DumpProducerCellAccess/DumpConsumerCellAccess调用改为由unlikely(topo_dump::DumpEnabled())前置判断。 - ctrl-flow cache 构建去除整块清零:
EmulationLauncher::CreateHostCtrlFlowCache由AllocZero改为AllocDev,仅用memset_s清除从结构体起始位置到cacheData的headerBytes元数据前缀,容量上限部分的 payload 不再预清零。 - 由
AllocateCache按块补零:DevControlFlowCache::AllocateCache在返回前用memset_s清零本次reserved(含CFGCACHE_ALIGN对齐填充)区间,保证调用方留下的空洞为 0;并新增 UT 验证被污染的 slab 与对齐填充均被清零。


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 |
|---|---|---|
| 9.2.0 | ✅ jason_yuan_ye, Andy-lb (2/2) | ✅ Andy-lb (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
LordOfMysteries, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/approve


/lgtm


The following label is not ready.
ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


Summary
将 master 上已落地的三笔 host ctrl-flow / stitch 热路径优化合入
9.2.0:fix(machine): Compile out host DEV_VERBOSE_ when ENABLE_COMPILE_VERBOSE_LOG=0host 侧
DEV_VERBOSE_*与 device 对齐,用DEV_IF_VERBOSE_LOG编译期剔除,避免 CF 录制时假热。CreateHostCtrlFlowCache不再整页 memset ~100MB;只清元数据前缀,payload 在AllocateCache按块清零。默认跳过
CheckStitch/ topo dump;仅runtime_debug_mode=VERIFY时开启。对外门控直接使用topo_dump::DumpEnabled()。Test plan