bartowski commited on
Commit
583f382
·
verified ·
1 Parent(s): 423e36c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +164 -0
README.md ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ quantized_by: bartowski
3
+ pipeline_tag: text-generation
4
+ ---
5
+
6
+ ## Llamacpp imatrix Quantizations of ZR1-1.5B by Zyphra
7
+
8
+ Using <a href="https://github.com/ggerganov/llama.cpp/">llama.cpp</a> release <a href="https://github.com/ggerganov/llama.cpp/releases/tag/b5074">b5074</a> for quantization.
9
+
10
+ Original model: https://huggingface.co/Zyphra/ZR1-1.5B
11
+
12
+ All quants made using imatrix option with dataset from [here](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8)
13
+
14
+ Run them in [LM Studio](https://lmstudio.ai/)
15
+
16
+ Run them directly with [llama.cpp](https://github.com/ggerganov/llama.cpp), or any other llama.cpp based project
17
+
18
+ ## Prompt format
19
+
20
+ ```
21
+ <|begin▁of▁sentence|>{system_prompt}<|User|>{prompt}<|Assistant|><|end▁of▁sentence|><|Assistant|>
22
+ ```
23
+
24
+ ## Download a file (not the whole branch) from below:
25
+
26
+ | Filename | Quant type | File Size | Split | Description |
27
+ | -------- | ---------- | --------- | ----- | ----------- |
28
+ | [ZR1-1.5B-bf16.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-bf16.gguf) | bf16 | 3.56GB | false | Full BF16 weights. |
29
+ | [ZR1-1.5B-Q8_0.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q8_0.gguf) | Q8_0 | 1.89GB | false | Extremely high quality, generally unneeded but max available quant. |
30
+ | [ZR1-1.5B-Q6_K_L.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q6_K_L.gguf) | Q6_K_L | 1.58GB | false | Uses Q8_0 for embed and output weights. Very high quality, near perfect, *recommended*. |
31
+ | [ZR1-1.5B-Q6_K.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q6_K.gguf) | Q6_K | 1.46GB | false | Very high quality, near perfect, *recommended*. |
32
+ | [ZR1-1.5B-Q5_K_L.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q5_K_L.gguf) | Q5_K_L | 1.43GB | false | Uses Q8_0 for embed and output weights. High quality, *recommended*. |
33
+ | [ZR1-1.5B-Q5_K_M.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q5_K_M.gguf) | Q5_K_M | 1.29GB | false | High quality, *recommended*. |
34
+ | [ZR1-1.5B-Q4_K_L.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q4_K_L.gguf) | Q4_K_L | 1.29GB | false | Uses Q8_0 for embed and output weights. Good quality, *recommended*. |
35
+ | [ZR1-1.5B-Q5_K_S.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q5_K_S.gguf) | Q5_K_S | 1.26GB | false | High quality, *recommended*. |
36
+ | [ZR1-1.5B-Q3_K_XL.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q3_K_XL.gguf) | Q3_K_XL | 1.18GB | false | Uses Q8_0 for embed and output weights. Lower quality but usable, good for low RAM availability. |
37
+ | [ZR1-1.5B-Q4_1.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q4_1.gguf) | Q4_1 | 1.16GB | false | Legacy format, similar performance to Q4_K_S but with improved tokens/watt on Apple silicon. |
38
+ | [ZR1-1.5B-Q4_K_M.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q4_K_M.gguf) | Q4_K_M | 1.12GB | false | Good quality, default size for most use cases, *recommended*. |
39
+ | [ZR1-1.5B-Q4_K_S.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q4_K_S.gguf) | Q4_K_S | 1.07GB | false | Slightly lower quality with more space savings, *recommended*. |
40
+ | [ZR1-1.5B-Q4_0.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q4_0.gguf) | Q4_0 | 1.07GB | false | Legacy format, offers online repacking for ARM and AVX CPU inference. |
41
+ | [ZR1-1.5B-IQ4_NL.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ4_NL.gguf) | IQ4_NL | 1.07GB | false | Similar to IQ4_XS, but slightly larger. Offers online repacking for ARM CPU inference. |
42
+ | [ZR1-1.5B-IQ4_XS.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ4_XS.gguf) | IQ4_XS | 1.02GB | false | Decent quality, smaller than Q4_K_S with similar performance, *recommended*. |
43
+ | [ZR1-1.5B-Q3_K_L.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q3_K_L.gguf) | Q3_K_L | 0.98GB | false | Lower quality but usable, good for low RAM availability. |
44
+ | [ZR1-1.5B-Q2_K_L.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q2_K_L.gguf) | Q2_K_L | 0.98GB | false | Uses Q8_0 for embed and output weights. Very low quality but surprisingly usable. |
45
+ | [ZR1-1.5B-Q3_K_M.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q3_K_M.gguf) | Q3_K_M | 0.92GB | false | Low quality. |
46
+ | [ZR1-1.5B-IQ3_M.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ3_M.gguf) | IQ3_M | 0.88GB | false | Medium-low quality, new method with decent performance comparable to Q3_K_M. |
47
+ | [ZR1-1.5B-Q3_K_S.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q3_K_S.gguf) | Q3_K_S | 0.86GB | false | Low quality, not recommended. |
48
+ | [ZR1-1.5B-IQ3_XS.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ3_XS.gguf) | IQ3_XS | 0.83GB | false | Lower quality, new method with decent performance, slightly better than Q3_K_S. |
49
+ | [ZR1-1.5B-IQ3_XXS.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ3_XXS.gguf) | IQ3_XXS | 0.77GB | false | Lower quality, new method with decent performance, comparable to Q3 quants. |
50
+ | [ZR1-1.5B-Q2_K.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-Q2_K.gguf) | Q2_K | 0.75GB | false | Very low quality but surprisingly usable. |
51
+ | [ZR1-1.5B-IQ2_M.gguf](https://huggingface.co/bartowski/Zyphra_ZR1-1.5B-GGUF/blob/main/Zyphra_ZR1-1.5B-IQ2_M.gguf) | IQ2_M | 0.70GB | false | Relatively low quality, uses SOTA techniques to be surprisingly usable. |
52
+
53
+ ## Embed/output weights
54
+
55
+ Some of these quants (Q3_K_XL, Q4_K_L etc) are the standard quantization method with the embeddings and output weights quantized to Q8_0 instead of what they would normally default to.
56
+
57
+ ## Downloading using huggingface-cli
58
+
59
+ <details>
60
+ <summary>Click to view download instructions</summary>
61
+
62
+ First, make sure you have hugginface-cli installed:
63
+
64
+ ```
65
+ pip install -U "huggingface_hub[cli]"
66
+ ```
67
+
68
+ Then, you can target the specific file you want:
69
+
70
+ ```
71
+ huggingface-cli download bartowski/Zyphra_ZR1-1.5B-GGUF --include "Zyphra_ZR1-1.5B-Q4_K_M.gguf" --local-dir ./
72
+ ```
73
+
74
+ If the model is bigger than 50GB, it will have been split into multiple files. In order to download them all to a local folder, run:
75
+
76
+ ```
77
+ huggingface-cli download bartowski/Zyphra_ZR1-1.5B-GGUF --include "Zyphra_ZR1-1.5B-Q8_0/*" --local-dir ./
78
+ ```
79
+
80
+ You can either specify a new local-dir (Zyphra_ZR1-1.5B-Q8_0) or download them all in place (./)
81
+
82
+ </details>
83
+
84
+ ## ARM/AVX information
85
+
86
+ Previously, you would download Q4_0_4_4/4_8/8_8, and these would have their weights interleaved in memory in order to improve performance on ARM and AVX machines by loading up more data in one pass.
87
+
88
+ Now, however, there is something called "online repacking" for weights. details in [this PR](https://github.com/ggerganov/llama.cpp/pull/9921). If you use Q4_0 and your hardware would benefit from repacking weights, it will do it automatically on the fly.
89
+
90
+ As of llama.cpp build [b4282](https://github.com/ggerganov/llama.cpp/releases/tag/b4282) you will not be able to run the Q4_0_X_X files and will instead need to use Q4_0.
91
+
92
+ Additionally, if you want to get slightly better quality for , you can use IQ4_NL thanks to [this PR](https://github.com/ggerganov/llama.cpp/pull/10541) which will also repack the weights for ARM, though only the 4_4 for now. The loading time may be slower but it will result in an overall speed incrase.
93
+
94
+ <details>
95
+ <summary>Click to view Q4_0_X_X information (deprecated</summary>
96
+
97
+ I'm keeping this section to show the potential theoretical uplift in performance from using the Q4_0 with online repacking.
98
+
99
+ <details>
100
+ <summary>Click to view benchmarks on an AVX2 system (EPYC7702)</summary>
101
+
102
+ | model | size | params | backend | threads | test | t/s | % (vs Q4_0) |
103
+ | ------------------------------ | ---------: | ---------: | ---------- | ------: | ------------: | -------------------: |-------------: |
104
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp512 | 204.03 ± 1.03 | 100% |
105
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp1024 | 282.92 ± 0.19 | 100% |
106
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp2048 | 259.49 ± 0.44 | 100% |
107
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg128 | 39.12 ± 0.27 | 100% |
108
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg256 | 39.31 ± 0.69 | 100% |
109
+ | qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg512 | 40.52 ± 0.03 | 100% |
110
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp512 | 301.02 ± 1.74 | 147% |
111
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp1024 | 287.23 ± 0.20 | 101% |
112
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp2048 | 262.77 ± 1.81 | 101% |
113
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg128 | 18.80 ± 0.99 | 48% |
114
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg256 | 24.46 ± 3.04 | 83% |
115
+ | qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg512 | 36.32 ± 3.59 | 90% |
116
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp512 | 271.71 ± 3.53 | 133% |
117
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp1024 | 279.86 ± 45.63 | 100% |
118
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp2048 | 320.77 ± 5.00 | 124% |
119
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg128 | 43.51 ± 0.05 | 111% |
120
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg256 | 43.35 ± 0.09 | 110% |
121
+ | qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg512 | 42.60 ± 0.31 | 105% |
122
+
123
+ Q4_0_8_8 offers a nice bump to prompt processing and a small bump to text generation
124
+
125
+ </details>
126
+
127
+ </details>
128
+
129
+ ## Which file should I choose?
130
+
131
+ <details>
132
+ <summary>Click here for details</summary>
133
+
134
+ A great write up with charts showing various performances is provided by Artefact2 [here](https://gist.github.com/Artefact2/b5f810600771265fc1e39442288e8ec9)
135
+
136
+ The first thing to figure out is how big a model you can run. To do this, you'll need to figure out how much RAM and/or VRAM you have.
137
+
138
+ If you want your model running as FAST as possible, you'll want to fit the whole thing on your GPU's VRAM. Aim for a quant with a file size 1-2GB smaller than your GPU's total VRAM.
139
+
140
+ If you want the absolute maximum quality, add both your system RAM and your GPU's VRAM together, then similarly grab a quant with a file size 1-2GB Smaller than that total.
141
+
142
+ Next, you'll need to decide if you want to use an 'I-quant' or a 'K-quant'.
143
+
144
+ If you don't want to think too much, grab one of the K-quants. These are in format 'QX_K_X', like Q5_K_M.
145
+
146
+ If you want to get more into the weeds, you can check out this extremely useful feature chart:
147
+
148
+ [llama.cpp feature matrix](https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix)
149
+
150
+ But basically, if you're aiming for below Q4, and you're running cuBLAS (Nvidia) or rocBLAS (AMD), you should look towards the I-quants. These are in format IQX_X, like IQ3_M. These are newer and offer better performance for their size.
151
+
152
+ These I-quants can also be used on CPU, but will be slower than their K-quant equivalent, so speed vs performance is a tradeoff you'll have to decide.
153
+
154
+ </details>
155
+
156
+ ## Credits
157
+
158
+ Thank you kalomaze and Dampf for assistance in creating the imatrix calibration dataset.
159
+
160
+ Thank you ZeroWw for the inspiration to experiment with embed/output.
161
+
162
+ Thank you to LM Studio for sponsoring my work.
163
+
164
+ Want to support my work? Visit my ko-fi page here: https://ko-fi.com/bartowski