Pull Request has been successfully merged by CANN-robot.
(Thank you for rk's contribution.)变更摘要
本次改动调整了融合算子白名单配置文件 scripts/fusion_config/fusion_pass/config/support_fusion_pass.json,其目的是从各平台的白名单中移除已经完成迁移的融合 pass,避免这些 pass 继续通过白名单加载。改动覆盖 3510、5102、9201、9202 四个平台键,仅删除字符串中以逗号分隔的 pass 名称,没有涉及其他结构,因此白名单中实际生效的可选融合 pass 集合发生了变化。
主要改动
- 移除 LayerNorm 系列融合 pass:
3510、9201、9202的白名单中删除了LayerNormONNXFusionPass、LayerNormONNXMULFusionPass、LayerNormInferenceFusionPass、LayerNormFusionPass,5102则删除了其中的LayerNormONNXFusionPass、LayerNormONNXMULFusionPass。 - 移除 AddLayerNorm 与 AddRmsNorm 相关 pass:四个平台均不再包含
AddLayerNormFusionPass、AddRmsNormFusionGraphPass、InplaceAddRmsNormFusionPass;3510、9201、9202还额外删除了AddRmsNormQuantFusionPass、AddRmsNormDynamicQuantFusionPass、AddLayerNormDynamicQuantFusionPass、QuantizeAddLayerNormPass。 - 移除 Softmax 相关融合 pass:四个平台的白名单中,
ASoftmaxFusionPass都被移除;3510、9201、9202同时移除了ZConfusionSoftmaxGradFusionPass。 - 平台间删除范围存在差异:
3510、9201、9202采用一致的删除集合;5102由于原白名单本身包含较少的 Norm 类 pass,只删除了其中的 LayerNorm、AddLayerNorm、RmsNorm 相关项。其余融合 pass 及其顺序保持不变。


Hi @wangpengbo26, welcome to submitting your first PR to CANN!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


代码审查
审查结论
变更文件逐项确认
scripts/fusion_config/fusion_pass/config/support_fusion_pass.json:已审查(4 行内容全部改动,删除条目逐条比对;JSON 键名3510/5102/9201/9202未改动、无拼写问题,JSON 结构与结尾逗号合法)——发现 1 个问题(白名单与fusion_config.json注册表不一致)。
发现列表
| 优先级 | 置信度 | 文件:行 | 摘要 |
|---|---|---|---|
| P2 | 0.42 | support_fusion_pass.json:2-5 | 白名单删除的 7 个 Norm 类融合 pass(LayerNormInference/NNX/LayerNorm/AddLayerNorm/AddLayerNormDynamicQuant/AddRmsNormFusionGraph/AddRmsNormDynamicQuant)仍保留在 fusion_config.json 的优先号表中,形成单边删除的注册契约缺口:若迁移未真正完成,这些融合在 3510/5102/9201/9202 上会静默失效;若已完成,则对应优先号成为死配置。 |
总体风险判断
本次为纯配置数据变更,JSON 本身合法、键名无误;主要风险不在语法而在两份配套配置(support_fusion_pass.json 与 fusion_config.json)的一致性——只要确认这 7 个 pass 的实现确已从 legacy 插件迁出,本改动即可安全合入;否则存在四平台融合能力静默降级的回归风险。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


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 |
|---|---|---|
| repo-cann/opbase | ✅ 汤平川, 张磊 (2/2) | ✅ 张磊, 汤平川 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wangpengbo26, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🟡 Medium Priority
改动行:scripts/fusion_config/fusion_pass/config/support_fusion_pass.json 第 2~5 行(3510/5102/9201/9202 四个平台)从各平台支持列表中删除了 LayerNormONNXFusionPass、LayerNormONNXMULFusionPass、LayerNormInferenceFusionPass、LayerNormFusionPass、ZConfusionSoftmaxGradFusionPass、AddLayerNormFusionPass、AddRmsNormFusionGraphPass、AddRmsNormQuantFusionPass、InplaceAddRmsNormFusionPass、AddRmsNormDynamicQuantFusionPass、AddLayerNormDynamicQuantFusionPass、QuantizeAddLayerNormPass、ASoftmaxFusionPass。
关联契约(未改动但同目录的同套注册配置 scripts/fusion_config/fusion_pass/config/fusion_config.json):其中仍有 7 个被删白名单条目保留着优先号——LayerNormInferenceFusionPass=4173(第135行)、LayerNormONNXFusionPass=4336(第182行)、LayerNormFusionPass=4337(第183行)、AddLayerNormFusionPass=4338(第184行)、AddLayerNormDynamicQuantFusionPass=4340(第186行)、AddRmsNormFusionGraphPass=4341(第187行)、AddRmsNormDynamicQuantFusionPass=4342(第188行);而真正的“已迁移”pass(LayerNormONNXMULFusionPass、ZConfusionSoftmaxGradFusionPass、AddRmsNormQuantFusionPass、InplaceAddRmsNormFusionPass、QuantizeAddLayerNormPass、ASoftmaxFusionPass)在 fusion_config.json 中已完全查不到。两个配置文件按同一份 pass 注册契约维护,本次只单边删了 support_fusion_pass.json 一侧,形成新的一致性缺口。
失败模式:support_fusion_pass.json 是随 OpsLegacyFusionPass 插件一起安装到 lib64/plugin/opskernel/fusion_pass/config 的“平台支持列表”(见 scripts/package/module/ascend/OpsLegacyFusionPass.xml:12-13),未列入当前 SoC 版本的 pass 不会在该平台装载;因此上述 7 个仍在 fusion_config.json 中被赋予运行优先号的 pass 在 3510/5102/9201/9202 上将不再生效。若这些 pass 的实现尚未真正从 legacy 插件迁出(fusion_config.json 中优先号仍保留即是该风险信号),LayerNorm/AddRmsNorm 融合在这四个平台上会静默失效,模型会退化为不融合执行,属性能/行为回归;反之若确实已迁移,则 fusion_config.json 中这 7 条优先号成为指向不再注册 pass 的死配置,后续排障时无法区分“白名单屏蔽”与“实现已删除”。
建议:核对 LayerNormInferenceFusionPass、LayerNormONNXFusionPass、LayerNormFusionPass、AddLayerNormFusionPass、AddLayerNormDynamicQuantFusionPass、AddRmsNormFusionGraphPass、AddRmsNormDynamicQuantFusionPass 这 7 个 pass 是否已完成实现迁移:已迁移则本 PR 同时删除 fusion_config.json 中对应优先号条目;未迁移则暂时保留其在 3510/5102/9201/9202 白名单中的条目,避免白名单与 fusion_config.json 注册表不一致导致融合静默失效。


compile


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


/lgtm
/approve


/lgtm
/approve


描述
从融合规则白名单
support_fusion_pass.json中移除已迁移的 norm 和 softmax 系列融合规则,使其不再在本仓库生效。3510条目移除 13 条:norm 系列 11 条(LayerNorm 4 条、AddLayerNorm 系列 3 条、AddRmsNorm 系列 4 条)+ softmax 系列 2 条(ASoftmaxFusionPass / ZConfusionSoftmaxGradFusionPass);5102条目移除 6 条(该条目中原有的 norm/softmax 规则);3510一致)。norm 系列融合规则已迁移至 ops-nn 仓库维护,本仓库白名单移除对应条目,避免新旧两处同时注册生效。
关联的Issue
-https://gitcode.com/cann/opbase/issues/569
测试
配置变更,白名单过滤后对应融合规则不再生效,由 ops-nn 仓库侧规则接管。
文档更新
不涉及
类型标签