[xpu] fix interrupt error#7805
Conversation
|
Thanks for your contribution! |
CI报告基于以下代码生成(30分钟更新一次): 1 任务总览⏳ Required 任务运行中:2 个必选任务仍在执行,请等待完成后再合并。当前已通过 2/4 必选任务。
2 任务状态汇总2.1 Required任务:2/4 通过
2.2 可选任务 — 12/17 通过
3 失败详情(仅 required)无 required 失败任务。 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7805 +/- ##
=========================================
Coverage ? 7.12%
=========================================
Files ? 462
Lines ? 64274
Branches ? 9851
=========================================
Hits ? 4577
Misses ? 59608
Partials ? 89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ae4f8f5 to
ab12fdc
Compare
ab12fdc to
442afa5
Compare
|
/skip-ci ci_iluvatar |
442afa5 to
7de938c
Compare
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-05-15 10:24:44
📋 Review 摘要
PR 概述:XPU ModelRunner 在非 EP 模式下 num_tokens 为 0 时提前退出,修复 interrupt 错误
变更范围:fastdeploy/worker/xpu_model_runner.py
影响面 Tag:[XPU] [BugFix]
📝 PR 规范检查
标题含非标准 [not merge] 前缀且 [xpu] 大小写不规范;PR 描述各 section 未填写实际内容。
标题建议(可直接复制):
[XPU][BugFix] Fix interrupt error when num_tokens is 0
PR 描述建议(可直接复制):
## Motivation
XPU ModelRunner 在非 Expert Parallel 模式下,当 `ids_remove_padding` 的 token 数为 0 时,直接调用 model forward 会触发 interrupt 错误。通过在 `execute_model` 中添加提前退出逻辑,避免以空 batch 执行推理。
## Modifications
- `fastdeploy/worker/xpu_model_runner.py`:在 `execute_model` 的 `padding_cudagraph_inputs()` 调用之后,增加 `num_tokens <= 0` 的 early-return 判断;EP 模式下即使 token 为 0 仍需参与集合通信,故仅在非 EP 模式下触发。
## Usage or Command
N/A
## Accuracy Tests
N/A
## 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.问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 📝 PR 规范 | — | 标题含非标准 [not merge] 前缀、[xpu] 大小写不规范;描述各 section 未填写实际内容 |
| ❓ 疑问 | fastdeploy/worker/xpu_model_runner.py:1304 |
num_tokens <= 0 中 < 0 分支不可达,建议改为 == 0 以提高语义准确性 |
总体评价
修复逻辑正确:非 EP 模式下 token 数为 0 时提前返回,与已有 EP 模式注释保持一致,改动小风险低。请在合入前补充 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.