Skip to content

[Feature] Support mtp overlap schedule#6785

Open
Sunny-bot1 wants to merge 3 commits intoPaddlePaddle:developfrom
Sunny-bot1:mtp_unify_overlap
Open

[Feature] Support mtp overlap schedule#6785
Sunny-bot1 wants to merge 3 commits intoPaddlePaddle:developfrom
Sunny-bot1:mtp_unify_overlap

Conversation

@Sunny-bot1
Copy link
Collaborator

@Sunny-bot1 Sunny-bot1 commented Mar 11, 2026

Motivation

支持MTP场景下开启overlap schedule

Modifications

位置 算子 DtoH操作 解决方法
gpu_model_runner.py 前处理 unified_update_model_status not_need_stop 废弃
mtp.py 前处理 draft_model_preprocess not_need_stop 废弃
  eagle_get_hidden_states output_token_num_cpu pre_alloc (WIP)
  _propose_cuda(token_num_cpu) self.model_inputs["seq_lens_this_time"].numpy().sum().item() 异步拷贝,复用上一轮的token_num_cpu(seq_lens_this_time.sum)
mtp.py 后处理 draft_model_update not_need_stop 废弃
gpu_model_runner.py 后处理 speculate_schedule_cache not_need_stop 废弃
  save_output accept_tokens_cpu, accept_num_cpu, seq_lens_decoder_cpu, prompt_lens_cpu 异步拷贝,延迟传输
worker_process.py tp_barrier all_reduce 开启overlap schedule后自动使用CPU barrier
cudagraph_piecewise_backend.py call(num_running_requests) num_running_requests = int((seq_lens_this_time.flatten() > 0).sum().item()) 异步拷贝,复用上一轮的num_running_requests((seq_lens_this_time>0).sum)

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 Mar 11, 2026

Thanks for your contribution!

@Sunny-bot1 Sunny-bot1 changed the title [Speculative Decoding] Support mtp overlap schedule [Feature] Support mtp overlap schedule Mar 11, 2026
@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2026

Codecov Report

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

Files with missing lines Patch % Lines
fastdeploy/worker/input_batch.py 47.82% 12 Missing ⚠️
fastdeploy/model_executor/pre_and_post_process.py 54.54% 4 Missing and 1 partial ⚠️
.../graph_optimization/cudagraph_piecewise_backend.py 40.00% 2 Missing and 1 partial ⚠️
fastdeploy/spec_decode/mtp.py 91.89% 2 Missing and 1 partial ⚠️
fastdeploy/worker/gpu_model_runner.py 93.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6785   +/-   ##
==========================================
  Coverage           ?   72.28%           
==========================================
  Files              ?      395           
  Lines              ?    54772           
  Branches           ?     8617           
==========================================
  Hits               ?    39591           
  Misses             ?    12355           
  Partials           ?     2826           
Flag Coverage Δ
GPU 72.28% <77.06%> (?)

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