Brand new Docs
With task guides, conceptual guides, integration guides, and code references all available at your fingertips, 🤗 PEFT's docs (found at https://huggingface.co/docs/peft) provide an insightful and easy-to-follow resource for anyone looking to how to use 🤗 PEFT. Whether you're a seasoned pro or just starting out, PEFT's documentation will help you to get the most out of it.
- [WIP-docs] Accelerate scripts by @stevhliu in #355
- [docs] Quicktour update by @stevhliu in #346
- [docs] Conceptual overview of prompting methods by @stevhliu in #339
- [docs] LoRA for token classification by @stevhliu in #302
- [docs] int8 training by @stevhliu in #332
- [docs] P-tuning for sequence classification by @stevhliu in #281
- [docs] Prompt tuning for CLM by @stevhliu in #264
- [docs] Prefix tuning for Seq2Seq by @stevhliu in #272
- [docs] Add API references by @stevhliu in #241
- [docs] Build notebooks from Markdown by @stevhliu in #240
- [docs] Supported models tables by @MKhalusova in #364
- [docs] Task guide with Dreambooth LoRA example by @MKhalusova in #330
- [docs] LoRA conceptual guide by @MKhalusova in #331
- [docs] Task guide for semantic segmentation with LoRA by @MKhalusova in #307
- Move image classification example to the docs by @MKhalusova in #239
Comprehensive Testing Suite
Comprised of both unit and integration tests, it rigorously tests core features, examples, and various models on different setups, including single and multiple GPUs. This commitment to testing helps ensure that PEFT maintains the highest levels of correctness, usability, and performance, while continuously improving in all areas.
- [
CI
] Add ci tests by @younesbelkada in #203 - Fix CI tests by @younesbelkada in #210
- [
CI
] Add more ci tests by @younesbelkada in #223 - [
tests
] Adds more tests + fix failing tests by @younesbelkada in #238 - [
tests
] Adds GPU tests by @younesbelkada in #256 - [
tests
] add slow tests to GH workflow by @younesbelkada in #304 - [
core
] Better log messages by @younesbelkada in #366
Multi Adapter Support
PEFT just got even more versatile with its new Multi Adapter Support! Now you can train and infer with multiple adapters, or even combine multiple LoRA adapters in a weighted combination. This is especially handy for RLHF training, where you can save memory by using a single base model with multiple adapters for actor, critic, reward, and reference. And the icing on the cake? Check out the LoRA Dreambooth inference example notebook to see this feature in action.
- Multi Adapter support by @pacman100 in #263
New PEFT methods: AdaLoRA and Adaption Prompt
PEFT just got even better, thanks to the contributions of the community! The AdaLoRA method is one of the exciting new additions. It takes the highly regarded LoRA method and improves it by allocating trainable parameters across the model to maximize performance within a given parameter budget. Another standout is the Adaption Prompt method, which enhances the already popular Prefix Tuning by introducing zero init attention.
- The Implementation of AdaLoRA (ICLR 2023) by @QingruZhang in #233
- Implement adaption prompt from Llama-Adapter paper by @yeoedward in #268
New LoRA utilities
Good news for LoRA users! PEFT now allows you to merge LoRA parameters into the base model's parameters, giving you the freedom to remove the PEFT wrapper and apply downstream optimizations related to inference and deployment. Plus, you can use all the features that are compatible with the base model without any issues.
- [
utils
] add merge_lora utility function by @younesbelkada in #227 - Add nn.Embedding Support to Lora by @Splo2t in #337
What's Changed
- release v0.3.0.dev0 by @pacman100 in #166
- fixing merged_linear lora issues by @pacman100 in #172
- Replace base_model's function temporarily by @PanQiWei in #170
- Support for LLaMA models by @zphang in #160
- [
core
] Fix peft multi-gpu issue by @younesbelkada in #145 - Update README.md by @dumpmemory in #167
- ChatGLM support by @mymusise in #180
- [
CI
] Add ci tests by @younesbelkada in #203 - Fix CI tests by @younesbelkada in #210
- Update train_dreambooth.py by @haofanwang in #204
- Fix failing test on
main
by @younesbelkada in #224 - Causal LM generation fix for prefix tuning: GPT2 model by @vineetm in #222
- [
CI
] Add more ci tests by @younesbelkada in #223 - Show CONFIG_NAME instead of "config.json" by @aitor-gamarra in #231
- add docs by @pacman100 in #214
- [
utils
] add merge_lora utility function by @younesbelkada in #227 - Have fix typo in README by @guspan-tanadi in #243
- Move image classification example to the docs by @MKhalusova in #239
- [docs] Add API references by @stevhliu in #241
- [docs] Build notebooks from Markdown by @stevhliu in #240
- [
core
] Fix offload issue by @younesbelkada in #248 - [
Automation
] Add stale bot by @younesbelkada in #247 - [resources] replace pdf links with abs links by @stas00 in #255
- [
Automation
] Update stale.py by @younesbelkada in #254 - docs: have fix bit typo README by @guspan-tanadi in #252
- Update other.py by @tpoisonooo in #250
- Fixing a bug where a wrong parameter name is used for the offload_folder by @toncho11 in #257
- [
tests
] Adds more tests + fix failing tests by @younesbelkada in #238 - The Implementation of AdaLoRA (ICLR 2023) by @QingruZhang in #233
- Add BLIP2 Example by @younesbelkada in #260
- Multi Adapter support by @pacman100 in #263
- Fix typo in examples/causal_language_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py by @rmill040 in #277
- [
tests
] Adds GPU tests by @younesbelkada in #256 - Fix half precision forward by @younesbelkada in #261
- fix trainable params setting by @pacman100 in #283
- [docs] Prefix tuning for Seq2Seq by @stevhliu in #272
- Fix lora_dropout operator type when dropout=0 by @bigeagle in #288
- [
test
] Add Dockerfile by @younesbelkada in #278 - fix and update examples and readme by @pacman100 in #295
- [docs] Prompt tuning for CLM by @stevhliu in #264
- Change gather for gather_for_metrics in eval. by @JulesGM in #296
- Fix: unexpected keyword argument 'has_fp16_weights' by @cyberfox in #299
- [
tests
] add CI training tests by @younesbelkada in #311 - [docs] Task guide for semantic segmentation with LoRA by @MKhalusova in #307
- [docs] P-tuning for sequence classification by @stevhliu in #281
- Fix
merge_and_unload
when having additional trainable modules by @pacman100 in #322 - feat(ci): add
pip
caching to CI by @SauravMaheshkar in #314 - Fix eval for causal language modeling example by @BabyChouSr in #327
- [docs] LoRA for token classification by @stevhliu in #302
- [docs] int8 training by @stevhliu in #332
- fix lora modules_to_save issue by @pacman100 in #343
- [docs] Task guide with Dreambooth LoRA example by @MKhalusova in #330
- [docs] LoRA conceptual guide by @MKhalusova in #331
- [docs] Conceptual overview of prompting methods by @stevhliu in #339
- Implement adaption prompt from Llama-Adapter paper by @yeoedward in #268
- [
tests
] add slow tests to GH workflow by @younesbelkada in #304 - [
core
] Better log messages by @younesbelkada in #366 - Use
try
andfinally
indisable_adapter()
to catch exceptions by @mukobi in #368 - [docs] Supported models tables by @MKhalusova in #364
- [WIP-docs] Accelerate scripts by @stevhliu in #355
- [docs] Quicktour update by @stevhliu in #346
- [
CI
] Fix nightly CI issues by @younesbelkada in #375 - Fix a link to the example script by @nzw0301 in #383
- Add nn.Embedding Support to Lora by @Splo2t in #337
- Fix missing arg for transpose in AdaLora by @yasyf in #347
- fix INT8 prepare function by @pacman100 in #389
New Contributors
- @PanQiWei made their first contribution in #170
- @mymusise made their first contribution in #180
- @haofanwang made their first contribution in #204
- @vineetm made their first contribution in #222
- @aitor-gamarra made their first contribution in #231
- @guspan-tanadi made their first contribution in #243
- @MKhalusova made their first contribution in #239
- @stevhliu made their first contribution in #241
- @stas00 made their first contribution in #255
- @tpoisonooo made their first contribution in #250
- @toncho11 made their first contribution in #257
- @QingruZhang made their first contribution in #233
- @rmill040 made their first contribution in #277
- @bigeagle made their first contribution in #288
- @JulesGM made their first contribution in #296
- @cyberfox made their first contribution in #299
- @BabyChouSr made their first contribution in #327
- @yeoedward made their first contribution in #268
- @mukobi made their first contribution in #368
- @nzw0301 made their first contribution in #383
- @Splo2t made their first contribution in #337
- @yasyf made their first contribution in #347
Significant community contributions
The following contributors have made significant changes to the library over the last release:
- The Implementation of AdaLoRA (ICLR 2023) in #233
- Implement adaption prompt from Llama-Adapter paper in #268
- Add nn.Embedding Support to Lora in #337