diff options
author | Iwan Kawrakow <iwan.kawrakow@gmail.com> | 2024-06-17 18:41:30 +0300 |
---|---|---|
committer | Iwan Kawrakow <iwan.kawrakow@gmail.com> | 2024-06-22 12:02:51 +0300 |
commit | f6863cfa1bbc5ac42b78837b355e45d82246a472 (patch) | |
tree | b4718a3e7f7796f2bd5f8f4e6f81a812eeadae32 /examples/quantize-stats/quantize-stats.cpp | |
parent | 765622ff8f921319f6b30c556b378d8320500c95 (diff) |
bitnet: add 2 bpw quantization
The scalar dot product already chieves 37 t/s for TG!
Diffstat (limited to 'examples/quantize-stats/quantize-stats.cpp')
-rw-r--r-- | examples/quantize-stats/quantize-stats.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/quantize-stats/quantize-stats.cpp b/examples/quantize-stats/quantize-stats.cpp index 746df844..4eb8f953 100644 --- a/examples/quantize-stats/quantize-stats.cpp +++ b/examples/quantize-stats/quantize-stats.cpp @@ -341,6 +341,10 @@ int main(int argc, char ** argv) { if (!layer_included(params, kv_tensor.first)) { continue; } + if (kv_tensor.second->ne[0] == 1 || kv_tensor.second->ne[1] == 1) { + // we never quantize those + continue; + } if (params.verbose) { printf("%s: type %s, size %" PRId64 "\n", kv_tensor.first.c_str(), ggml_type_name(kv_tensor.second->type), ggml_nelements(kv_tensor.second)); } @@ -386,6 +390,10 @@ int main(int argc, char ** argv) { if (!layer_included(params, kv_tensor.first)) { continue; } + if (kv_tensor.second->ne[0] == 1 || kv_tensor.second->ne[1] == 1) { + // we never quantize those + continue; + } if (params.verbose) { printf(" %s ...\n", kv_tensor.first.c_str()); } |