Skip to content

[sglang] fix: only wake up weights on infer_tp 0 - #2403

Merged
eric-haibin-lin merged 4 commits into
mainfrom
only_wake_up_tp_0
Jul 7, 2025
Merged

eric-haibin-lin merged 4 commits into
mainfrom
only_wake_up_tp_0

Conversation

@zhaochenyang20

Copy link
Copy Markdown
Collaborator

What does this PR do?

As the name goes, a quick bug fix.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a bug fix in the FSDPSGLangShardingManager. The change ensures that resuming memory occupation for the KV cache during the multi-stage wake-up process is only performed on rank 0 of the inference tensor parallelism group. This aligns with the existing logic for other inference engine operations, preventing potential race conditions or redundant operations across multiple ranks. The change is correct and improves the robustness of the distributed setup.

@hebiao064 hebiao064 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've fixed in my PR: https://github.com/volcengine/verl/pull/2187/files#diff-5872c25af9ac22eee90d7163b2e9efdce7ef2c1f1c0293590ad58ad88b497a05

But feel free to merge your fix first since my PR is still blocked by CI

@eric-haibin-lin
eric-haibin-lin merged commit ee65422 into main Jul 7, 2025
@eric-haibin-lin
eric-haibin-lin deleted the only_wake_up_tp_0 branch July 7, 2025 20:24
lkc233 pushed a commit to lkc233/verl that referenced this pull request Jul 10, 2025
ArronHZG pushed a commit to imh966/verl that referenced this pull request Jul 10, 2025
oseyosey pushed a commit to oseyosey/verl that referenced this pull request Jul 28, 2025
Juniper1021 pushed a commit to Juniper1021/verl that referenced this pull request Aug 7, 2025
whatadayG pushed a commit to whatadayG/verl that referenced this pull request Sep 5, 2025
chenjiaoAngel added a commit to chenjiaoAngel/verl that referenced this pull request Nov 14, 2025
TimurTaepov pushed a commit to giorgossideris/verl that referenced this pull request Dec 20, 2025
oseyosey pushed a commit to oseyosey/verl that referenced this pull request Jan 20, 2026
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
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.

4 participants