-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
306 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This algorithm merges a pretrained model with a finetuned model. | ||
# | ||
# $$\theta_{merged} = \theta_{ft} + \alpha (\theta_{ft} - \theta_{pre})$$ | ||
# | ||
# where $\theta_{merged}$ is the merged model, $\theta_{ft}$ is the finetuned model (medium-aligned model), | ||
# $\theta_{pre}$ is the pretrained model (base model), and $\alpha$ is the extrapolation factor. | ||
_target_: fusion_bench.method.ExPOAlgorithmForLlama | ||
extrapolation_factor: 0.1 | ||
attention_scaling_factor: 1.0 | ||
|
||
only_on_backbone: true | ||
on_linear_weights: true | ||
on_linear_bias: false | ||
on_embedding: false | ||
|
||
fix_last_n_layers: 0 | ||
fix_first_n_layers: 0 | ||
|
||
magnitude_sparsity_ratio: null |
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,19 @@ | ||
_target_: fusion_bench.method.linear.llama_expo.ExPOWithDareForLLama | ||
|
||
extrapolation_factor: 0.1 | ||
attention_scaling_factor: 1.0 | ||
|
||
only_on_backbone: true | ||
on_linear_weights: true | ||
on_linear_bias: false | ||
on_embedding: false | ||
|
||
fix_last_n_layers: 0 | ||
fix_first_n_layers: 0 | ||
|
||
magnitude_sparsity_ratio: null | ||
|
||
# dare arguments | ||
dare_sparsity_ratio: 0.5 | ||
dare_only_on_linear_weights: true | ||
dare_rescale: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_target_: fusion_bench.method.MagnitudeDiffPruningAlgorithm | ||
prune_ratio: 0.5 | ||
rescale: false | ||
extract_names: null |
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# flake8: noqa F401 | ||
from .expo import ExPOAlgorithm | ||
from .linear_interpolation import LinearInterpolationAlgorithm | ||
from .llama_expo import ExPOAlgorithmForLlama | ||
from .simple_average_for_llama import SimpleAverageForLlama | ||
from .task_arithmetic_for_llama import TaskArithmeticForLlama | ||
from .expo import ExPOAlgorithm |
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
Oops, something went wrong.