feat: Add knowledge distillation example with offline support#1654
Open
tourzhao wants to merge 3 commits intoTHUDM:mainfrom
Open
feat: Add knowledge distillation example with offline support#1654tourzhao wants to merge 3 commits intoTHUDM:mainfrom
tourzhao wants to merge 3 commits intoTHUDM:mainfrom
Conversation
Add knowledge distillation (KD) example supporting online KD via external teacher server and offline KD from pre-saved teacher data (JSONL). Implements Top-K forward KL and sampled KL loss. Tested with Qwen3-4B (teacher) -> Qwen3-1.7B (student). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add strict=False to zip() calls (ruff B905) - Apply black formatting fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Files
examples/knowledge_distillation/__init__.pyexamples/knowledge_distillation/knowledge_distillation.pyexamples/knowledge_distillation/offline_kd.pyexamples/knowledge_distillation/kd_loss.pyexamples/knowledge_distillation/run-qwen3-1.7B-kd.shexamples/knowledge_distillation/run-qwen3-1.7B-offline-kd.shexamples/knowledge_distillation/README.mdTest plan
🤖 Generated with Claude Code