-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Channelwise Quantization Tests (#2283)
* WIP * WIP2 * fix for channelwise * set for nightly * more calibration samples * run 15m tests on commit * update config * mark as integration * fixes for tests * cleanup class
- Loading branch information
Sara Adkins
authored
May 28, 2024
1 parent
c5ac841
commit c530bbf
Showing
14 changed files
with
160 additions
and
72 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
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/channelwise_1.1b.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,5 @@ | ||
cadence: "nightly" | ||
test_type: "regression" | ||
model_stub: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_channel.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_channel.yaml" |
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/channelwise_15m.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,5 @@ | ||
cadence: "commit" | ||
test_type: "regression" | ||
model_stub: "Xenova/llama2.c-stories15M" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_channel.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_channel.yaml" |
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/inputs_1.1b.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,5 @@ | ||
cadence: "nightly" | ||
test_type: "regression" | ||
model_stub: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_full.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_full.yaml" |
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/inputs_15m.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,5 @@ | ||
cadence: "commit" | ||
test_type: "regression" | ||
model_stub: "Xenova/llama2.c-stories15M" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_full.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_full.yaml" |
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/weights_only_1.1b.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,5 @@ | ||
cadence: "nightly" | ||
test_type: "regression" | ||
model_stub: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_weight.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_weight.yaml" |
5 changes: 5 additions & 0 deletions
5
tests/sparseml/transformers/compression/configs/weights_only_15m.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,5 @@ | ||
cadence: "commit" | ||
test_type: "regression" | ||
model_stub: "Xenova/llama2.c-stories15M" | ||
old_recipe: "tests/sparseml/transformers/compression/recipes/old_quant_weight.yaml" | ||
new_recipe: "tests/sparseml/transformers/compression/recipes/new_quant_weight.yaml" |
18 changes: 18 additions & 0 deletions
18
tests/sparseml/transformers/compression/recipes/new_quant_channel.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,18 @@ | ||
test_stage: | ||
quant_modifiers: | ||
vLLMQuantizationModifier: | ||
ignore: ["lm_head", "model.layers.0.mlp.down_proj"] | ||
config_groups: | ||
group_0: | ||
weights: | ||
num_bits: 4 | ||
type: "int" | ||
symmetric: False | ||
strategy: "channel" | ||
input_activations: null | ||
output_activations: null | ||
targets: ["Linear"] | ||
GPTQModifier: | ||
block_size: 128 | ||
sequential_update: False | ||
targets: ["model.layers.0", "model.layers.1", "model.layers.2"] |
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
28 changes: 28 additions & 0 deletions
28
tests/sparseml/transformers/compression/recipes/old_quant_channel.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,28 @@ | ||
test_stage: | ||
quant_modifiers: | ||
QuantizationModifier: | ||
ignore: | ||
- model.layers.0.mlp.down_proj | ||
- lm_head | ||
- LlamaRotaryEmbedding | ||
- LlamaRMSNorm | ||
- SiLU | ||
- MatMulLeftInput_QK | ||
- MatMulRightInput_QK | ||
- MatMulOutput_QK | ||
- MatMulLeftInput_PV | ||
- MatMulRightInput_PV | ||
- MatMulOutput_PV | ||
- Embedding | ||
scheme_overrides: | ||
Linear: | ||
weights: | ||
num_bits: 4 | ||
symmetric: false | ||
strategy: "channel" | ||
input_activations: null | ||
output_activations: null | ||
GPTQModifier: | ||
block_size: 128 | ||
sequential_update: False | ||
targets: ["model.layers.0", "model.layers.1", "model.layers.2"] |
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