Skip to content

[feat] support opd rl#9641

Merged
hjh0119 merged 17 commits into
modelscope:mainfrom
hjh0119:opd-rl
Jun 29, 2026
Merged

[feat] support opd rl#9641
hjh0119 merged 17 commits into
modelscope:mainfrom
hjh0119:opd-rl

Conversation

@hjh0119

@hjh0119 hjh0119 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@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 implements Megatron On-Policy Distillation as RL (OPD-RL) by integrating teacher KL as a GRPO advantage across local and Ray-based GKD and GRPO trainers. It also introduces OpenEnvScheduler and OpenEnvWrapper to support multi-turn rollouts in OpenEnv environments. The review feedback highlights several critical issues, including missing imports and potential AttributeErrors in gkd_helpers.py, a rank-guarding mismatch in teacher_mixin.py that could cause runtime failures, and synchronous blocking calls in OpenEnvScheduler that should be run in separate threads to avoid blocking the asyncio event loop. Additionally, defensive checks are recommended to prevent potential IndexError, StopIteration, and type promotion issues.

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 thread swift/rlhf_trainers/gkd_helpers.py Outdated
Comment thread swift/megatron/trainers/teacher_mixin.py Outdated
Comment thread swift/rollout/multi_turn.py
Comment thread swift/rollout/multi_turn.py
Comment thread swift/rlhf_trainers/gkd_helpers.py
Comment thread swift/rlhf_trainers/utils.py
Comment thread swift/rl_core/advantage.py
@hjh0119 hjh0119 merged commit 46f03e9 into modelscope:main Jun 29, 2026
3 checks passed
@hjh0119 hjh0119 deleted the opd-rl branch June 29, 2026 15:01
@hjh0119 hjh0119 mentioned this pull request Jun 30, 2026
1 task
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.

2 participants