[XPU] add profile#8057
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #8057 +/- ##
==========================================
Coverage ? 67.42%
==========================================
Files ? 475
Lines ? 66746
Branches ? 10299
==========================================
Hits ? 45005
Misses ? 18869
Partials ? 2872
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 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。
影响面 Tag:XPU 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 描述保留了模板结构,但 Motivation、Modifications、Usage or Command、Accuracy Tests 内容为空或仅模板占位,需要补全为可审查内容。
总体评价
本轮按风险优先审查了新增 XPU profile 执行路径和 MoE gate 变更。未发现需要阻塞合入的确定性问题,但 profiling 结果可信度和运行时校验方式建议在合入前修正。
|
Thanks for your contribution! |
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.