Skip to content

[trainer, fsdp, megatron] feat: support one_step_off_policy on Ascend NPU#4686

Merged
ji-huazhong merged 2 commits intoverl-project:mainfrom
baymax591:main
Dec 27, 2025
Merged

[trainer, fsdp, megatron] feat: support one_step_off_policy on Ascend NPU#4686
ji-huazhong merged 2 commits intoverl-project:mainfrom
baymax591:main

Conversation

@baymax591
Copy link
Contributor

What does this PR do?

Since Ray's collective communication interface does not support the hccl backend, we refer to the example code of vLLM and complete the weight synchronization between actor and rollout.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: pr#2924,pr4307
  • 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, cfg, reward
    • 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.

Copy link
Contributor

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

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 support for one_step_off_policy on Ascend NPUs by replacing ray.util.collective with a manual torch.distributed process group setup, which is a sound approach to support the hccl backend. The changes are consistent across the modified files. However, I've found a critical race condition in recipe/one_step_off_policy/ray_trainer.py during the weight synchronization group creation. The initialization for the actor worker group is not awaited, which could lead to runtime errors. I've provided a suggestion to fix this issue by ensuring both actor and rollout worker groups are fully initialized before proceeding.

@ji-huazhong ji-huazhong merged commit 35bf8d9 into verl-project:main Dec 27, 2025
7 checks passed
boren-ms pushed a commit to boren-ms/verl that referenced this pull request Dec 30, 2025
@lzxdjb
Copy link

lzxdjb commented Jan 4, 2026

@baymax591
I am using the one-step-off-policy method for multi-machine training, but I encounter the following error during execution:

image After investigating, I traced the error to the following code path:

File: ./recipe/one_step_off_policy/distributed_util.py

Line: 61
image

At this line, the code calls a utility function from vLLM:
File: ./vllm/distributed/utils.py

Uploading image.png…

However, the implementation in vllm/distributed/utils only supports IPv4 addresses. When the training environment uses IPv6, this results in a failure during distributed initialization.

Therefore, I guess the one-step-off-policy distributed training pipeline currently does not support IPv6?

jsfanfanfan pushed a commit to meituan-search/verl that referenced this pull request Jan 9, 2026
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
sophiayyya pushed a commit to sophiayyya/verl that referenced this pull request Jan 25, 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.

3 participants