236 Commits

Author SHA1 Message Date
2813b9c4bf FEAT Add DeLoRA (#2780)
Implements DeLoRA: "Decoupling Angles and Strength in Low-rank
Adaptation" (https://huggingface.co/papers/2503.18225).

Similar to DoRA, DeLoRA decouples the angular learning from the
adaptation strength, but it also allows to limit the norm of the change.
This way, DeLoRA promises to reduce the risk of catastrophic forgetting
and to be more robust to hyper-parameter settings such as the learning
rate.
2025-10-17 16:24:46 +02:00
1a1f97263d CHORE Replace deprecated torch_dtype with dtype (#2837)
Note: Diffusers is left as is for now, might need an update later.
2025-10-16 14:59:09 +02:00
9b8cf2a0c3 FIX Handle embed scale for trainable tokens, LoRA (#2825)
Resolves #2809

Some models like Gemma3 apply a scalar to the embedding output. It needs
to be taken into account when using trainable tokens or LoRA applied to
the embedding layer.
2025-10-14 12:35:31 +02:00
b0954e0daa FEAT Add WaveFT method (#2560)
Implements the paper "Exploring Sparsity for Parameter Efficient Fine
Tuning Using Wavelets" (https://arxiv.org/abs/2505.12532).

WaveFT enables fine-grained control over the number of trainable
parameters by directly learning a sparse set of coefficients in the
wavelet domain of residual matrices. Experiments show that it works well
in the text-to-image generation space.
2025-10-07 10:58:49 +02:00
f00d94a170 FIX Typo in PiSSA finetune README (#2812) 2025-10-06 11:54:53 +02:00
c15daaa5aa ENH Support XPU in DoRA FT example (#2700) 2025-09-25 17:57:41 +02:00
50329a7138 ENH Support for XPU in LM eval notebook (#2705) 2025-09-23 15:15:48 +02:00
42db980676 Add Arrow + GenKnowSub to LoRA (#2644)
This PR adds support for Arrow, a modular routing mechanism for LoRA experts introduced here, as well as the refinement method GenKnowSub, proposed in our ACL 2025 Main Conference paper. GenKnowSub enhances Arrow by subtracting a general-domain LoRA from task-specific ones prior to routing, leading to improved generalisation and modularity.
2025-09-08 14:21:37 +02:00
293aea5df6 Support for Activated LoRA (#2609)
This PR migrates Activated LoRA (aLoRA) support from a standalone Github (see above) to PEFT itself.

Note there is also an active PR for vLLM inference support for Activated LoRA: vllm-project/vllm#19710 . There are also collections of aLoRA models on huggingface (in the ibm-granite org), note that these preexisting models run off of the standalone github repo and will be updated to work with this new PEFT feature if merged.

Description of changes: Activated LoRA is a modification of the LoRA architecture to "activate" the adapter weights only on tokens coming after a specified invocation_string. This fact makes it so that KV values for the string coming before the activation matches KV values for the base model. This allows KV cache for the input to be interchangeable between the base model and adapter model, and allows for major speedups in inference pipelines (e.g. agentic pipelines) that want to use both base models and adapter models. See the paper for detailed exploration of use cases and further elaboration.

Other notes:

The crux of the changes are really in layer.py. Everything else is simply managing the alora_offsets quantity which defines where the weights start to be activated. This is determined by scanning input strings for the invocation_string defined in the aLoraConfig.
    
I believe that aLoRA really only makes sense for CausalLMs, hence I've only implemented this for that model type.

Merging doesn't make sense for aLoRA adapters since the weights are not universally applied to all tokens.
    
I used the LoRA code as a starting point, but did not implement various seemingly extra features in that code.

As of now, invocation_string should probably start and end with special tokens, to avoid tokenizer issues at the boundary. Open to suggestions on how to make this more general if needed.

---------

Co-authored-by: githubnemo <githubnemo@users.noreply.github.com>
2025-09-03 18:26:50 +02:00
ce5c2044f1 FEAT RoAd: 2D Rotary Adaptation (#2678)
Implements RoAd from https://arxiv.org/pdf/2409.00119

Supports mixed adapter batches.
2025-08-19 15:45:38 +02:00
47961bb547 FIX Dataset download in docs and examples (#2708)
Co-authored-by: Camilo Leonel Amadio <camilo.amadio@microchip.com>
2025-08-12 20:00:06 +02:00
06b54d8a0d ENH Support XPU for SFT training script (#2709)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-11 14:35:05 +02:00
9b420cc9c7 ENH Support XPU for seq clf examples (#2732)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-08 12:07:20 +02:00
e98a59ec2d DOC Make docs more device agnostic (e.g. XPU) (#2728)
Also adjusted some more examples.

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-08 12:06:22 +02:00
7f7463548a ENH Update token clf/NER examples, support XPU (#2727)
Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-08 12:05:38 +02:00
a72bbaabf7 ENH Support XPU for SD dreambooth example (#2726)
Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-08 12:05:05 +02:00
766a9776bb ENH Update bnb 8bit examples, support XPU (#2723)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-08 12:04:29 +02:00
6673609479 ENH Support XPU for image clf example (#2722)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-07 11:33:33 +02:00
52cc71df9f ENH Support XPU for semantic-segmentation example (#2721)
Also fixing a few issues in the example.

---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-07 11:32:26 +02:00
78bf27dd42 ENH Support XPU for RandLoRA example (#2720)
Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-07 11:31:42 +02:00
5ef4362e12 ENH Support XPU for QALoRA example (#2719)
Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-07 11:30:49 +02:00
a7781aa5e0 ENH Support XPU for OFT dreambooth example (#2718)
Also fixing a couple of issues like wrong argument name.

---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-07 11:30:22 +02:00
d7194f869a ENH Support XPU bnb 4bit example (#2714)
---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-06 16:28:56 +02:00
154ef37561 ENH Support XPU for causal LM examples (#2680)
---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-06 16:27:57 +02:00
6a33744cc2 ENH Support XPU for HRA dreambooth example (#2717)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-06 16:27:26 +02:00
db5c00fad2 FIX Poly issue with returned base model (#2702)
Also, add XPU support for Poly example.

---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-06 12:16:49 +02:00
e3d8fc98f1 ENH XPU support for conditional generation examples (#2684)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-06 12:15:28 +02:00
6d531c77a4 FIX Issue with XPU for face alignment example (#2713)
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-06 12:14:30 +02:00
2d49c6798d ENH Support XPU for MLP LoRA example (#2712)
Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-06 12:14:03 +02:00
d6ed90e8e2 ENH Support XPU for multi_adapter examples (#2711)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-06 12:13:31 +02:00
ff12d13be6 FIX Bug in semantic search example (#2706)
Also updated requirements.

---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-05 11:49:00 +02:00
2518ceeb15 FIX Deprecations in MiSS example (#2704)
Also, was validated on XPU.

---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-05 11:46:28 +02:00
ec7dee024f FIX Small issue in PISSA example (#2703)
Also validated it with XPU.

---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-05 11:45:34 +02:00
86feb8c4f9 ENH Support XPU for CPT, EVA, GPU offload (#2694)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-05 11:43:53 +02:00
daee6367aa ENH Support XPU for CorDA example (#2687)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-05 11:41:42 +02:00
207b27ec2c ENH Support XPU for LoRA-FA example (#2697)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-05 11:38:44 +02:00
68265a1583 ENH XPU support for training dreambooth (#2696)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-04 11:42:45 +02:00
be8f824d93 ENH XPU support for dna_language_model example (#2689)
---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-04 11:32:25 +02:00
951e720081 ENH XPU support for boft_dreambooth example (#2679)
---------

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
2025-08-04 11:17:10 +02:00
49b29c1d1a ENH XPU support for boft/controlnet example (#2674)
---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-08-04 11:15:36 +02:00
J.L
bb4fb50e2b FEAT Add MiSS as a replacement for Bone. (#2604)
Add MiSS, an evolution of Bone, from https://arxiv.org/abs/2409.15371.

MiSS will replace Bone, which is now deprecated. A script to convert Bone
checkpoints to MiSS checkpoints is included.
2025-08-01 18:37:20 +02:00
a795199ffa Update tokenizer parameter in sfttrainer across multiple examples (#2664)
* REFAC Update tokenizer parameter to processing_class in SFTTrainer instances across multiple examples

* REFAC Replace tokenizer parameter with processing_class in Trainer instances across documentation and examples

* Refactor tokenizer parameter to processing_class in various examples

- Updated the Trainer initialization in corda_finetuning.py to use processing_class instead of tokenizer.
- Changed the execution_count to null in image_classification_peft_lora.ipynb.
- Modified the tokenizer parameter to processing_class in image_classification_peft_lora.ipynb.
- Adjusted the tokenizer parameter to processing_class in peft_bnb_whisper_large_v2_training.ipynb.
- Updated the README.md in lorafa_finetune to reflect the change from tokenizer to processing_class in Trainer initialization.

* REFAC Update tokenizer parameter to processing_class in Seq2SeqTrainer instantiation

* REFAC Replace tokenizer parameter with processing_class in README and notebook examples
2025-07-23 15:30:28 +02:00
a4f9334f12 FEAT Add SHiRA Adapters (#2584)
Implements: Sparse High Rank Adapters

Paper: https://arxiv.org/abs/2406.13175
2025-07-14 11:16:10 +02:00
b960d259e8 ENH Enable FSDP example for GPTQ quantized model (#2626)
Besides fixes, includes an example script that uses
`hugging-quants/Meta-Llama-3.1-8B-Instruct-GPTQ-INT4`

---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
2025-07-07 11:08:03 +02:00
e6577076bf FEAT Add C3A (Circular Convolution Adaptation) (#2577)
Add new PEFT method C³A (Circular Convolution Adaptation).

From "Parameter-Efficient Fine-Tuning via Circular Convolution":
https://arxiv.org/abs/2407.19342
2025-06-30 14:17:11 +02:00
e34852f7b6 ENH Support Quantization-Aware LoRA with GPTQ (#2571)
Support for Quantization-Aware Low-Rank Adaptation (QALoRA) for GPTQ.
2025-06-26 11:51:38 +02:00
b3130c9edb Use HF Papers (#2542)
Replaced all arxiv.org/pdf links with HF papers.
2025-05-27 13:48:53 +02:00
d5776f605d fix typos (#2544) 2025-05-26 17:35:55 +02:00
6c48949930 Randlora documentation and some example usage (#2524)
This is a follow up to #2464 and issue #2441.

Entails documentation for RandLora and slightly updated example usage in the model.py docstring.

Also adds RandLoRA to method comparison.

---------

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
2025-05-07 14:40:55 +02:00
003cf20bcd FEAT Add LoRA INC support (#2499)
Add LoRA Adds Intel Neural Compressor.

---------

Signed-off-by: Daniel Socek <daniel.socek@intel.com>
2025-04-28 18:39:37 +02:00