Skip to content

Conversation

@rainyfly
Copy link
Collaborator

@rainyfly rainyfly commented Jan 19, 2026

Motivation

优化 zmq -> scheduler -> worker 的调度逻辑。
之前scheduler 和 worker 是完全异步分开进行的,schedule()会在引擎forward开始前发生并立即结束,容易造成每次调度的请求量不满,从而让请求易发生排队。
实际上,在整个引擎 forward 期间,都是可以预处理请求并且接收请求放在scheduler的队列里累积,在引擎 forward 结束后再进行schedule(),此时才能达到最佳组batch的效果。

Modifications

  1. 引擎 forward结束再 schedule()
  2. forward期间持续接收请求并做预处理,放到 scheduler的队列中等待 schedule()。

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.

@paddle-bot
Copy link

paddle-bot bot commented Jan 19, 2026

Thanks for your contribution!

Jiang-Jia-Jun pushed a commit that referenced this pull request Jan 21, 2026
* optimize ttft

* fix

* fix

* fix

* fix

* fix mix

* fix ci
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 54.90196% with 23 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@7d6c87c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/worker/worker_process.py 55.55% 9 Missing and 7 partials ⚠️
fastdeploy/engine/common_engine.py 25.00% 6 Missing ⚠️
fastdeploy/scheduler/dp_scheduler.py 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6098   +/-   ##
==========================================
  Coverage           ?   66.68%           
==========================================
  Files              ?      385           
  Lines              ?    51256           
  Branches           ?     7995           
==========================================
  Hits               ?    34180           
  Misses             ?    14590           
  Partials           ?     2486           
Flag Coverage Δ
GPU 66.68% <54.90%> (?)

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.

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.

2 participants