Skip to content

[gkd] support buffers & fix some bugs#9278

Merged
hjh0119 merged 3 commits into
modelscope:mainfrom
hjh0119:fix-gkd
May 7, 2026
Merged

[gkd] support buffers & fix some bugs#9278
hjh0119 merged 3 commits into
modelscope:mainfrom
hjh0119:fix-gkd

Conversation

@hjh0119
Copy link
Copy Markdown
Collaborator

@hjh0119 hjh0119 commented May 7, 2026

1、Support rollout buffers to enable sampling multiple batches of data in a single generation pass (generation_batch_size / steps_per_generation)
2、Fix compatibility issue between GKD and padding_free
3、Fix the bug in GKD multimodal inference when calling the vLLM server API #9222

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 and standardizes the handling of generation batch parameters across GRPO and GKD trainers by centralizing logic in a shared mixin. Key improvements include the implementation of buffered inputs for GKD to allow sample reuse across training steps and the addition of multimodal support for fetching teacher logprobs via an external API. Feedback focuses on improving debuggability by recommending that the code log warnings when falling back to raw images during multimodal encoding or when retrying API requests without specific processor arguments.

Comment thread swift/rlhf_trainers/gkd_trainer.py Outdated
Comment thread swift/rlhf_trainers/gkd_trainer.py
@hjh0119 hjh0119 merged commit b78f05d into modelscope:main May 7, 2026
1 of 3 checks passed
@hjh0119 hjh0119 deleted the fix-gkd branch May 7, 2026 06:57
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