-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
- Loading branch information
Showing
8 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,3 +394,10 @@ def apply_lora_o(self, X): | |
O = LoRA_W.apply(X, OW, OW_quant, OA, OB, OS) | ||
return O | ||
pass | ||
|
||
# added by [email protected] | ||
# this will be patchable on the actual module | ||
def apply_lora_o_v2(self, X): | ||
OW, OW_quant, OA, OB, OS = get_lora_parameters(self) | ||
O = LoRA_W.apply(X, OW, OW_quant, OA, OB, OS) | ||
return O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
sample-configurations/accelerated-peft-bnb-nf4-foak-sample-configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# FMS Acceleration Plugin Configuration. | ||
# | ||
# Each stanza incorporates various configurations for | ||
# different fine-tuning / training tasks. | ||
plugins: | ||
# PEFT-related acceleration | ||
peft: | ||
|
||
# quantization-releated acceleration | ||
# e.g., kernels for quantized base weights | ||
quantization: | ||
|
||
# For loading BitsAndBytes quantized layers | ||
# to serve as 4bit base-weights for LoRA PEFT-tuning. | ||
# NOTE: currently AutoGPTQ is not properly integrated into huggingface / | ||
# bitsandbytes, thus recommended quant_type to be either "nf4" | ||
# or "fp4". | ||
# bitsandbytes: | ||
bitsandbytes: | ||
quant_type: nf4 | ||
|
||
# If True, then no get_peft_model and prepare_model_for_kbit_training | ||
# will be called. | ||
no_peft_model: false | ||
fused_ops_and_kernels: | ||
|
||
# load unsloth optimizations for these 4bit base layer weights. | ||
# currently only support "auto_gptq" and "bitsandbytes" | ||
base_layer: bitsandbytes | ||
|
||
# activate various unsloth optimizations | ||
# NOTE: currently supports only all-or-nothing. | ||
|
||
# fused kernels for lora linear layers | ||
fused_lora: true | ||
|
||
# fast loss triton kernels | ||
fast_loss: true | ||
|
||
# fast rms norm triton kernels | ||
fast_rsm_layernorm: true | ||
|
||
# fast RoPE embedding triton kernels | ||
fast_rope_embeddings: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters