huggingface/peft
🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
What it solves
Fine-tuning large pretrained models is often prohibitively expensive in terms of compute and storage. PEFT provides a way to adapt these models to specific downstream tasks by updating only a tiny fraction of the model's parameters, rather than the entire network, significantly reducing the resources required for training and saving checkpoints.
How it works
Instead of full fine-tuning, PEFT implements various parameter-efficient methods (such as LoRA, IA3, and soft prompts) that add or modify a small number of extra parameters. These "adapters" are trained while the base model remains frozen. This approach allows for high performance comparable to full fine-tuning while keeping the checkpoint sizes in megabytes rather than gigabytes.
Who it’s for
Developers and researchers who want to fine-tune large language models (LLMs) or diffusion models on consumer-grade hardware or save storage space when managing multiple task-specific adapters.
Highlights
- Massive Resource Savings: Reduces GPU memory usage and storage requirements, enabling the training of large models (e.g., 12B parameters) on single GPUs.
- Ecosystem Integration: Deeply integrated with Hugging Face Transformers, Diffusers, and Accelerate for seamless training and inference.
- Quantization Support: Can be combined with quantization (like QLoRA) to further lower the memory footprint for training and inference.
- Wide Model Support: Supports a variety of architectures across text and image generation, with the ability to manually configure support for new architectures.