Skip to content

[BugFix] fix init RequestOutput - #5419

Merged
Jiang-Jia-Jun merged 4 commits into
PaddlePaddle:developfrom
juncaipeng:fix_1208
Dec 9, 2025
Merged

Jiang-Jia-Jun merged 4 commits into
PaddlePaddle:developfrom
juncaipeng:fix_1208

Conversation

@juncaipeng

@juncaipeng juncaipeng commented Dec 8, 2025

Copy link
Copy Markdown
Collaborator

Motivation

修复PD 分离下构造RequestOutput错误

Modifications

RequestOutput.from_dict

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.

Copilot AI review requested due to automatic review settings December 8, 2025 03:57
@paddle-bot

paddle-bot Bot commented Dec 8, 2025

Copy link
Copy Markdown

Thanks for your contribution!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

此 PR 修复了在 PD(Prefill-Decode)分离场景下构造 RequestOutput 对象时的错误,同时添加了解码资源分配的时间指标记录。

主要变更:

  • 修改 RequestOutput.from_dict 方法以安全处理可能缺失或为 None 的 outputsmetrics 字段
  • 修正了 insert_tasks 中解码资源分配成功时的处理逻辑
  • 添加了解码资源请求的开始和完成时间的指标记录

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
fastdeploy/engine/request.py 添加了对 outputsmetrics 字段的条件检查,避免在字段缺失时反序列化失败
fastdeploy/engine/common_engine.py 修正了解码资源分配成功时的逻辑分支,添加了 ask_decode_resource_start_timeask_decode_resource_finish_time 指标

关于 PR 描述的建议

  • PR 标题格式正确:使用了 [BugFix] 标签
  • 描述中的"修复PD 分离下构造RequestOutput错误"较为简洁,建议补充更详细的背景信息,例如:
    • 什么场景下会出现此问题?
    • 错误的具体表现是什么?
    • 如何复现该问题?
  • 建议说明为何需要添加这两个时间指标(ask_decode_resource_start_timeask_decode_resource_finish_time

Comment thread fastdeploy/engine/request.py Outdated
Comment thread fastdeploy/engine/request.py
Comment thread fastdeploy/engine/request.py Outdated
Comment thread fastdeploy/engine/request.py Outdated
Comment thread fastdeploy/engine/request.py Outdated
@codecov-commenter

codecov-commenter commented Dec 8, 2025

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
fastdeploy/engine/request.py 0.00% 8 Missing ⚠️
fastdeploy/engine/common_engine.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5419   +/-   ##
==========================================
  Coverage           ?   58.69%           
==========================================
  Files              ?      327           
  Lines              ?    40653           
  Branches           ?     6173           
==========================================
  Hits               ?    23860           
  Misses             ?    14950           
  Partials           ?     1843           
Flag Coverage Δ
GPU 58.69% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@Jiang-Jia-Jun
Jiang-Jia-Jun merged commit a8ffc22 into PaddlePaddle:develop Dec 9, 2025
14 of 17 checks passed
chang-wenbin pushed a commit to chang-wenbin/FastDeploy that referenced this pull request Mar 2, 2026
* fix init RequestOutput

* up

* fix

* fix
xiaoguoguo626807 pushed a commit to xiaoguoguo626807/FastDeploy that referenced this pull request May 7, 2026
* fix init RequestOutput

* up

* fix

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants