Skip to content

[Cherry-Pick][Optimization]support fused noauxtc kernel on ep mode(#7936)#7917

Merged
qingqing01 merged 2 commits into
PaddlePaddle:release/2.6from
ShaneGZhu:cp26
May 28, 2026
Merged

[Cherry-Pick][Optimization]support fused noauxtc kernel on ep mode(#7936)#7917
qingqing01 merged 2 commits into
PaddlePaddle:release/2.6from
ShaneGZhu:cp26

Conversation

@ShaneGZhu
Copy link
Copy Markdown
Contributor

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

Modifications

Usage or Command

Accuracy Tests

Checklist

  • 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.
  • 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.

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 25, 2026

Thanks for your contribution!

PaddlePaddle-bot

This comment was marked as outdated.

@PaddlePaddle-bot
Copy link
Copy Markdown

PaddlePaddle-bot commented May 25, 2026

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-05-26 22:34:57

CI报告基于以下代码生成(30分钟更新一次):


1 任务总览

当前代码相关 required 测试已通过,但仍有 1 个 required Approval 未完成,需人工审批后才能合并。另有 3 个 optional 任务失败,不阻塞合并,仅供参考。

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
36(0) 36 32 4 0 0 0

2 任务状态汇总

日志列说明:失败任务直接使用日志链接,运行中任务使用 Job 链接。

2.1 Required任务 : 9/10 通过

必选任务阻塞合并,失败需优先处理。

状态 任务 耗时 根因 修复建议 日志 重跑
Approval 18s 需要 Approval 请通过人工审批 Job -
其余 9 个必选任务通过 - - - - -

2.2 可选任务 — 23/26 通过

可选任务不阻塞合并,失败仅供参考。

状态 任务 耗时 日志 重跑
Run iluvatar Tests / run_iluvatar_cases 2m43s Job -
Check PR Template 20s Job -
CI_HPU 1h55m Job -
其余 23 个可选任务通过 - - -

3 失败详情(仅 required)

Approval — 需要人工审批(置信度: 高)

根因摘要

该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。

修复建议摘要

请通过人工审批。

补充说明

PR 变更文件为 fastdeploy/model_executor/layers/moe/ep.pytests/model_executor/test_ep.py;主测试任务 Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage 已通过(1h12m)。当前唯一 required 失败不是代码测试失败,而是审批门禁未完成。

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/2.6@3ffeb44). Learn more about missing BASE report.

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           
Flag Coverage Δ
GPU 72.43% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ShaneGZhu ShaneGZhu changed the title [Optimize]support fused noauxtc kernel on ep mode [Optimization]support fused noauxtc kernel on ep mode May 26, 2026
Copy link
Copy Markdown

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.pytests/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)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 测试仅覆盖 enable_moe_scores_elementwise_fuse=False 的路径,use_fused=Truegrouped_topk 的 fused kernel 路径无测试覆盖。

建议增加一个 enable_moe_scores_elementwise_fuse=True 的测试用例,验证 fused 路径与原始路径的路由结果(topk_idxtopk_weights)在数值上保持一致,以防回归。

Copy link
Copy Markdown
Collaborator

@K11OntheBoat K11OntheBoat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneGZhu ShaneGZhu changed the title [Optimization]support fused noauxtc kernel on ep mode [Cherry-Pick][Optimization]support fused noauxtc kernel on ep mode(#7936) May 27, 2026
Copy link
Copy Markdown
Collaborator

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qingqing01 qingqing01 merged commit 2b0fd53 into PaddlePaddle:release/2.6 May 28, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants