Skip to content

feat: support PDFusion ratio scheduler with DP#1179

Open
HoniiTro19 wants to merge 1 commit into
alibaba:mainfrom
HoniiTro19:feature/pdfusion-ratio-scheduler-dp
Open

feat: support PDFusion ratio scheduler with DP#1179
HoniiTro19 wants to merge 1 commit into
alibaba:mainfrom
HoniiTro19:feature/pdfusion-ratio-scheduler-dp

Conversation

@HoniiTro19

Copy link
Copy Markdown
Collaborator

Background

PDFusion Ratio Scheduler previously enforced dp_size <= 1, preventing ratio scheduling from being used with Data Parallelism.

The existing DP execution path already uses fake streams to align prefill and decode execution across DP ranks, so this restriction can now be removed.

Changes

  • Remove the dp_size <= 1 restriction from PDFusion Ratio Scheduler.
  • Add a Qwen3.5 MTP/Eagle DP2 smoke test covering:
    • TP2 + DP2
    • PDFusion ratio scheduling
  • Register the existing MTP CP2 smoke case in the H20 OSS suite.

@HoniiTro19 HoniiTro19 requested a review from LLLLKKKK as a code owner July 13, 2026 02:08
@LLLLKKKK

Copy link
Copy Markdown
Collaborator

AI Code Review - PR #1179

Status: BLOCKING

Summary: P0/0 · P1/1 · P2/0 · P3/0

Blocking Issues

P1

  • 新增 CP2 smoke target 引用了不存在的测试数据 @ rtp_llm/test/smoke/suites_h20_oss.bzl:279
    • 建议:补齐与 CP2 参数匹配的 JSON golden 并纳入该 target;如果 CP2 不属于本次改动,则移除该 target。随后确认 next_mtp_cp2 的 Bazel target 可分析,并实际执行 H20 smoke suite。

Checklist Violations (3 fail / 72 total)

General Principles Checklist

  • [6.1] Tests — 新逻辑有聚焦单测 + 相关集成/smoke 测试 → issue 新增 CP2 smoke target 引用了不存在的测试数据
    next_mtp_cp2q_r_next_fp8_tp2_mtp_cp2.json 同时作为 Bazel data--task_info,但该文件在 PR head 及父提交中均不存在。h20_oss_suites() 又被 smoke BUILD 无条件调用,且 maga_model_smoke 包含 smoke_h20_next,因此分析或执行该 suite 时会在模型启动前因缺失输入失败,也使本次新增的 DP smoke 无法形成有效 CI 覆盖。

RTP-LLM Checklist

  • [H] 测试与 CI — BUILD、py_test、cc_test、genrule 变更必须验证 srcs/data/runfiles/testdata 相对路径、import path 和 target 可执行性;genrule glob 不得捕获无关构建产物 → issue 新增 CP2 smoke target 引用了不存在的测试数据
    next_mtp_cp2q_r_next_fp8_tp2_mtp_cp2.json 同时作为 Bazel data--task_info,但该文件在 PR head 及父提交中均不存在。h20_oss_suites() 又被 smoke BUILD 无条件调用,且 maga_model_smoke 包含 smoke_h20_next,因此分析或执行该 suite 时会在模型启动前因缺失输入失败,也使本次新增的 DP smoke 无法形成有效 CI 覆盖。
  • [H] 测试与 CI — 新增、迁移或删除测试必须证明目标行为仍在 CI 中执行;DISABLED_、#if 0、open_skip、导入即失败、未被 target 引用的用例不得计为覆盖 → issue 新增 CP2 smoke target 引用了不存在的测试数据
    next_mtp_cp2q_r_next_fp8_tp2_mtp_cp2.json 同时作为 Bazel data--task_info,但该文件在 PR head 及父提交中均不存在。h20_oss_suites() 又被 smoke BUILD 无条件调用,且 maga_model_smoke 包含 smoke_h20_next,因此分析或执行该 suite 时会在模型启动前因缺失输入失败,也使本次新增的 DP smoke 无法形成有效 CI 覆盖。

Strengths

  • next_mtp_pdfusion_ratio_dp2 明确配置 tp_size=2dp_size=2、ratio 调度和 DeepEP,并提供独立 golden,覆盖方向与生产变更一致。
  • 核心代码仅移除已有 DP 保护,继续复用现有调度器和 fake stream 机制,变更范围较小。

@HoniiTro19 HoniiTro19 force-pushed the feature/pdfusion-ratio-scheduler-dp branch from f969e99 to 57a2b5f Compare July 14, 2026 01:45
@LLLLKKKK

Copy link
Copy Markdown
Collaborator

AI Code Review - PR #1179

Status: BLOCKING

Summary: P0/0 · P1/1 · P2/0 · P3/0

Blocking Issues

P1

  • 顺序 smoke 未覆盖 DP ratio 调度的关键竞争路径 @ rtp_llm/test/smoke/suites_h20_oss.bzl:271
    • 建议:增加可控并发 smoke 或集成测试,使至少两个长请求重叠并落到不同 DP rank,明确覆盖 active decode 与 waiting prefill 并存、各 rank 处于不同真实阶段的场景,同时校验无死锁且输出与 golden 一致。

Checklist Violations (3 fail / 72 total)

General Principles Checklist

  • [6.1] Tests — 分布式/跨平台变更有对应覆盖 → issue 顺序 smoke 未覆盖 DP ratio 调度的关键竞争路径
    新增 case 未设置 concurrency_test=True,三个 query_result 会被依次发送。当前请求结束前不会出现新的 waiting prefill,因此 chooseRound() 的 ratio 竞争分支不会执行,也未覆盖两个 DP rank 分别处理真实 prefill/decode 的组合。全局删除 DP 保护后,即使该组合发生 collective 不一致、死锁或结果错误,当前 smoke 仍可能通过。
  • [6.1] Tests — 新逻辑有聚焦单测 + 相关集成/smoke 测试 → issue 顺序 smoke 未覆盖 DP ratio 调度的关键竞争路径
    新增 case 未设置 concurrency_test=True,三个 query_result 会被依次发送。当前请求结束前不会出现新的 waiting prefill,因此 chooseRound() 的 ratio 竞争分支不会执行,也未覆盖两个 DP rank 分别处理真实 prefill/decode 的组合。全局删除 DP 保护后,即使该组合发生 collective 不一致、死锁或结果错误,当前 smoke 仍可能通过。

RTP-LLM Checklist

  • [H] 测试与 CI — 新增、迁移或删除测试必须证明目标行为仍在 CI 中执行;DISABLED_、#if 0、open_skip、导入即失败、未被 target 引用的用例不得计为覆盖 → issue 顺序 smoke 未覆盖 DP ratio 调度的关键竞争路径
    新增 case 未设置 concurrency_test=True,三个 query_result 会被依次发送。当前请求结束前不会出现新的 waiting prefill,因此 chooseRound() 的 ratio 竞争分支不会执行,也未覆盖两个 DP rank 分别处理真实 prefill/decode 的组合。全局删除 DP 保护后,即使该组合发生 collective 不一致、死锁或结果错误,当前 smoke 仍可能通过。

Strengths

  • 代码改动集中在显式启用的 ratio 模式,默认 FIFO 调度路径保持不变。
  • 新增 golden 已接入 H20 聚合 smoke suite,并覆盖 TP2、DP2、MTP 与 DeepEP 的组合启动及输出校验。

@HoniiTro19 HoniiTro19 force-pushed the feature/pdfusion-ratio-scheduler-dp branch from 57a2b5f to 82e5703 Compare July 14, 2026 08:44
@LLLLKKKK

Copy link
Copy Markdown
Collaborator

AI Code Review - PR #1179

Status: LGTM

Summary: P0/0 · P1/0 · P2/0 · P3/0

lgtm ready to ci

Checklist ✅ (72 items passed)

Strengths

  • 新增 smoke 使用真实四卡分布式边界和并发请求,能够覆盖 PDFusion ratio、DP、MTP 与 DeepEP 的组合路径。
  • golden 与既有 MTP 用例保持一致,仅调整 ratio 调度导致的 iter_count,变更范围清晰。
  • 新用例已注册到 smoke_h20_next,并由顶层完整 smoke suite 引用。

@HoniiTro19 HoniiTro19 force-pushed the feature/pdfusion-ratio-scheduler-dp branch from 82e5703 to e1c9cfd Compare July 15, 2026 03:35
@LLLLKKKK

Copy link
Copy Markdown
Collaborator

AI Code Review - PR #1179

Status: LGTM

Summary: P0/0 · P1/0 · P2/0 · P3/0

lgtm ready to ci

Checklist ✅ (72 items passed)

Strengths

  • FIFOSchedulerBase 已为 DP 场景启用定时调度,NormalEngine 也会为空闲 rank 补充 fake stream,现有机制能够支撑本次限制解除。
  • smoke 使用 dp_size=2world_size=2 和并发 batch 请求,能够覆盖多 rank 启动、请求分流、prefill/decode 推进及结果校验。
  • 修改范围集中,保留了 pdfusion_scheduler_mode 的显式开关,可通过恢复默认调度器完成回滚。

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