Skip to content

[opd] feat: add fusenode on teacher forward and student train in fully_async_opd#6914

Open
msz12345 wants to merge 1 commit into
verl-project:mainfrom
meituan-search:fusenode-opd
Open

[opd] feat: add fusenode on teacher forward and student train in fully_async_opd#6914
msz12345 wants to merge 1 commit into
verl-project:mainfrom
meituan-search:fusenode-opd

Conversation

@msz12345

@msz12345 msz12345 commented Jul 2, 2026

Copy link
Copy Markdown

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

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, veomni, 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, fully_async, one_step_off
    • 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.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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 trainer-colocated (fused-node) Online Policy Distillation (OPD) support, allowing isomorphic teacher and student models to share the trainer's Megatron engine by swapping parameter snapshots between training and scoring phases. It updates the configuration, agent loop, trainer, and engine workers to support this new execution mode, and adds corresponding tests. A critical issue was identified in engine_workers.py where accessing teacher_model_config.local_path will raise an AttributeError because HFModelConfig uses path instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +150 to +152
engine.bridge.load_weights(engine.module, teacher_model_config.local_path)
else:
engine.bridge.load_hf_weights(engine.module, teacher_model_config.local_path)

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.

critical

The HFModelConfig object does not have a local_path attribute. It uses path to specify the model path (which can be a local path or a Hugging Face model ID). Accessing teacher_model_config.local_path will raise an AttributeError at runtime. Please use teacher_model_config.path instead.

Suggested change
engine.bridge.load_weights(engine.module, teacher_model_config.local_path)
else:
engine.bridge.load_hf_weights(engine.module, teacher_model_config.local_path)
if engine.vanilla_bridge:
engine.bridge.load_weights(engine.module, teacher_model_config.path)
else:
engine.bridge.load_hf_weights(engine.module, teacher_model_config.path)

@wuxibin89

Copy link
Copy Markdown
Collaborator

Sync trainer also need this, please move compute_teacher_log_prob support from verl/experimental/separation/engine_workers.py to verl/workers/engine_workers.py

@wuxibin89 wuxibin89 changed the title add fusenode on teacher forward and student train in fully_async_opd [opd] feat: add fusenode on teacher forward and student train in fully_async_opd Jul 6, 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