[opd] feat: add fusenode on teacher forward and student train in fully_async_opd#6914
[opd] feat: add fusenode on teacher forward and student train in fully_async_opd#6914msz12345 wants to merge 1 commit into
Conversation
|
|
There was a problem hiding this comment.
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.
| engine.bridge.load_weights(engine.module, teacher_model_config.local_path) | ||
| else: | ||
| engine.bridge.load_hf_weights(engine.module, teacher_model_config.local_path) |
There was a problem hiding this comment.
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.
| 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) |
|
Sync trainer also need this, please move |
What does this PR do?
Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI){modules}includefsdp,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,like[megatron, fsdp, doc]{type}is infeat,fix,refactor,chore,test[BREAKING]to the beginning of the title.[BREAKING][fsdp, megatron] feat: dynamic batchingTest
API and Usage Example
# Add code snippet or script demonstrating how to use thisDesign & Code Changes
Checklist Before Submitting
Important
Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=alwaysci-requestchannel in theverlSlack workspace. (If not accessible, please try the Feishu group (飞书群).)recipesubmodule, please also update the reference to the submodule commit viagit submodule update --remoteorcd recipe && git pull origin main.