← all repositories
yoshitomo-matsubara/torchdistill

Knowledge distillation without the boilerplate archaeology

A PyTorch framework that lets you run 26+ published KD methods by editing YAML instead of rewriting model forward passes.

1.6k stars Python ML FrameworksOther AI
torchdistill
Velocity · 7d
+0.7
★ / day
Trend
steady
star history

What it does

torchdistill is a configuration-driven PyTorch framework for knowledge distillation and general deep learning experiments. You define models, datasets, optimizers, and losses in a declarative YAML file rather than Python code. It ships with 26+ implemented distillation methods from TPAMI, CVPR, ICLR, NeurIPS, and other venues, plus pretrained models and training logs for reproducibility.

The interesting bit

The ForwardHookManager lets you extract intermediate representations from any model by specifying module paths in YAML—no surgery on forward() functions required. This is the tedious part everyone else makes you do by hand. The framework also joined the PyTorch Ecosystem in December 2023, which is a nontrivial stamp of credibility.

Key highlights

  • 26+ knowledge distillation methods from major venues, with configs and trained models provided
  • Works for image classification (ImageNet, CIFAR), object detection (COCO), semantic segmentation, and NLP tasks (GLUE, text classification)
  • PyTorch Hub integration: import external models as teachers/students via YAML entries
  • Google Colab and Amazon SageMaker Studio Lab notebooks available
  • Can run standard training without any teacher model by simply omitting teacher entries from config

Caveats

  • The “no coding” claim is aspirational; you’ll still need Python for custom modules, though the framework tries to minimize this
  • README is enthusiastic about citations in a way that suggests academic maintenance dependency

Verdict Researchers who need to benchmark or extend knowledge distillation methods should grab this. Engineers building production pipelines may find the YAML abstraction layer adds indirection they don’t need.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.