Skip to content

fix_bf16_latent_moe#8006

Merged
Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
chang-wenbin:fix_bf16_latent_moe
Jun 5, 2026
Merged

fix_bf16_latent_moe#8006
Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
chang-wenbin:fix_bf16_latent_moe

Conversation

@chang-wenbin

Copy link
Copy Markdown
Collaborator

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.

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Copy link
Copy Markdown

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-06-04 21:30:43

📋 Review 摘要

PR 概述:为 fused_moe_cutlass_backendapply_ep_prefillapply_ep_decode 方法补全 BF16 Latent MoE 所需的 fc1_latent_proj / fc2_latent_proj 支持。
变更范围fastdeploy/model_executor/layers/moe/fused_moe_cutlass_backend.py
影响面 Tag[OP]

问题

级别 文件 概述
🟡 建议 fused_moe_blackwell_backend.py Blackwell 后端 apply_ep_prefill / apply_ep_decode 签名缺少 fc1_latent_proj / fc2_latent_proj,与 cutlass / deepgemm / triton 后端不同步

多后端同步说明

经检查,fused_moe_deepgemm_backend.pyfused_moe_triton_backend.py 均已实现 fc1_latent_proj/fc2_latent_proj 支持,本 PR 修复了 cutlass 后端(EP prefill/decode 路径)的缺失。但 fused_moe_blackwell_backend.pyapply_ep_prefill(L613)和 apply_ep_decode(L953)方法签名中仍不含这两个参数。若存在使用 Blackwell 后端运行 Latent MoE 的场景,会导致参数传递失效(base class 路由到 blackwell 时签名不匹配)。建议同步补充或明确说明 Blackwell 后端暂不支持该特性。

📝 PR 规范检查

标题 fix_bf16_latent_moe 缺少官方 Tag,且描述中 ## Motivation## Modifications## Usage or Command## Accuracy Tests 各节均未填写内容。

标题建议(可直接复制):

  • [BugFix] Fix missing fc1/fc2_latent_proj support in cutlass MoE EP prefill/decode for BF16 Latent MoE
PR 描述建议(点击展开,可直接复制)
## Motivation
BF16 Latent MoE 场景下,`fused_moe_cutlass_backend``apply_ep_prefill``apply_ep_decode` 方法未处理 `fc1_latent_proj` / `fc2_latent_proj`,导致 Latent MoE 投影层在 cutlass EP 路径下被跳过,输出结果不正确。

## Modifications
- `fastdeploy/model_executor/layers/moe/fused_moe_cutlass_backend.py`:在 `apply_ep_prefill` 的 gate 之后、dispatch 之前插入 `fc1_latent_proj(x)`;在 combine 之后插入 `fc2_latent_proj``apply_ep_decode` 做相同处理。

## 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.
- [x] 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.

总体评价

本 PR 修复逻辑正确,与 deepgemm/triton 后端的处理方式一致。建议补充 Blackwell 后端的同步处理,并完善 PR 标题及描述后合入。

@codecov-commenter

codecov-commenter commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@fa258f5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...l_executor/layers/moe/fused_moe_cutlass_backend.py 20.00% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #8006   +/-   ##
==========================================
  Coverage           ?   66.38%           
==========================================
  Files              ?      468           
  Lines              ?    65934           
  Branches           ?    10171           
==========================================
  Hits               ?    43769           
  Misses             ?    19385           
  Partials           ?     2780           
Flag Coverage Δ
GPU 76.31% <20.00%> (?)
XPU 7.02% <0.00%> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

@Jiang-Jia-Jun
Jiang-Jia-Jun merged commit 7dc49c2 into PaddlePaddle:develop Jun 5, 2026
54 of 60 checks passed
@paddle-bot

paddle-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

Thanks for your contribution!

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.

5 participants