-
Notifications
You must be signed in to change notification settings - Fork 12k
quantize: improve pattern matching for allowed tensors #13033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6c281ad
Move struct declaration to header and update allowed tensor list
EAddario 3e031bc
Improve regex matching whilst still validating allowed tensors
EAddario 6c13fcb
Minor cosmetic change to log output
EAddario 16923b8
Merge branch 'master' into quantize
EAddario d54a423
Merge branch 'master' into quantize
EAddario d69391e
Add header search path
EAddario 70daa41
Merge branch 'master' into quantize
EAddario 61bb6e2
Remove allowed tensor checks
EAddario 184ef70
Remove unneeded include directory
EAddario File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 +1,66 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "ggml.h" | ||
|
||
// Allowed tensors for arbitrary quantization with --tensor-type option | ||
static const std::vector<std::string> ALLOWED_TENSOR_TYPE = { | ||
"attn_k", | ||
"attn_k_b", | ||
"attn_kv_a_mqa", | ||
"attn_kv_b", | ||
"attn_o", | ||
"attn_output", | ||
"attn_q", | ||
"attn_q_a", | ||
"attn_q_b", | ||
"attn_qkv", | ||
"attn_rel_b", | ||
"attn_v", | ||
"attn_v_b", | ||
"channel_mix_key", | ||
"channel_mix_receptance", | ||
"channel_mix_value", | ||
"cls", | ||
"cls.output", | ||
"conv1", | ||
"conv1d", | ||
"conv2", | ||
"cross_attn_k", | ||
"cross_attn_o", | ||
"cross_attn_q", | ||
"cross_attn_rel_b", | ||
"cross_attn_v", | ||
"dw", | ||
"ffn_down", | ||
"ffn_down_exps", | ||
"ffn_down_shexp", | ||
"ffn_gate", | ||
"ffn_gate_exps", | ||
"ffn_gate_shexp", | ||
"ffn_up", | ||
"ffn_up_exps", | ||
"ffn_up_shexp", | ||
"pw1", | ||
"pw1", | ||
"ssm_a", | ||
"ssm_conv1d", | ||
"ssm_dt", | ||
"ssm_in", | ||
"ssm_out", | ||
"ssm_x", | ||
"time_mix_gate", | ||
"time_mix_key", | ||
"time_mix_output", | ||
"time_mix_receptance", | ||
"time_mix_value", | ||
"token_types" | ||
}; | ||
|
||
// Quantization types | ||
struct tensor_quantization { | ||
std::string name; | ||
ggml_type quant = GGML_TYPE_COUNT; | ||
}; |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.