{"id":22894219,"url":"https://github.com/zib-iol/perp","last_synced_at":"2026-04-29T18:32:10.044Z","repository":{"id":213831607,"uuid":"734354032","full_name":"ZIB-IOL/PERP","owner":"ZIB-IOL","description":"Code to reproduce the experiments of the paper: \"PERP: Rethinking the Prune-Retrain Paradigm in the ERA of LLMs\"","archived":false,"fork":false,"pushed_at":"2025-03-22T11:48:43.000Z","size":21,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T22:38:21.634Z","etag":null,"topics":["deep-learning","efficiency","finetuning","llms","neural-network","pruning","pytorch","sparsity"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2312.15230","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZIB-IOL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-21T13:26:17.000Z","updated_at":"2025-03-22T11:48:46.000Z","dependencies_parsed_at":"2023-12-23T15:26:17.888Z","dependency_job_id":null,"html_url":"https://github.com/ZIB-IOL/PERP","commit_stats":null,"previous_names":["zib-iol/perp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZIB-IOL/PERP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZIB-IOL%2FPERP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZIB-IOL%2FPERP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZIB-IOL%2FPERP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZIB-IOL%2FPERP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZIB-IOL","download_url":"https://codeload.github.com/ZIB-IOL/PERP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZIB-IOL%2FPERP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deep-learning","efficiency","finetuning","llms","neural-network","pruning","pytorch","sparsity"],"created_at":"2024-12-13T23:17:14.150Z","updated_at":"2026-04-29T18:32:10.025Z","avatar_url":"https://github.com/ZIB-IOL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PERP: Rethinking the Prune-Retrain Paradigm in the Era of LLMs\n\n*Paper: [arxiv.org/abs/2312.15230](https://arxiv.org/abs/2312.15230)*\n\n*Authors: [Max Zimmer](https://maxzimmer.org/), Megi Andoni, [Christoph Spiegel](http://www.christophspiegel.berlin/), [Sebastian Pokutta](http://www.pokutta.com/)*\n\nThis repository contains the official implementation of PERP, a framework for pruning and retraining/reconstructing Large Language Models (LLMs). The code is built on PyTorch and uses [Weights \u0026 Biases](https://wandb.ai) for experiment tracking.\n\n### Key Features\n\n- Support for multiple LLM architectures (OPT, LLaMA-2, Mistral, Mixtral)\n- Various pruning methods (magnitude, random, WANDA, SparseGPT)\n- Sparsity-preserving reconstruction/retraining approaches such as MaskLoRA and ScaleLoRA\n- Semi-Structured and unstructured sparsity patterns\n- Parameter-Efficient Fine-Tuning (PEFT) integration\n- Comprehensive experiment tracking with W\u0026B\n\n### Running Experiments\n\nThe main entry point is [`main.py`](main.py). If passed the `--debug` flag, the code will run in debug mode, executing the default configuration as specified in the `defaults` dictionary. Otherwise, the code expectes to be started by a WandB sweep agent. Hence, to run an experiment, either configure the parameters in `main.py` or use Weights \u0026 Biases sweeps. Key parameters include:\n\n### Essential hyperparameters\n- `training_mode`: Whether to retrain or reconstruct the model, must be one of `retrain`, `reconstruct`, or `None` (in which case the model is not retrained/reconstructed). Retraining is a full retraining of the model using the overall loss. Reconstruction operates layerwise by minimizing the per-layer $L_2$-deviation loss.\n- `peft_strategy`: Whether to use SelectivePEFT or FullFT. FullFT retrains all parameters, consequently requires more memory. SelectivePEFT allows for more parameter-efficient fine-tuning, which can be further specified by the `peft_use_*` parameters.\n- `lora_type`: When `SelectivePEFT` is used and `peft_use_lora` is `True`, this parameter specifies the LoRA-variant to use. Options are `lora`, `lora_prune`, `scale_lora`, `mask_lora`, corresponding to the variants proposed in the paper.\n\n### Citation\n\nIf you find this work useful for your research, please consider citing:\n\n```\n@article{zimmer2023perp,\n  title={Perp: Rethinking the prune-retrain paradigm in the era of llms},\n  author={Zimmer, Max and Andoni, Megi and Spiegel, Christoph and Pokutta, Sebastian},\n  journal={arXiv preprint arXiv:2312.15230},\n  year={2023}\n}\n``` ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzib-iol%2Fperp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzib-iol%2Fperp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzib-iol%2Fperp/lists"}