Skip to content

[RL] Reuse GDR checkpoint transfer handle#8078

Open
jackyYang6 wants to merge 2 commits into
PaddlePaddle:developfrom
jackyYang6:jacky/optimize-checkpoint-transfer-handle-init-develop
Open

[RL] Reuse GDR checkpoint transfer handle#8078
jackyYang6 wants to merge 2 commits into
PaddlePaddle:developfrom
jackyYang6:jacky/optimize-checkpoint-transfer-handle-init-develop

Conversation

@jackyYang6

@jackyYang6 jackyYang6 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

Avoid repeated CheckpointTransfer initialization during GDR dynamic weight updates. Reusing the initialized handle reduces repeated setup overhead across multiple update steps.

Modifications

  • Cache the GDR CheckpointTransfer handle in DynamicWeightManager.
  • Lazily initialize the handle on the first GDR weight update.
  • Reuse the cached handle for later update_weights_by_gdr calls.
  • Destroy and reset the cached handle when an update fails.

Usage or Command

No new user-facing command. Existing GDR weight update flow is unchanged.

Accuracy Tests

Not applicable. This PR only changes checkpoint-transfer handle initialization behavior and does not affect model outputs.

Checklist

  • Add at least a tag in the PR title.
  • Format your code, run pre-commit before commit.
  • Add unit tests. No unit tests added because this is a handle lifecycle optimization for GDR runtime behavior.
  • Provide accuracy results. Not applicable; no model output changes.
  • 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.

PaddlePaddle-bot

This comment was marked as outdated.

@jackyYang6 jackyYang6 force-pushed the jacky/optimize-checkpoint-transfer-handle-init-develop branch from ee3f166 to b69ad2a Compare June 25, 2026 11:47
PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@6d9a8f4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/rl/dynamic_weight_manager.py 86.95% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #8078   +/-   ##
==========================================
  Coverage           ?   67.52%           
==========================================
  Files              ?      475           
  Lines              ?    66907           
  Branches           ?    10317           
==========================================
  Hits               ?    45182           
  Misses             ?    18857           
  Partials           ?     2868           
Flag Coverage Δ
GPU 77.55% <86.95%> (?)
XPU 6.95% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Paddle-CI-Agent | pr_review | 2026-06-26 11:04:01

📋 Review 摘要

PR 概述:缓存 GDR CheckpointTransfer handle,避免动态权重更新时重复初始化 transfer 句柄。
变更范围fastdeploy/rl/dynamic_weight_manager.pytests/rl/test_dynamic_weight_gdr.py
影响面 Tag[RL]

问题

未发现新的阻塞性问题。PR 规范问题在下面章节报,不要在这里重复

历史 Findings 修复情况

Finding 问题 状态
F1 _destroy_gdr_handle() 吞掉 cleanup() 异常且没有任何日志。 ⚠️ 仍存在
F2 缓存的 GDR CheckpointTransfer 没有在 sleep/clear 权重路径释放。 ⚠️ 仍存在

📝 PR 规范检查

符合规范。标题使用官方 [RL] Tag,PR 描述包含 checklist §D2 要求的 MotivationModificationsUsage or CommandAccuracy TestsChecklist 章节。

总体评价

本轮按风险优先追溯了 GDR handle 创建、复用、异常清理、runner update/clear/sleep 调用链和新增单测。除历史未解决项外,暂未发现新的需要行间评论的问题。

@PaddlePaddle-bot

PaddlePaddle-bot commented Jun 26, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-07-06 15:08:37 UTC+08:00

CI报告基于以下代码生成(30分钟更新一次):
PR commit: 9238c11 | Merge base: 6d9a8f4 (branch: develop)


1 Required任务 : 8/10 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
42(0) 42 39 3 0 0 0
任务 错误类型 置信度 日志
Approval 需要 Approval Job
xpu_8cards_case_test / run_xpu_8cards_cases 未知 Job

2 失败详情

🔴 Approval — 需要 Approval(置信度: 高)

分析器: builtin approval_required
失败用例: 不适用

用例 错误摘要
不适用 该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。

关键日志:

[FAILURE]: Process completed with exit code 6.
  • 根因摘要: 需要人工 Approval
    该 Workflow 处于审批门禁失败状态,不是代码测试失败。完成人工审批后后续 CI 才会继续执行。

修复建议:

  1. 请通过人工审批。

关联变更: 无,属于 CI 审批流程。

🔴 xpu_8cards_case_test / run_xpu_8cards_cases — 未知(置信度: 低)

分析器: ci_analyze_unittest_fastdeploy
失败用例: 未获取到结构化失败用例

用例 错误摘要
未知 深度日志未提供 log_file_pathunittest_logs_dirunittest_detailserror_snippet 为“日志获取失败,无法提取错误信息”。

关键日志:

[FAILURE]: Process completed with exit code 1.
深度日志获取结果: 日志获取失败,无法提取错误信息。
  • 根因摘要: 失败日志不可用,暂无法定位
    fetch_ci_logs(quick=false, job_id=83582376858) 未返回可读取的 log_file_pathunittest_logs_dirunittest_details,返回的 extract_dir 在当前环境不存在。PR 改动集中在 GDR checkpoint transfer handle 复用逻辑及其单测,现有 CI 元数据不足以证明该 XPU 8 卡失败由 PR 代码导致。

修复建议:

  1. 先 rerun 该 job 或重新抓取日志;拿到具体失败用例/traceback 后再判断是否与 GDR 动态权重更新改动相关。

关联变更: fastdeploy/rl/dynamic_weight_manager.py:58, fastdeploy/rl/dynamic_weight_manager.py:179, fastdeploy/rl/dynamic_weight_manager.py:209, tests/rl/test_dynamic_weight_gdr.py:186, tests/rl/test_dynamic_weight_gdr.py:254

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.

3 participants