Skip to content

fp8 triton moe config.#8036

Open
xuanyuanminzheng wants to merge 1 commit into
PaddlePaddle:developfrom
xuanyuanminzheng:fp8_triton_moe_config
Open

fp8 triton moe config.#8036
xuanyuanminzheng wants to merge 1 commit into
PaddlePaddle:developfrom
xuanyuanminzheng:fp8_triton_moe_config

Conversation

@xuanyuanminzheng

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.

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...el_executor/layers/moe/fused_moe_triton_backend.py 20.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #8036   +/-   ##
==========================================
  Coverage           ?   67.66%           
==========================================
  Files              ?      470           
  Lines              ?    66115           
  Branches           ?    10189           
==========================================
  Hits               ?    44740           
  Misses             ?    18523           
  Partials           ?     2852           
Flag Coverage Δ
GPU 77.76% <20.00%> (?)
XPU 7.01% <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.

@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-11 00:03:39

📋 Review 摘要

PR 概述:调整 FP8 Triton MoE 在小 token 场景下的 tiling 配置。
变更范围fastdeploy/model_executor/layers/moe/fused_moe_triton_backend.py
影响面 Tag[OP] [Quantization] [Optimization]

问题

未发现阻塞性问题。PR 规范问题在下面章节报,不要在这里重复

📝 PR 规范检查

标题缺少官方 Tag,PR 描述仍是模板占位内容,未填写 Motivation、Modifications、Usage or Command、Accuracy Tests 和 Checklist 状态。建议替换为以下内容。

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

  • [Optimization] Tune FP8 Triton MoE small-token config
PR 描述建议(点击展开,可直接复制)
## Motivation
Tune the Triton MoE FP8 kernel configuration for small-token workloads to use smaller M/N tiles and adjusted pipeline stages.

## Modifications
- In `fastdeploy/model_executor/layers/moe/fused_moe_triton_backend.py`, refine the `Wfp8Afp8MoEMethod.apply` config when `token_num <= E`:
  - `token_num <= 16`: use `BLOCK_SIZE_M=16`, `BLOCK_SIZE_N=64`, `num_stages=4`.
  - `token_num <= 32`: use `BLOCK_SIZE_M=32`, `BLOCK_SIZE_N=64`, `num_stages=3`.
  - `token_num > 32` and `token_num <= E`: keep `BLOCK_SIZE_M=64`, `BLOCK_SIZE_N=128`, and set `num_stages=3`.

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

总体评价

本轮按风险优先审查了 FP8 Triton MoE 小 token 配置分支,以及该配置传入 preprocess 和两次 fused MoE GEMM kernel 的调用关系;未确认到会改变路由、shape、scale 或写回语义的阻塞性问题。建议补齐 PR 标题和描述中的规范信息,尤其是性能/精度验证结果或未提供的原因。

@PaddlePaddle-bot

PaddlePaddle-bot commented Jun 11, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-06-28 00:56:31 UTC+08:00

CI报告基于以下代码生成(30分钟更新一次):
PR commit: c083797 | Merge base: 9431c4f (branch: develop)


1 Required任务 : 9/10 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
41(0) 41 37 4 0 0 0
任务 错误类型 置信度 日志
Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage PR问题:差异覆盖率低于门禁 Job

2 失败详情

🔴 Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage — PR问题(置信度: 中)

分析器: 通用分析(fallback)

失败用例: 无 pytest 失败用例,失败点是覆盖率门禁。

用例 错误摘要
diff-cover --fail-under=80 PR 差异覆盖率未达到 80%,job 以 exit code 9 失败

关键日志:

[FAILURE]: Process completed with exit code 9.
.github/workflows/_unit_test_coverage.yml:254
  diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9
.github/workflows/_unit_test_coverage.yml:390-405
  if [ "$COVERAGE_EXIT_CODE" -eq 9 ]; then ... exit "$COVERAGE_EXIT_CODE"
  • 根因摘要: 新增 MoE 配置分支缺少差异覆盖

PR 仅修改 fastdeploy/model_executor/layers/moe/fused_moe_triton_backend.py,在 token_num <= E 路径下新增了 token_num <= 16token_num <= 32 和其余小 batch 的配置分支。CI 快速日志给出的失败码是 9,而该 workflow 明确把 diff-cover --fail-under=80 失败映射为 9,因此本次失败更符合新增代码差异覆盖率不足,而不是单测断言或环境异常。深度日志未返回 diff_coverage.json 的具体百分比,所以置信度标为中。

修复建议:

  1. 补充覆盖 fastdeploy/model_executor/layers/moe/fused_moe_triton_backend.py:750-776 新增分支的单测,至少覆盖 token_num <= 1617 <= token_num <= 32token_num > 32 且 token_num <= E 三种路径。
  2. 可在现有量化/MoE 测试中 mock tritonmoe_preprocess_func 和 Triton kernel 调用,断言传入的 BLOCK_SIZE_MBLOCK_SIZE_Nnum_stages 符合预期,避免依赖真实 GPU kernel 才能覆盖配置选择逻辑。

关联变更: fastdeploy/model_executor/layers/moe/fused_moe_triton_backend.py:750-776

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.

3 participants