Skip to content

Conversation

@juncaipeng
Copy link
Collaborator

@juncaipeng juncaipeng commented Nov 20, 2025

Motivation

将优化PD分离模块的部分代码,从PR(https://github.com/PaddlePaddle/FastDeploy/pull/5027/files)进行拆分。

Modifications

  • resourcemanager 中 pd 请求的处理接口
  • splitwiseconnector 中 pd信息的处理接口
  • launch 的参数
  • examples示例

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 November 20, 2025 13:00
@paddle-bot
Copy link

paddle-bot bot commented Nov 20, 2025

Thanks for your contribution!

Copilot finished reviewing on behalf of juncaipeng November 20, 2025 13:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the splitwise deployment feature as part of PD (Paddle) disaggregation work. The changes split a larger PR (#5027) and optimize interfaces for PD-related modules.

主要改动:

  • 重构 splitwise_connector.py 中的缓存信息发送逻辑,将 send_cache_infos 拆分为 send_cache_info_to_messagersend_cache_info_to_prefill 两个职责更清晰的方法
  • 优化 resource_manager_v1.py 中的资源管理接口,重命名 prerelease_resourcepre_recycle_resource,新增 has_resource_for_prefilled_reqadd_prefilled_request 方法
  • 标准化 router 模块的参数处理,引入 RouterArgs 数据类和 FlexibleArgumentParser

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
fastdeploy/splitwise/splitwise_connector.py 重构缓存信息发送逻辑,将单一方法拆分为两个职责明确的方法,分别处理发送到 messager 和 prefill 的场景
fastdeploy/engine/sched/resource_manager_v1.py 重命名资源回收方法,新增预填充请求的资源检查和添加方法,优化 P/D 分离部署的资源管理
fastdeploy/router/router.py 引入 RouterArgs 数据类标准化路由参数,重命名 start_router 为 launch_router
fastdeploy/router/launch.py 简化启动脚本,使用 RouterArgs 和 FlexibleArgumentParser 替代手动参数解析
fastdeploy/router/init.py 导出 RouterArgs 和 launch_router 供外部使用
fastdeploy/engine/engine.py 添加属性存在性检查,避免在退出时访问不存在的属性
fastdeploy/engine/common_engine.py 更新方法调用以适配 splitwise_connector 的重构,优化预填充请求的处理逻辑
examples/splitwise/utils.sh 新增通用工具函数:端口检查和健康检查
examples/splitwise/stop.sh 简化停止脚本,统一使用 pkill 命令
examples/splitwise/start_v1_tp1.sh 移除重复的 wait_for_health 函数,改用 utils.sh,添加端口冲突检查
examples/splitwise/start_v0_tp1.sh 同上,提升脚本复用性和健壮性
examples/splitwise/start_mixed.sh 同上,保持示例脚本的一致性
examples/splitwise/start_v1_tp2.sh 删除文件,可能合并到其他示例中
examples/splitwise/start_v0_tp2.sh 删除文件,可能合并到其他示例中
examples/splitwise/README.md 新增示例文档,说明环境准备、构建安装和运行方式

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit f9b0545 into PaddlePaddle:develop Nov 21, 2025
23 of 26 checks passed
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.

3 participants