[XPU] fix_same_req_id#8040
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8040 +/- ##
==========================================
Coverage ? 67.72%
==========================================
Files ? 471
Lines ? 66361
Branches ? 10217
==========================================
Hits ? 44946
Misses ? 18546
Partials ? 2869
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-11 17:13:21
📋 Review 摘要
PR 概述:在 PD decode 预分配资源时新增重复 request_id 拒绝逻辑,并保留 D 侧返回的错误原因。
变更范围:fastdeploy/engine/common_engine.py、fastdeploy/engine/sched/resource_manager_v1.py
影响面 Tag:[Engine] [Scheduler] [PD Disaggregation]
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🔴 Bug | fastdeploy/engine/sched/resource_manager_v1.py:1596 |
cache-task 模式下重复 request_id 被当作资源不足重试,P/D 会永久等待 |
📝 PR 规范检查
标题 Tag 使用 [XPU],但本次 diff 修改的是 Engine/Scheduler 的 PD decode 资源预分配逻辑,未触及 XPU 专用 worker/model_runner/ops;PR 描述仍是模板占位内容,缺少具体 Motivation/Modifications/Usage/Accuracy Tests 内容。建议替换为以下完整内容。
标题建议(可直接复制):
[PD Disaggregation] Fix duplicate request id handling in decode preallocation
PR 描述建议(点击展开,可直接复制)
## Motivation
修复 P/D 分离场景下 Decode 侧收到重复 request_id 时可能复用或污染已有 KV cache 的问题。
## Modifications
- `fastdeploy/engine/sched/resource_manager_v1.py`: 在 Decode 侧资源预分配时检测 `request_id` 是否已存在于 `self.requests`,重复时设置错误信息并拒绝分配。
- `fastdeploy/engine/common_engine.py`: 在资源预分配失败回传给 Prefill 时保留 Decode 侧已经设置的错误原因,避免统一覆盖为 `Not enough resources`。
## 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.总体评价
修复方向能避免 D 侧同一 request_id 复用已有 block,但当前永久失败和临时资源不足共用 False,会在 cache-task 模式下让重复请求卡住。需要先拆分失败语义,或在已有 error_msg 时回传错误并移除队列。
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 9/10 通过
2 失败详情🔴 Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage — PR问题(置信度: 高)错误类型: PR问题 | 置信度: 高
关键日志:
修复建议:
关联变更: |
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.