Skip to content

Fix GKD Liger teacher routing - #9841

Open
taking-lying-flat wants to merge 1 commit into
modelscope:mainfrom
taking-lying-flat:agent/fix-gkd-liger-teacher-routing
Open

Fix GKD Liger teacher routing#9841
taking-lying-flat wants to merge 1 commit into
modelscope:mainfrom
taking-lying-flat:agent/fix-gkd-liger-teacher-routing

Conversation

@taking-lying-flat

@taking-lying-flat taking-lying-flat commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Fix the teacher routing and validation logic for Liger GKD loss.

Previously, _prepare_liger_loss() was called before _setup_teacher(). As a result, Liger GKD loss was initialized before the trainer resolved whether GKD was using a local teacher model, a teacher API, or self-distillation.

This PR:

  • Moves Liger loss initialization after teacher setup, ensuring that it uses the resolved teacher configuration.
  • Requires a local teacher model when use_liger_kernel=True.
  • Raises a clear error when Liger GKD loss is used with teacher API or self-distillation, as these modes are not supported.
  • Raises a clear error when OPSD samples are used with Liger GKD loss.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@hjh0119

hjh0119 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

plz pass the lint test

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