Skip to content

Conversation

@liyonghua0910
Copy link
Collaborator

@liyonghua0910 liyonghua0910 commented Jan 5, 2026

Motivation

修复 PD 分离时 MTP 启动失败问题,在 PD 分离场景需要由 cache messager 创建 cache,而 gpu model runner 需要等待 cache 创建完成的信号,才能开始读取 cache。

此前的 PR (#5840) 把 mtp 模块的 cache 初始化提前到了主模型 cache 初始化前面,主模型有这个等待逻辑,而 mtp 模型中没有,导致初始化出错。

Modifications

将 cache 的等待逻辑从 gpu_model_runner.py 同步到 mtp.py 文件

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.

@paddle-bot
Copy link

paddle-bot bot commented Jan 5, 2026

Thanks for your contribution!

freeliuzc
freeliuzc previously approved these changes Jan 5, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2026

Codecov Report

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

Files with missing lines Patch % Lines
fastdeploy/spec_decode/mtp.py 46.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5884   +/-   ##
==========================================
  Coverage           ?   66.70%           
==========================================
  Files              ?      347           
  Lines              ?    44421           
  Branches           ?     6820           
==========================================
  Hits               ?    29630           
  Misses             ?    12607           
  Partials           ?     2184           
Flag Coverage Δ
GPU 66.70% <46.15%> (?)

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.

@EmmonsCurse EmmonsCurse merged commit 9fc2400 into PaddlePaddle:develop Jan 6, 2026
15 of 20 checks passed
EmmonsCurse pushed a commit that referenced this pull request Jan 6, 2026
…5884) (#5885)

* [fix] fix mtp cache attaching for pd disaggregation

* [fix] fix port
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