Mungert commited on
Commit
a5b55ac
·
verified ·
0 Parent(s):

Super-squash history to reclaim storage

Browse files
.gitattributes ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ granite-3.1-8b-instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text
37
+ granite-3.1-8b-instruct-f16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
38
+ granite-3.1-8b-instruct-bf16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
39
+ granite-3.1-8b-instruct-f16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
40
+ granite-3.1-8b-instruct-bf16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
41
+ granite-3.1-8b-instruct-f16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
42
+ granite-3.1-8b-instruct-bf16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
43
+ granite-3.1-8b-instruct-q2_k_l.gguf filter=lfs diff=lfs merge=lfs -text
44
+ granite-3.1-8b-instruct-q3_k_l.gguf filter=lfs diff=lfs merge=lfs -text
45
+ granite-3.1-8b-instruct-q4_k_l.gguf filter=lfs diff=lfs merge=lfs -text
46
+ granite-3.1-8b-instruct-q5_k_l.gguf filter=lfs diff=lfs merge=lfs -text
47
+ granite-3.1-8b-instruct-q6_k_l.gguf filter=lfs diff=lfs merge=lfs -text
48
+ granite-3.1-8b-instruct-q2_k_m.gguf filter=lfs diff=lfs merge=lfs -text
49
+ granite-3.1-8b-instruct-q2_k_s.gguf filter=lfs diff=lfs merge=lfs -text
50
+ granite-3.1-8b-instruct-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
51
+ granite-3.1-8b-instruct-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
52
+ granite-3.1-8b-instruct-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
53
+ granite-3.1-8b-instruct-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
54
+ granite-3.1-8b-instruct-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
55
+ granite-3.1-8b-instruct-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
56
+ granite-3.1-8b-instruct-q6_k_m.gguf filter=lfs diff=lfs merge=lfs -text
57
+ granite-3.1-8b-instruct-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
58
+ granite-3.1-8b-instruct-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
59
+ granite-3.1-8b-instruct-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
60
+ granite-3.1-8b-instruct-q4_0_l.gguf filter=lfs diff=lfs merge=lfs -text
61
+ granite-3.1-8b-instruct-q4_1_l.gguf filter=lfs diff=lfs merge=lfs -text
62
+ granite-3.1-8b-instruct-q5_0.gguf filter=lfs diff=lfs merge=lfs -text
63
+ granite-3.1-8b-instruct-q5_1.gguf filter=lfs diff=lfs merge=lfs -text
64
+ granite-3.1-8b-instruct-q5_0_l.gguf filter=lfs diff=lfs merge=lfs -text
65
+ granite-3.1-8b-instruct-q5_1_l.gguf filter=lfs diff=lfs merge=lfs -text
66
+ granite-3.1-8b-instruct-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
67
+ granite-3.1-8b-instruct-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
68
+ granite-3.1-8b-instruct-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
69
+ granite-3.1-8b-instruct-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
70
+ granite-3.1-8b-instruct-iq3_xs.gguf filter=lfs diff=lfs merge=lfs -text
71
+ granite-3.1-8b-instruct-iq3_xxs.gguf filter=lfs diff=lfs merge=lfs -text
72
+ granite-3.1-8b-instruct-iq3_s.gguf filter=lfs diff=lfs merge=lfs -text
73
+ granite-3.1-8b-instruct-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text
74
+ granite-3.1-8b-instruct-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
75
+ granite-3.1-8b-instruct-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
76
+ granite-3.1-8b-instruct.imatrix filter=lfs diff=lfs merge=lfs -text
77
+ granite-3.1-8b-instruct-bf16.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ inference: false
4
+ license: apache-2.0
5
+ library_name: transformers
6
+ tags:
7
+ - language
8
+ - granite-3.1
9
+ base_model:
10
+ - ibm-granite/granite-3.1-8b-base
11
+ new_version: ibm-granite/granite-3.3-8b-instruct
12
+ ---
13
+
14
+ # <span style="color: #7FFF7F;">granite-3.1-8b-instruct GGUF Models</span>
15
+
16
+
17
+ ## <span style="color: #7F7FFF;">Model Generation Details</span>
18
+
19
+ This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`0a5a3b5c`](https://github.com/ggerganov/llama.cpp/commit/0a5a3b5cdfd887cf0f8e09d9ff89dee130cfcdde).
20
+
21
+
22
+
23
+
24
+
25
+ ---
26
+
27
+ ## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
28
+
29
+ I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
30
+
31
+ In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
32
+ 👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
33
+
34
+ While this does increase model file size, it significantly improves precision for a given quantization level.
35
+
36
+ ### **I'd love your feedback—have you tried this? How does it perform for you?**
37
+
38
+
39
+
40
+
41
+ ---
42
+
43
+ <a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
44
+ Click here to get info on choosing the right GGUF model format
45
+ </a>
46
+
47
+ ---
48
+
49
+
50
+
51
+ <!--Begin Original Model Card-->
52
+
53
+
54
+ # Granite-3.1-8B-Instruct
55
+
56
+ **Model Summary:**
57
+ Granite-3.1-8B-Instruct is a 8B parameter long-context instruct model finetuned from Granite-3.1-8B-Base using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets tailored for solving long context problems. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging.
58
+
59
+ - **Developers:** Granite Team, IBM
60
+ - **GitHub Repository:** [ibm-granite/granite-3.1-language-models](https://github.com/ibm-granite/granite-3.1-language-models)
61
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
62
+ - **Paper:** [Granite 3.1 Language Models (coming soon)](https://huggingface.co/collections/ibm-granite/granite-31-language-models-6751dbbf2f3389bec5c6f02d)
63
+ - **Release Date**: December 18th, 2024
64
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
65
+
66
+ **Supported Languages:**
67
+ English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.1 models for languages beyond these 12 languages.
68
+
69
+ **Intended Use:**
70
+ The model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications.
71
+
72
+ *Capabilities*
73
+ * Summarization
74
+ * Text classification
75
+ * Text extraction
76
+ * Question-answering
77
+ * Retrieval Augmented Generation (RAG)
78
+ * Code related tasks
79
+ * Function-calling tasks
80
+ * Multilingual dialog use cases
81
+ * Long-context tasks including long document/meeting summarization, long document QA, etc.
82
+
83
+ **Generation:**
84
+ This is a simple example of how to use Granite-3.1-8B-Instruct model.
85
+
86
+ Install the following libraries:
87
+
88
+ ```shell
89
+ pip install torch torchvision torchaudio
90
+ pip install accelerate
91
+ pip install transformers
92
+ ```
93
+ Then, copy the snippet from the section that is relevant for your use case.
94
+
95
+ ```python
96
+ import torch
97
+ from transformers import AutoModelForCausalLM, AutoTokenizer
98
+
99
+ device = "auto"
100
+ model_path = "ibm-granite/granite-3.1-8b-instruct"
101
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
102
+ # drop device_map if running on CPU
103
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
104
+ model.eval()
105
+ # change input text as desired
106
+ chat = [
107
+ { "role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location." },
108
+ ]
109
+ chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
110
+ # tokenize the text
111
+ input_tokens = tokenizer(chat, return_tensors="pt").to(device)
112
+ # generate output tokens
113
+ output = model.generate(**input_tokens,
114
+ max_new_tokens=100)
115
+ # decode output tokens into text
116
+ output = tokenizer.batch_decode(output)
117
+ # print output
118
+ print(output)
119
+ ```
120
+ **Evaluation Results:**
121
+ <table>
122
+ <caption><b>HuggingFace Open LLM Leaderboard V1</b></caption>
123
+ <thead>
124
+ <tr>
125
+ <th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
126
+ <th style="text-align:center; background-color: #001d6c; color: white;">ARC-Challenge</th>
127
+ <th style="text-align:center; background-color: #001d6c; color: white;">Hellaswag</th>
128
+ <th style="text-align:center; background-color: #001d6c; color: white;">MMLU</th>
129
+ <th style="text-align:center; background-color: #001d6c; color: white;">TruthfulQA</th>
130
+ <th style="text-align:center; background-color: #001d6c; color: white;">Winogrande</th>
131
+ <th style="text-align:center; background-color: #001d6c; color: white;">GSM8K</th>
132
+ <th style="text-align:center; background-color: #001d6c; color: white;">Avg</th>
133
+ </tr></thead>
134
+ <tbody>
135
+ <tr>
136
+ <td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-8B-Instruct</td>
137
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">62.62</td>
138
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">84.48</td>
139
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">65.34</td>
140
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">66.23</td>
141
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">75.37</td>
142
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">73.84</td>
143
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">71.31</td>
144
+ </tr>
145
+ <tr>
146
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-2B-Instruct</td>
147
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">54.61</td>
148
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">75.14</td>
149
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">55.31</td>
150
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">59.42</td>
151
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.48</td>
152
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">52.76</td>
153
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">60.79</td>
154
+ </tr>
155
+ <tr>
156
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-3B-A800M-Instruct</td>
157
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">50.42</td>
158
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">73.01</td>
159
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">52.19</td>
160
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">49.71</td>
161
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">64.87</td>
162
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">48.97</td>
163
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">56.53</td>
164
+ </tr>
165
+ <tr>
166
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-1B-A400M-Instruct</td>
167
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">42.66</td>
168
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">65.97</td>
169
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">26.13</td>
170
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">46.77</td>
171
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">62.35</td>
172
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">33.88</td>
173
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">46.29</td>
174
+ </tr>
175
+ </tbody></table>
176
+
177
+ <table>
178
+ <caption><b>HuggingFace Open LLM Leaderboard V2</b></caption>
179
+ <thead>
180
+ <tr>
181
+ <th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
182
+ <th style="text-align:center; background-color: #001d6c; color: white;">IFEval</th>
183
+ <th style="text-align:center; background-color: #001d6c; color: white;">BBH</th>
184
+ <th style="text-align:center; background-color: #001d6c; color: white;">MATH Lvl 5</th>
185
+ <th style="text-align:center; background-color: #001d6c; color: white;">GPQA</th>
186
+ <th style="text-align:center; background-color: #001d6c; color: white;">MUSR</th>
187
+ <th style="text-align:center; background-color: #001d6c; color: white;">MMLU-Pro</th>
188
+ <th style="text-align:center; background-color: #001d6c; color: white;">Avg</th>
189
+ </tr></thead>
190
+ <tbody>
191
+ <tr>
192
+ <td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-8B-Instruct</td>
193
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">72.08</td>
194
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">34.09</td>
195
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">21.68</td>
196
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8.28</td>
197
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">19.01</td>
198
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">28.19</td>
199
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">30.55</td>
200
+ </tr>
201
+ <tr>
202
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-2B-Instruct</td>
203
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">62.86</td>
204
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">21.82</td>
205
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">11.33</td>
206
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">5.26</td>
207
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">4.87</td>
208
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">20.21</td>
209
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">21.06</td>
210
+ </tr>
211
+ <tr>
212
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-3B-A800M-Instruct</td>
213
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">55.16</td>
214
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">16.69</td>
215
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">10.35</td>
216
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">5.15</td>
217
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">2.51</td>
218
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">12.75</td>
219
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">17.1</td>
220
+ </tr>
221
+ <tr>
222
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-1B-A400M-Instruct</td>
223
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">46.86</td>
224
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">6.18</td>
225
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">4.08</td>
226
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">0</td>
227
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">0.78</td>
228
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">2.41</td>
229
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">10.05</td>
230
+ </tr>
231
+ </tbody></table>
232
+
233
+ **Model Architecture:**
234
+ Granite-3.1-8B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.
235
+
236
+ <table>
237
+ <thead>
238
+ <tr>
239
+ <th style="text-align:left; background-color: #001d6c; color: white;">Model</th>
240
+ <th style="text-align:center; background-color: #001d6c; color: white;">2B Dense</th>
241
+ <th style="text-align:center; background-color: #001d6c; color: white;">8B Dense</th>
242
+ <th style="text-align:center; background-color: #001d6c; color: white;">1B MoE</th>
243
+ <th style="text-align:center; background-color: #001d6c; color: white;">3B MoE</th>
244
+ </tr></thead>
245
+ <tbody>
246
+ <tr>
247
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Embedding size</td>
248
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">2048</td>
249
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">4096</td>
250
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">1024</td>
251
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">1536</td>
252
+ </tr>
253
+ <tr>
254
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of layers</td>
255
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">40</td>
256
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">40</td>
257
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">24</td>
258
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">32</td>
259
+ </tr>
260
+ <tr>
261
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Attention head size</td>
262
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">64</td>
263
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">128</td>
264
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">64</td>
265
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">64</td>
266
+ </tr>
267
+ <tr>
268
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of attention heads</td>
269
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">32</td>
270
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">32</td>
271
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">16</td>
272
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">24</td>
273
+ </tr>
274
+ <tr>
275
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of KV heads</td>
276
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
277
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8</td>
278
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
279
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
280
+ </tr>
281
+ <tr>
282
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">MLP hidden size</td>
283
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8192</td>
284
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">12800</td>
285
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">512</td>
286
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">512</td>
287
+ </tr>
288
+ <tr>
289
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">MLP activation</td>
290
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">SwiGLU</td>
291
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">SwiGLU</td>
292
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">SwiGLU</td>
293
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">SwiGLU</td>
294
+ </tr>
295
+ <tr>
296
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of experts</td>
297
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">—</td>
298
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">—</td>
299
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">32</td>
300
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">40</td>
301
+ </tr>
302
+ <tr>
303
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">MoE TopK</td>
304
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">—</td>
305
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">—</td>
306
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
307
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
308
+ </tr>
309
+ <tr>
310
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Initialization std</td>
311
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">0.1</td>
312
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">0.1</td>
313
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">0.1</td>
314
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">0.1</td>
315
+ </tr>
316
+ <tr>
317
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Sequence length</td>
318
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">128K</td>
319
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">128K</td>
320
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">128K</td>
321
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">128K</td>
322
+ </tr>
323
+ <tr>
324
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Position embedding</td>
325
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">RoPE</td>
326
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">RoPE</td>
327
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">RoPE</td>
328
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">RoPE</td>
329
+ </tr>
330
+ <tr>
331
+ <td style="text-align:left; background-color: #FFFFFF; color: black;"># Parameters</td>
332
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">2.5B</td>
333
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8.1B</td>
334
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">1.3B</td>
335
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">3.3B</td>
336
+ </tr>
337
+ <tr>
338
+ <td style="text-align:left; background-color: #FFFFFF; color: black;"># Active parameters</td>
339
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">2.5B</td>
340
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8.1B</td>
341
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">400M</td>
342
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">800M</td>
343
+ </tr>
344
+ <tr>
345
+ <td style="text-align:left; background-color: #FFFFFF; color: black;"># Training tokens</td>
346
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">12T</td>
347
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">12T</td>
348
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">10T</td>
349
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">10T</td>
350
+ </tr>
351
+ </tbody></table>
352
+
353
+ **Training Data:**
354
+ Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities including long-context tasks, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the [Granite 3.0 Technical Report](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf), [Granite 3.1 Technical Report (coming soon)](https://huggingface.co/collections/ibm-granite/granite-31-language-models-6751dbbf2f3389bec5c6f02d), and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf).
355
+
356
+ **Infrastructure:**
357
+ We train Granite 3.1 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs.
358
+
359
+ **Ethical Considerations and Limitations:**
360
+ Granite 3.1 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.
361
+
362
+ **Resources**
363
+ - ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
364
+ - 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/
365
+ - 💡 Learn about the latest Granite learning resources: https://ibm.biz/granite-learning-resources
366
+
367
+ <!-- ## Citation
368
+ ```
369
+ @misc{granite-models,
370
+ author = {author 1, author2, ...},
371
+ title = {},
372
+ journal = {},
373
+ volume = {},
374
+ year = {2024},
375
+ url = {https://arxiv.org/abs/0000.00000},
376
+ }
377
+ ``` -->
378
+
379
+ <!--End Original Model Card-->
380
+
381
+ ---
382
+
383
+ # <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
384
+
385
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
386
+
387
+ 👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
388
+
389
+
390
+ The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
391
+
392
+ 💬 **How to test**:
393
+ Choose an **AI assistant type**:
394
+ - `TurboLLM` (GPT-4.1-mini)
395
+ - `HugLLM` (Hugginface Open-source models)
396
+ - `TestLLM` (Experimental CPU-only)
397
+
398
+ ### **What I’m Testing**
399
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
400
+ - **Function calling** against live network services
401
+ - **How small can a model go** while still handling:
402
+ - Automated **Nmap security scans**
403
+ - **Quantum-readiness checks**
404
+ - **Network Monitoring tasks**
405
+
406
+ 🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
407
+ - ✅ **Zero-configuration setup**
408
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
409
+ - 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
410
+
411
+ ### **Other Assistants**
412
+ 🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
413
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
414
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
415
+ - **Real-time network diagnostics and monitoring**
416
+ - **Security Audits**
417
+ - **Penetration testing** (Nmap/Metasploit)
418
+
419
+ 🔵 **HugLLM** – Latest Open-source models:
420
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
421
+
422
+ ### 💡 **Example commands you could test**:
423
+ 1. `"Give me info on my websites SSL certificate"`
424
+ 2. `"Check if my server is using quantum safe encyption for communication"`
425
+ 3. `"Run a comprehensive security audit on my server"`
426
+ 4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
427
+
428
+ ### Final Word
429
+
430
+ I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
431
+
432
+ If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
433
+
434
+ I'm also open to job opportunities or sponsorship.
435
+
436
+ Thank you! 😊
granite-3.1-8b-instruct-bf16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f143b8f8662c79a2f68295396c39c4f5a3951c3224e104a1de542c248ee9d12
3
+ size 16344105792
granite-3.1-8b-instruct-bf16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9bb4fb5deffe7a9d5eb94c1b6e2e4d3b836c037c2970e34f8b04053b978c1cf9
3
+ size 11625513792
granite-3.1-8b-instruct-f16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a35857386428a8dfe6bee10419ef87e9044a8b52303aee169edc5a244024d20b
3
+ size 11625513792
granite-3.1-8b-instruct-iq2_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3b30bb0337f3f95e85fd228307c895e82ca694acab08873b37ebdb967938fe6
3
+ size 2935293280
granite-3.1-8b-instruct-iq2_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8048f7695d4cbcccc6dd48909ad34f53ac6a23ec2690b7608e1dbbcb7b6afd9b
3
+ size 2801076320
granite-3.1-8b-instruct-iq2_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3d2173f096eee83cc2a9c7ac5f8b8512cb273918495a4dda07d304e590bec96
3
+ size 2689533280
granite-3.1-8b-instruct-iq2_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83d50c8f018fb123e2b50aa6ba2a9fdfddfa384e6bc9509b3fe45a2847d20981
3
+ size 2463434080
granite-3.1-8b-instruct-iq3_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c42514f2d2ce74cd70ee9b876f05170263940b728871a426b2cd107964ac01ed
3
+ size 3823568224
granite-3.1-8b-instruct-iq3_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:462fa0db483ba72e1874aa1175266d13a7d52385a20219140f63070d355c3dd6
3
+ size 3823568224
granite-3.1-8b-instruct-iq3_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:685c1e9dbe09f416368564bd3b243b7158c92146685da88e8596599b9920c639
3
+ size 3424978272
granite-3.1-8b-instruct-iq3_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7bbbfafbb307078574e7babebcf443252869620c2f3ce7ed53e46cf5fef0b87
3
+ size 3323397472
granite-3.1-8b-instruct-iq4_nl.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3cd0de4dae5f25c94f1ddadd909e65724277ac6b7af27eda946c89b8bd91d7b
3
+ size 4671867840
granite-3.1-8b-instruct-iq4_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e22128f42dcd887e504feda1fae96e2559848859d38d350644be52b5b06e6c3
3
+ size 4428073920
granite-3.1-8b-instruct-q2_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3a15720402eb0da2d9041b6b0a6ba6ab847077e136f9383f5e7016d681eb556
3
+ size 3056143296
granite-3.1-8b-instruct-q2_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10bcc35a4c5df0edf5c38d096e115fe45ffbf0cdc9c14c7ed2a6937b0b48e2f2
3
+ size 3029402976
granite-3.1-8b-instruct-q3_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e609ff0dac80d3634f3016b26a41e749d0ed536df5afa2702a1f07e47033d69
3
+ size 3965651904
granite-3.1-8b-instruct-q3_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75c0921a741af906472786820c2bfebec9a42151155fcdb3a0d1fa7a008cd2da
3
+ size 3938911584
granite-3.1-8b-instruct-q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbb7d8bd62c67312b22264cc100980fd3be76d85dbe5a7015467b7ef66c34391
3
+ size 4598988640
granite-3.1-8b-instruct-q4_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ff8462851886d6634610f7174c770448f7994c4ca45ed6826ac29869e5e1188
3
+ size 5109645920
granite-3.1-8b-instruct-q4_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b929bd3f4c31e99fff9570ac926b763bdfb3768006b60cc48f8ac268e2617d33
3
+ size 4899474368
granite-3.1-8b-instruct-q4_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6594cf44b7fa671671a37bcd5111790784d0867ed72b25c86ed53d1dd8941859
3
+ size 4730850240
granite-3.1-8b-instruct-q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:485665a148b79c5298e6c628c48ad050fe7c2e4bb4994adf4e8ac36c417ab7a3
3
+ size 5620303200
granite-3.1-8b-instruct-q5_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa539a30212e8dd25d83b7df692d6b5f0f03a9c5f794d89d59f0874d95181044
3
+ size 6130960480
granite-3.1-8b-instruct-q5_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca120cfc1e0fe828d40424efb3ad0f983f5d751ac1e8a2a386b7fa7dd591751c
3
+ size 5815274432
granite-3.1-8b-instruct-q5_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dcb6e119cc762e58defc8a0b577ed25a141ae868cdcae62aa80798a912adebb
3
+ size 5725031360
granite-3.1-8b-instruct-q6_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7ef0109980207863423a6554cffeaceacd73a538e1e3beebb56d817f296a374
3
+ size 6705449920
granite-3.1-8b-instruct-q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa7f4cc09b11f5273c18354461aa084b8a5849206ab2aace5d5c91cb2f4ae5fb
3
+ size 8684246592
granite-3.1-8b-instruct.imatrix ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faa56266b45dc5b61f4ddd209632e55fdc54b49048383bec67d2d11bb5b43789
3
+ size 5989458