Skip to content

[bugfix] fix opsd transformer generate#9145

Merged
hjh0119 merged 2 commits into
modelscope:mainfrom
hjh0119:fix-opsd-transformer-generate
Apr 18, 2026
Merged

[bugfix] fix opsd transformer generate#9145
hjh0119 merged 2 commits into
modelscope:mainfrom
hjh0119:fix-opsd-transformer-generate

Conversation

@hjh0119
Copy link
Copy Markdown
Collaborator

@hjh0119 hjh0119 commented Apr 18, 2026

fix #9126

Copy link
Copy Markdown
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 refactors the preparation of teacher inputs for OPSD in the GKD trainer by appending student responses to the teacher's message history and using the standard batch preparation method. A high-severity issue was identified where padding tokens from the student's generation were being included in the teacher's input, potentially causing data corruption or training failures. A suggestion was made to use the attention mask to strip these padding tokens before processing.

Comment thread swift/rlhf_trainers/gkd_trainer.py
@hjh0119 hjh0119 merged commit 26bef70 into modelscope:main Apr 18, 2026
3 checks passed
@hjh0119 hjh0119 deleted the fix-opsd-transformer-generate branch April 18, 2026 13:26
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.

OPSD 非 vLLM on-policy 路径下 VLM(Qwen3-VL)teacher forward 崩溃 — position_ids 长度不匹

2 participants