FasterAI: Prune and Distill your models with fastai and PyTorch
Vidéo
Description
fasterai is a library created to make neural network smaller and faster. It essentially relies on common compression techniques for networks such as pruning, knowledge distillation, Lottery Ticket Hypothesis, ...
The core feature of fasterai is its Sparsifying capabilities, constructed on 4 main modules: granularity, context, criteria, schedule. Each of these modules is highly customizable, allowing you to change them according to your needs or even to come up with your own !
Visit Read The Docs Project Page or read following README to know more about using fasterai.
Quick Start
0. Import fasterai
from fasterai.sparse.all import *
1. Create your model with fastai
learn = cnn_learner(dls, model)
2. Get you Fasterai Callback
sp_cb=SparsifyCallback(sparsity, granularity, context, criteria, schedule)
3. Train you model to make it sparse !
learn.fit_one_cycle(n_epochs, cbs=sp_cb)
Installation
pip install git+https://github.com/FasterAI-Labs/fasterai.git
or
pip install fasterai
Tutorials
- Get Started with FasterAI
- Create your own pruning schedule
- Find winning tickets using the Lottery Ticket Hypothesis
- Use Knowledge Distillation to help a student model to reach higher performance
- Sparsify Transformers
- More to come...
Citing
@software{Hubens,
author = {Nathan Hubens},
title = {fasterai},
year = 2022,
publisher = {Zenodo},
version = {v0.1.6},
doi = {10.5281/zenodo.6469868},
url = {https://doi.org/10.5281/zenodo.6469868}
}
License
Apache-2.0 License.
Ressources
Dépôt de code
https://github.com/FasterAI-Labs/fasterai