Skip to content

[XPU] add profile#8057

Merged
Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
zhupengyang:profiling
Jun 17, 2026
Merged

[XPU] add profile#8057
Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
zhupengyang:profiling

Conversation

@zhupengyang

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

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
fastdeploy/worker/xpu_model_runner.py 0.00% 68 Missing ⚠️
...odel_executor/layers/backends/xpu/moe/fused_moe.py 0.00% 12 Missing ⚠️
fastdeploy/worker/xpu_worker.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #8057   +/-   ##
==========================================
  Coverage           ?   67.42%           
==========================================
  Files              ?      475           
  Lines              ?    66746           
  Branches           ?    10299           
==========================================
  Hits               ?    45005           
  Misses             ?    18869           
  Partials           ?     2872           
Flag Coverage Δ
GPU 77.48% <ø> (?)
XPU 6.97% <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-16 17:21:41

📋 Review 摘要

PR 概述:为 XPU 增加 prefill-only / decode-only profiling 入口,并在 XPU MoE 中支持随机 gate 输出做专家均衡 profiling。
变更范围fastdeploy/envs.py、XPU MoE backend、XPU model runner / worker。
影响面 TagXPU OP FDConfig

问题

级别 文件 概述
🟡 建议 fastdeploy/model_executor/layers/backends/xpu/moe/fused_moe.py:318 profiling balance 路径在 MoE 前向中先计算真实 gate,再从 NumPy 构造随机张量,profiling 结果会混入额外 CPU 随机数与拷贝成本
🟡 建议 fastdeploy/worker/xpu_model_runner.py:1512 profile 环境变量校验使用 assert,Python 优化模式下会被跳过,非法配置会继续写入输入和 block 表

历史 Findings 修复情况

Finding 问题 状态
F1 FD_XPU_PROFILE_PREFILL=1 使用默认参数会直接失败。 ✅ 已修复
F2 profile 路径手写的 KV block id 没有校验实际 cache 容量。 ⚠️ 仍存在

📝 PR 规范检查

标题符合 [XPU] 官方 Tag 要求。PR 描述保留了模板结构,但 MotivationModificationsUsage or CommandAccuracy Tests 内容为空或仅模板占位,需要补全为可审查内容。

总体评价

本轮按风险优先审查了新增 XPU profile 执行路径和 MoE gate 变更。未发现需要阻塞合入的确定性问题,但 profiling 结果可信度和运行时校验方式建议在合入前修正。

Comment thread fastdeploy/model_executor/layers/backends/xpu/moe/fused_moe.py
Comment thread fastdeploy/worker/xpu_model_runner.py

@hong19860320 hong19860320 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Jiang-Jia-Jun
Jiang-Jia-Jun merged commit 4c74d33 into PaddlePaddle:develop Jun 17, 2026
38 of 43 checks passed
@zhupengyang
zhupengyang deleted the profiling branch June 17, 2026 05:46
@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.

7 participants