[Cherry-Pick][Optimization]support fused noauxtc kernel on ep mode(#7936)#7917
Conversation
|
Thanks for your contribution! |
CI报告基于以下代码生成(30分钟更新一次): 1 任务总览当前代码相关 required 测试已通过,但仍有 1 个 required
2 任务状态汇总日志列说明:失败任务直接使用日志链接,运行中任务使用 Job 链接。 2.1 Required任务 : 9/10 通过
2.2 可选任务 — 23/26 通过
3 失败详情(仅 required)Approval — 需要人工审批(置信度: 高)根因摘要该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。 修复建议摘要请通过人工审批。 补充说明PR 变更文件为 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/2.6 #7917 +/- ##
==============================================
Coverage ? 72.43%
==============================================
Files ? 382
Lines ? 54462
Branches ? 8522
==============================================
Hits ? 39450
Misses ? 12242
Partials ? 2770
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-05-26 17:42:04
📋 Review 摘要
PR 概述:在 EP 模式的 noaux_tc 分支中支持 fused noauxtc kernel(融合 sigmoid + bias + topk 的 grouped_topk kernel),通过 enable_moe_scores_elementwise_fuse 配置项控制是否启用。
变更范围:fastdeploy/model_executor/layers/moe/ep.py、tests/model_executor/test_ep.py
影响面 Tag:[Optimization] [OP]
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🟡 建议 | tests/model_executor/test_ep.py:422 |
测试仅覆盖 enable_moe_scores_elementwise_fuse=False 路径,fused kernel(use_fused=True)路径无测试覆盖 |
| 📝 PR 规范 | — | 标题缺少 [Cherry-Pick] 前缀;描述模板各 section 为空 |
📝 PR 规范检查
PR 目标分支为 release/2.6,按规范标题应使用 Cherry-Pick 格式,且描述模板中 Motivation / Modifications / Usage or Command / Accuracy Tests 各 section 均为空或仅占位符。
标题建议(可直接复制):
[Cherry-Pick][Optimization] support fused noauxtc kernel on ep mode(#<原 develop PR 号>)
PR 描述建议(可直接复制,必须复刻 checklist §D2 模板的完整结构):
## Motivation
在 EP 模式的 `noaux_tc` MoE 路由分支中,原始路径需要独立执行 sigmoid、bias 加法和 topk 选择三步。本 PR 引入融合 kernel(`grouped_topk`),在 CUDA 平台上通过 `enable_moe_scores_elementwise_fuse` 配置开关,将上述三步合并为一次 kernel 调用,以降低显存带宽压力并提升 EP 推理吞吐。
## Modifications
- `fastdeploy/model_executor/layers/moe/ep.py`:在 `moe_select` 的 `noaux_tc` 分支中,根据 `scheduler_config.enable_moe_scores_elementwise_fuse` 和 `current_platform.is_cuda()` 计算 `use_fused` 标志,并透传 `use_fused_cast` 参数给 `get_moe_scores`。
- `tests/model_executor/test_ep.py`:为 fake layer 补充 `fd_config` 属性(`enable_moe_scores_elementwise_fuse=False`),确保现有测试兼容新字段访问。
## Usage or Command
N/A
## Accuracy Tests
N/A
## Checklist
- [x] Add at least a tag in the PR title.
- Tag list: [`[FDConfig]`,`[APIServer]`,`[Engine]`, `[Scheduler]`, `[PD Disaggregation]`, `[Executor]`, `[Graph Optimization]`, `[Speculative Decoding]`, `[RL]`, `[Models]`, `[Quantization]`, `[Loader]`, `[OP]`, `[KVCache]`, `[DataProcessor]`, `[BugFix]`, `[Docs]`, `[CI]`, `[Optimization]`, `[Feature]`, `[Benchmark]`, `[Others]`, `[XPU]`, `[HPU]`, `[GCU]`, `[DCU]`, `[Iluvatar]`, `[Metax]`]
- You can add new tags based on the PR content, but the semantics must be clear.
- [ ] Format your code, run `pre-commit` before commit.
- [ ] Add unit tests. Please write the reason in this PR if no unit tests.
- [ ] Provide accuracy results.
- [x] If the current PR is submitting to the `release` branch, make sure the PR has been submitted to the `develop` branch, then cherry-pick it to the `release` branch with the `[Cherry-Pick]` PR tag.总体评价
代码改动简洁,逻辑清晰,use_fused_cast 参数透传正确,平台检查(current_platform.is_cuda())与配置开关的双重保护合理。建议补充 fused 路径的单测覆盖,并按规范完善 PR 标题和描述。
| routed_scaling_factor=1.0, | ||
| gate_correction_bias=None, | ||
| renormalize=False, | ||
| fd_config=SimpleNamespace(scheduler_config=SimpleNamespace(enable_moe_scores_elementwise_fuse=False)), |
There was a problem hiding this comment.
🟡 建议 测试仅覆盖 enable_moe_scores_elementwise_fuse=False 的路径,use_fused=True 走 grouped_topk 的 fused kernel 路径无测试覆盖。
建议增加一个 enable_moe_scores_elementwise_fuse=True 的测试用例,验证 fused 路径与原始路径的路由结果(topk_idx、topk_weights)在数值上保持一致,以防回归。
Motivation
Modifications
Usage or Command
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.