releases.shpreview

PEFT

$npx -y @buildinternet/releases show peft
Mon
Wed
Fri
AprMayJunJulAugSepOctNovDecJanFebMarApr
Less
More
Releases2Avg0/wkVersionsv0.19.0 → v0.19.1
Jan 30, 2024
Patch Release v0.8.1

This is a small patch release of PEFT that should:

What's Changed

Full Changelog: https://github.com/huggingface/peft/compare/v0.8.0...v0.8.1

v0.8.0: Poly PEFT method, LoRA improvements, Documentation improvements and more

Highlights

Poly PEFT method

Parameter-efficient fine-tuning (PEFT) for cross-task generalization consists of pre-training adapters on a multi-task training set before few-shot adaptation to test tasks. Polytropon [Ponti et al., 2023] (𝙿𝚘𝚕𝚢) jointly learns an inventory of adapters and a routing function that selects a (variable-size) subset of adapters for each task during both pre-training and few-shot adaptation. To put simply, you can think of it as Mixture of Expert Adapters. 𝙼𝙷𝚁 (Multi-Head Routing) combines subsets of adapter parameters and outperforms 𝙿𝚘𝚕𝚢 under a comparable parameter budget; by only fine-tuning the routing function and not the adapters (𝙼𝙷𝚁-z) they achieve competitive performance with extreme parameter efficiency.

LoRA improvements

Now, you can specify all-linear to target_modules param of LoraConfig to target all the linear layers which has shown to perform better in QLoRA paper than only targeting query and valuer attention layers

Embedding layers of base models are now automatically saved when the embedding layers are resized when fine-tuning with PEFT approaches like LoRA. This enables extending the vocabulary of tokenizer to include special tokens. This is a common use-case when doing the following:

  1. Instruction finetuning with new tokens being added such as <|user|>, <|assistant|>, <|system|>, <|im_end|>, <|im_start|>, </s>, <s> to properly format the conversations
  2. Finetuning on a specific language wherein language specific tokens are added, e.g., Korean tokens being added to vocabulary for finetuning LLM on Korean datasets.
  3. Instruction finetuning to return outputs in a certain format to enable agent behaviour of new tokens such as <|FUNCTIONS|>, <|BROWSE|>, <|TEXT2IMAGE|>, <|ASR|>, <|TTS|>, <|GENERATECODE|>, <|RAG|>. A good blogpost to learn more about this https://www.philschmid.de/fine-tune-llms-in-2024-with-trl.

New option use_rslora in LoraConfig. Use it for ranks greater than 32 and see the increase in fine-tuning performance (same or better performance for ranks lower than 32 as well).

Documentation improvements

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.7.1...v0.8.0

Dec 12, 2023
v0.7.1 patch release

This is a small patch release of PEFT that should handle:

  • Issues with loading multiple adapters when using quantized models (#1243)
  • Issues with transformers v4.36 and some prompt learning methods (#1252)

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.7.0...v0.7.1

Dec 6, 2023
v0.7.0: Orthogonal Fine-Tuning, Megatron support, better initialization, safetensors, and more

Highlights

Other notable additions

  • It is now possible to choose which adapters are merged when calling merge (#1132)
  • IA³ now supports adapter deletion, by @alexrs (#1153)
  • A new initialization method for LoRA has been added, "gaussian" (#1189)
  • When training PEFT models with new tokens being added to the embedding layers, the embedding layer is now saved by default (#1147)
  • It is now possible to mix certain adapters like LoRA and LoKr in the same model, see the docs (#1163)
  • We started an initiative to improve the documenation, some of which should already be reflected in the current docs. Still, help by the community is always welcome. Check out this issue to get going.

Migration to v0.7.0

  • Safetensors are now the default format for PEFT adapters. In practice, users should not have to change anything in their code, PEFT takes care of everything -- just be aware that instead of creating a file adapter_model.bin, calling save_pretrained now creates adapter_model.safetensors. Safetensors have numerous advantages over pickle files (which is the PyTorch default format) and well supported on Hugging Face Hub.
  • When merging multiple LoRA adapter weights together using add_weighted_adapter with the option combination_type="linear", the scaling of the adapter weights is now performed differently, leading to improved results.
  • There was a big refactor of the inner workings of some PEFT adapters. For the vast majority of users, this should not make any difference (except making some code run faster). However, if your code is relying on PEFT internals, be aware that the inheritance structure of certain adapter layers has changed (e.g. peft.lora.Linear is no longer a subclass of nn.Linear, so isinstance checks may need updating). Also, to retrieve the original weight of an adapted layer, now use self.get_base_layer().weight, not self.weight (same for bias).

What's Changed

As always, a bunch of small improvements, bug fixes and doc improvements were added. We thank all the external contributors, both new and recurring. Below is the list of all changes since the last release.

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.6.2...v0.7.0

Significant community contributions

The following contributors have made significant changes to the library over the last release:

@alexrs

@callanwu

@elyxlz

@lukaskuhn-lku

@okotaku

@yxli2123

@zhangsheng377

Nov 14, 2023
v0.6.2 Patch Release: Refactor of adapter deletion API and fixes to `ModulesToSaveWrapper` when using Low-level API

This patch release refactors the adapter deletion API and fixes to ModulesToSaveWrapper when using Low-level API.

Refactor adapter deletion

Fix ModulesToSaveWrapper when using Low-level API

What's Changed

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.6.1...v0.6.2

Nov 9, 2023
0.6.1 Patch Release: compatibility of Adaptation Prompt with transformers 4.35.0

This patch release fixes the compatbility issues with Adaptation Prompt that users faced with transformers 4.35.0. Moreover, it fixes an issue with token classification PEFT models when saving them using safetensors

Adaptation prompt fixes

Safetensors fixes:

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.6.0...v0.6.1

Nov 3, 2023
🧨 Diffusers now uses 🤗 PEFT, new tuning methods, better quantization support, higher flexibility and more

Highlights

Integration with diffusers

<img src="https://github.com/huggingface/peft/assets/13534540/57eea400-ce5f-4bf8-a499-711fd83f590b" width="600" height="600">

🧨 Diffusers now leverage PEFT as a backend for LoRA inference for Stable Diffusion models (#873, #993, #961). Relevant PRs on 🧨 Diffusers are https://github.com/huggingface/diffusers/pull/5058, https://github.com/huggingface/diffusers/pull/5147, https://github.com/huggingface/diffusers/pull/5151 and https://github.com/huggingface/diffusers/pull/5359. This helps in unlocking a vast number of practically demanding use cases around adapter-based inference 🚀. Now you can do the following with easy-to-use APIs and it supports different checkpoint formats (Diffusers format, Kohya format ...):

  1. use multiple LoRAs
  2. switch between them instantaneously
  3. scale and combine them
  4. merge/unmerge
  5. enable/disable

For details, refer to the documentation at Inference with PEFT.

New tuning methods

Other notable additions

  • Allow merging of LoRA weights when using 4bit and 8bit quantization (bitsandbytes), thanks to @jiqing-feng (#851, #875)
  • IA³ now supports 4bit quantization thanks to @His-Wardship (#864)
  • We increased the speed of adapter layer initialization: This should be most notable when creating a PEFT LoRA model on top of a large base model (#887, #915, #994)
  • More fine-grained control when configuring LoRA: It is now possible to have different ranks and alpha values for different layers (#873)

Experimental features

  • For some adapters like LoRA, it is now possible to activate multiple adapters at the same time (#873)

Breaking changes

  • It is no longer allowed to create a LoRA adapter with rank 0 (r=0). This used to be possible, in which case the adapter was ignored.

What's Changed

As always, a bunch of small improvements, bug fixes and doc improvements were added. We thank all the external contributors, both new and recurring. Below is the list of all changes since the last release.

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.5.0...v0.6.0

Aug 22, 2023
GPTQ Quantization, Low-level API

GPTQ Integration

Now, you can finetune GPTQ quantized models using PEFT. Here are some examples of how to use PEFT with a GPTQ model: colab notebook and finetuning script.

Low-level API

Enables users and developers to use PEFT as a utility library, at least for injectable adapters (LoRA, IA3, AdaLoRA). It exposes an API to modify the model in place to inject the new layers into the model.

Support for XPU and NPU devices

Leverage the support for more devices for loading and fine-tuning PEFT adapters.

Mix-and-match LoRAs

Stable support and new ways of merging multiple LoRAs. There are currently 3 ways of merging loras supported: linear, svd and cat.

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.4.0...v0.5.0

Jul 18, 2023
QLoRA, IA3 PEFT method, support for QA and Feature Extraction tasks, AutoPeftModelForxxx for simplified UX , LoRA for custom models with new added utils

QLoRA Support:

QLoRA uses 4-bit quantization to compress a pretrained language model. The LM parameters are then frozen and a relatively small number of trainable parameters are added to the model in the form of Low-Rank Adapters. During finetuning, QLoRA backpropagates gradients through the frozen 4-bit quantized pretrained language model into the Low-Rank Adapters. The LoRA layers are the only parameters being updated during training. For more details read the blog Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA

New PEFT methods: IA3 from T-Few paper

To make fine-tuning more efficient, IA3 (Infused Adapter by Inhibiting and Amplifying Inner Activations) rescales inner activations with learned vectors. These learned vectors are injected into the attention and feedforward modules in a typical transformer-based architecture. These learned vectors are the only trainable parameters during fine-tuning, and thus the original weights remain frozen. Dealing with learned vectors (as opposed to learned low-rank updates to a weight matrix like LoRA) keeps the number of trainable parameters much smaller. For more details, read the paper Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning

Support for new tasks: QA and Feature Extraction

Addition of PeftModelForQuestionAnswering and PeftModelForFeatureExtraction classes to support QA and Feature Extraction tasks, respectively. This enables exciting new use-cases with PEFT, e.g., LoRA for semantic similarity tasks.

AutoPeftModelForxxx for better and Simplified UX

Introduces a new paradigm, AutoPeftModelForxxx intended for users that want to rapidly load and run peft models.

from peft import AutoPeftModelForCausalLM

peft_model = AutoPeftModelForCausalLM.from_pretrained("ybelkada/opt-350m-lora")

LoRA for custom models

Not a transformer model, no problem, we have got you covered. PEFT now enables the usage of LoRA with custom models.

New LoRA utilities

Improvements to add_weighted_adapter method to support SVD for combining multiple LoRAs when creating new LoRA. New utils such as unload and delete_adapter providing users much better control about how they deal with the adapters.

PEFT and Stable Diffusion

PEFT is very extensible and easy to use for performing DreamBooth of Stable Diffusion. Community has added conversion scripts to be able to use PEFT models with Civitai/webui format and vice-versa.

What's Changed

New Contributors

Full Changelog: https://github.com/huggingface/peft/compare/v0.3.0...v0.4.0

Significant community contributions

The following contributors have made significant changes to the library over the last release:

@TimDettmers

@SumanthRH

@kovalexal

@sywangyi

@aarnphm

@martin-liu

@thomas-schillaci

May 3, 2023
Docs, Testing Suite, Multi Adapter Support, New methods and examples

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.

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.

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.

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.

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.

What's Changed

New Contributors

Significant community contributions

The following contributors have made significant changes to the library over the last release:

@QingruZhang

@yeoedward

@Splo2t

Mar 10, 2023

Whisper large tuning using PEFT LoRA+INT-8 on T4 GPU in Colab notebooks

We tested PEFT on @OpenAI's Whisper Large model and got: i) 5x larger batch sizes ii) Less than 8GB GPU VRAM iii) Best part? Almost no degredation to WER 🤯

Without PEFT:

  • OOM on a T4 GPU ❌
  • 6GB checkpoint ❌
  • 13.64 WER ✅

With PEFT:

  • Train on a T4 GPU ✅
  • 60MB checkpoint ✅
  • 14.01 WER ✅

prepare_for_int8_training utility

This utility enables preprocessing the base model to be ready for INT8 training.

disable_adapter() context manager

Enables to disable adapter layers to get the outputs from the frozen base models. An exciting application of this feature allows only a single model copy to be used for policy model and reference model generations in RLHF.

What's Changed

New Contributors

Significant community contributions

The following contributors have made significant changes to the library over the last release:

  • @mayank31398
    • Prompt Tuning method enhancements and fixes (#68, #150)

Full Changelog: https://github.com/huggingface/peft/compare/v0.1.0...v0.2.0

Feb 10, 2023
v0.1.0 Initial release

Initial release of 🤗 PEFT. Checkout the main README to learn more about it!

Latest
v0.19.1
Tracking Since
Feb 10, 2023
Last fetched Apr 18, 2026