Skip to content

[BugFix] Fix preemption out of real_bsz - #5805

Merged
Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
rainyfly:fix_bug_for_preemption_out_of_real_bsz
Dec 29, 2025
Merged

Jiang-Jia-Jun merged 1 commit into
PaddlePaddle:developfrom
rainyfly:fix_bug_for_preemption_out_of_real_bsz

Conversation

@rainyfly

@rainyfly rainyfly commented Dec 28, 2025

Copy link
Copy Markdown
Collaborator

Motivation

判断当前请求槽位的索引大于 real_bsz 时,应该是>,而不是>=。

Modifications

None

Usage or Command

None

Accuracy Tests

None

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 28, 2025 02:10
@paddle-bot

paddle-bot Bot commented Dec 28, 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修复了一个抢占调度逻辑中的边界条件判断错误。当判断请求槽位索引是否超出实际批次大小时,将比较运算符从 >= 修正为 >,避免了最后一个有效槽位(索引为 batch_size - 1)的请求被错误地重调度。

  • 修正了 _reschedule_preempt_task 方法中的索引越界判断逻辑
  • 将条件从 idx >= (batch_size - 1) 改为 idx > (batch_size - 1)

Comment thread fastdeploy/output/token_processor.py
Comment thread fastdeploy/output/token_processor.py
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@c3ccfa9). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5805   +/-   ##
==========================================
  Coverage           ?   65.51%           
==========================================
  Files              ?      337           
  Lines              ?    43082           
  Branches           ?     6639           
==========================================
  Hits               ?    28226           
  Misses             ?    12754           
  Partials           ?     2102           
Flag Coverage Δ
GPU 65.51% <100.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 91a2b13 into PaddlePaddle:develop Dec 29, 2025
23 of 26 checks passed
chang-wenbin pushed a commit to chang-wenbin/FastDeploy that referenced this pull request Mar 2, 2026
xiaoguoguo626807 pushed a commit to xiaoguoguo626807/FastDeploy that referenced this pull request May 7, 2026
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.

4 participants