{"id":35881928,"url":"https://github.com/lucaslie/torchprune","last_synced_at":"2026-01-08T18:04:58.123Z","repository":{"id":37670349,"uuid":"240403411","full_name":"lucaslie/torchprune","owner":"lucaslie","description":"A research library for pytorch-based neural network pruning, compression, and more.","archived":false,"fork":false,"pushed_at":"2022-11-28T01:42:45.000Z","size":6939,"stargazers_count":154,"open_issues_count":10,"forks_count":22,"subscribers_count":5,"default_branch":"main","last_synced_at":"2023-11-07T17:42:13.898Z","etag":null,"topics":["compression","coresets","deep-learning","filter-pruning","generalization-ability","machine-learning","neural-architecture-search","neural-networks","pruning","pruning-algorithms","pytorch","sparsification","sparsity","tensor-decomposition","tinyml","weight-pruning"],"latest_commit_sha":null,"homepage":"https://people.csail.mit.edu/lucasl/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucaslie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-14T01:25:45.000Z","updated_at":"2023-10-23T11:36:04.000Z","dependencies_parsed_at":"2022-08-08T21:15:41.602Z","dependency_job_id":null,"html_url":"https://github.com/lucaslie/torchprune","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"purl":"pkg:github/lucaslie/torchprune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslie%2Ftorchprune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslie%2Ftorchprune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslie%2Ftorchprune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslie%2Ftorchprune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucaslie","download_url":"https://codeload.github.com/lucaslie/torchprune/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslie%2Ftorchprune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28247305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-08T02:00:06.591Z","response_time":241,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","coresets","deep-learning","filter-pruning","generalization-ability","machine-learning","neural-architecture-search","neural-networks","pruning","pruning-algorithms","pytorch","sparsification","sparsity","tensor-decomposition","tinyml","weight-pruning"],"created_at":"2026-01-08T18:04:21.398Z","updated_at":"2026-01-08T18:04:58.109Z","avatar_url":"https://github.com/lucaslie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# torchprune\nMain contributors of this code base:\n[Lucas Liebenwein](http://www.mit.edu/~lucasl/),\n[Cenk Baykal](http://www.mit.edu/~baykal/).\n\nPlease check individual paper folders for authors of each paper.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./misc/imgs/pruning_pipeline.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n### Papers\nThis repository contains code to reproduce the results from the following\npapers: \n| Paper | Venue | Title \u0026 Link | \n| :---: | :---: | :---         |\n| **Node** | NeurIPS 2021 | [Sparse Flows: Pruning Continuous-depth Models](https://proceedings.neurips.cc/paper/2021/hash/bf1b2f4b901c21a1d8645018ea9aeb05-Abstract.html) |\n| **ALDS** | NeurIPS 2021 | [Compressing Neural Networks: Towards Determining the Optimal Layer-wise Decomposition](https://arxiv.org/abs/2107.11442) |\n| **Lost** | MLSys 2021 | [Lost in Pruning: The Effects of Pruning Neural Networks beyond Test Accuracy](https://proceedings.mlsys.org/paper/2021/hash/2a79ea27c279e471f4d180b08d62b00a-Abstract.html) |\n| **PFP** | ICLR 2020 | [Provable Filter Pruning for Efficient Neural Networks](https://openreview.net/forum?id=BJxkOlSYDH) |\n| **SiPP** | SIAM 2022 | [SiPPing Neural Networks: Sensitivity-informed Provable Pruning of Neural Networks](https://doi.org/10.1137/20M1383239) |\n\n### Packages\nIn addition, the repo also contains two stand-alone python packages that \ncan be used for any desired pruning experiment: \n| Packages | Location | Description |\n| :---:    | :---:    | :---        |\n|`torchprune` | [./src/torchprune](./src/torchprune) | This package can be used to run any of the implemented pruning algorithms. It also contains utilities to use pre-defined networks (or use your own network) and utilities for standard datasets. |\n| `experiment` | [./src/experiment](./src/experiment) | This package can be used to run pruning experiments and compare multiple pruning methods for different prune ratios. Each experiment is configured using a `.yaml`-configuration files. |\n\n### Paper Reproducibility\nThe code for each paper is implemented in the respective packages. In addition,\nfor each paper we have a separate folder that contains additional information\nabout the paper and scripts and parameter configuration to reproduce the exact\nresults from the paper.\n| Paper | Location |\n| :---: | :---:    |\n| **Node** | [paper/node](./paper/node) |\n| **ALDS** | [paper/alds](./paper/alds) |\n| **Lost** | [paper/lost](./paper/lost) |\n| **PFP**  | [paper/pfp](./paper/pfp)   |\n| **SiPP** | [paper/sipp](./paper/sipp) |\n\n## Setup\nWe provide three ways to install the codebase:\n1. [Github repo + full conda environment](#1-github-repo)\n2. [Installation via pip](#2-pip-installation)\n3. [Docker image](#3-docker-image)\n\n### 1. Github Repo\nClone the github repo:\n```bash\ngit pull git@github.com:lucaslie/torchprune.git\n# (or your favorite way to pull a repo)\n```\n\nWe recommend installing the packages in a separate [conda\nenvironment](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python).\nThen to create a new conda environment run\n```bash\nconda create -n prune python=3.8 pip\nconda activate prune\n```\nTo install all required dependencies and both packages, run: \n```bash\npip install -r misc/requirements.txt\n```\nNote that this will also install pre-commit hooks for clean commits :-)\n### 2. Pip Installation\nTo separately install each package with minimal dependencies without \ncloning the repo manually, run the following commands: \n```bash\n# \"torchprune\" package\npip install git+https://github.com/lucaslie/torchprune/#subdirectory=src/torchprune\n\n# \"experiment\" package\npip install git+https://github.com/lucaslie/torchprune/#subdirectory=src/experiment\n```\nNote that the [experiment](./src/experiment) package does not automatically \ninstall the [torchprune](./src/torchprune) package.\n### 3. Docker Image\nYou can simply pull the docker image from our docker hub: \n```bash\ndocker pull liebenwein/torchprune\n```\n\nYou can run it interactively with\n```bash\ndocker run -it liebenwein/torchprune bash\n```\n\nFor your reference you can find the Dockerfile [here](./misc/Dockerfile).\n\n## More Information and Usage\nCheck out the following `README`s in the sub-directories to find out more about\nusing the codebase.\n\n| READMEs | More Information\n| --- | --- |\n| [src/torchprune/README.md](./src/torchprune) | more details to prune neural networks, how to use and setup the data sets, how to implement custom pruning methods, and how to add your data sets and networks. |   \n| [src/experiment/README.md](./src/experiment) | more details on how to configure and run your own experiments, and more information on how to re-produce the results. |\n| [paper/node/README.md](./paper/node) | check out for more information on the [Node](https://proceedings.neurips.cc/paper/2021/hash/bf1b2f4b901c21a1d8645018ea9aeb05-Abstract.html) paper. |\n| [paper/alds/README.md](./paper/alds) | check out for more information on the [ALDS](https://arxiv.org/abs/2107.11442) paper. |\n| [paper/lost/README.md](./paper/lost) | check out for more information on the [Lost](https://proceedings.mlsys.org/paper/2021/hash/2a79ea27c279e471f4d180b08d62b00a-Abstract.html) paper. |\n| [paper/pfp/README.md](./paper/pfp) | check out for more information on the [PFP](https://openreview.net/forum?id=BJxkOlSYDH) paper. |\n| [paper/sipp/README.md](./paper/sipp) | check out for more information on the  [SiPP](https://doi.org/10.1137/20M1383239) paper. |\n\n## Citations\nPlease cite the respective papers when using our work.\n\n### [Sparse flows: Pruning continuous-depth models](https://proceedings.neurips.cc/paper/2021/hash/bf1b2f4b901c21a1d8645018ea9aeb05-Abstract.html)\n```\n@article{liebenwein2021sparse,\n  title={Sparse flows: Pruning continuous-depth models},\n  author={Liebenwein, Lucas and Hasani, Ramin and Amini, Alexander and Rus, Daniela},\n  journal={Advances in Neural Information Processing Systems},\n  volume={34},\n  pages={22628--22642},\n  year={2021}\n}\n```\n\n### [Towards Determining the Optimal Layer-wise Decomposition](https://arxiv.org/abs/2107.11442)\n```\n@inproceedings{liebenwein2021alds,\n author = {Lucas Liebenwein and Alaa Maalouf and Dan Feldman and Daniela Rus},\n booktitle = {Advances in Neural Information Processing Systems},\n title = {Compressing Neural Networks: Towards Determining the Optimal Layer-wise Decomposition},\n url = {https://arxiv.org/abs/2107.11442},\n volume = {34},\n year = {2021}\n}\n```\n\n### [Lost In Pruning](https://proceedings.mlsys.org/paper/2021/hash/2a79ea27c279e471f4d180b08d62b00a-Abstract.html)\n```\n@article{liebenwein2021lost,\ntitle={Lost in Pruning: The Effects of Pruning Neural Networks beyond Test Accuracy},\nauthor={Liebenwein, Lucas and Baykal, Cenk and Carter, Brandon and Gifford, David and Rus, Daniela},\njournal={Proceedings of Machine Learning and Systems},\nvolume={3},\nyear={2021}\n}\n```\n\n### [Provable Filter Pruning](https://openreview.net/forum?id=BJxkOlSYDH)\n```\n@inproceedings{liebenwein2020provable,\ntitle={Provable Filter Pruning for Efficient Neural Networks},\nauthor={Lucas Liebenwein and Cenk Baykal and Harry Lang and Dan Feldman and Daniela Rus},\nbooktitle={International Conference on Learning Representations},\nyear={2020},\nurl={https://openreview.net/forum?id=BJxkOlSYDH}\n}\n```\n\n### [SiPPing Neural Networks](https://doi.org/10.1137/20M1383239) (Weight Pruning)\n```\n@article{baykal2022sensitivity,\n  title={Sensitivity-informed provable pruning of neural networks},\n  author={Baykal, Cenk and Liebenwein, Lucas and Gilitschenski, Igor and Feldman, Dan and Rus, Daniela},\n  journal={SIAM Journal on Mathematics of Data Science},\n  volume={4},\n  number={1},\n  pages={26--45},\n  year={2022},\n  publisher={SIAM}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaslie%2Ftorchprune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucaslie%2Ftorchprune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaslie%2Ftorchprune/lists"}