TheBloke commited on
Commit
e409aa4
1 Parent(s): 415adf3

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -39
README.md CHANGED
@@ -42,15 +42,12 @@ quantized_by: TheBloke
42
  <!-- description start -->
43
  # Description
44
 
45
- This repo contains **EXPERIMENTAL** GPTQ model files for [Mistral AI_'s Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
46
 
47
- ## Requires AutoGPTQ PR + transformers 4.36.0
48
-
49
- These files were made with, and will currently only work with, this AutoGPTQ PR: https://github.com/LaaZa/AutoGPTQ/tree/Mixtral-fix
50
-
51
- To test, please build AutoGPTQ from source using that PR. You also need Transformers version 4.36.0, released December 11th.
52
-
53
- Transformers support has just arrived also via two PRs - and is expected in main Transformers + Optimum tomorrow (Dec 12th).
54
 
55
  Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
56
 
@@ -58,6 +55,7 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
58
  <!-- repositories-available start -->
59
  ## Repositories available
60
 
 
61
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ)
62
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF)
63
  * [Mistral AI_'s original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)
@@ -74,6 +72,16 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
74
  <!-- prompt-template end -->
75
 
76
 
 
 
 
 
 
 
 
 
 
 
77
  <!-- README_GPTQ.md-provided-files start -->
78
  ## Provided files, and GPTQ parameters
79
 
@@ -98,13 +106,13 @@ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with T
98
 
99
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
100
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
101
- | main | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 23.81 GB | No | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
102
- | gptq-4bit-128g-actorder_True | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 24.70 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
103
- | gptq-4bit-32g-actorder_True | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 27.42 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
104
- | gptq-3bit--1g-actorder_True | 3 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.01 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
105
- | gptq-3bit-128g-actorder_True | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.85 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
106
- | gptq-8bit--1g-actorder_True | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 47.04 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
107
- | gptq-8bit-128g-actorder_True | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 48.10 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
108
 
109
  <!-- README_GPTQ.md-provided-files end -->
110
 
@@ -178,7 +186,11 @@ Note that using Git with HF repos is strongly discouraged. It will be much slowe
178
  <!-- README_GPTQ.md-text-generation-webui start -->
179
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
180
 
181
- **NOTE**: This will only work with the AutoGPTQ loader, and only if you build AutoGPTQ from source using https://github.com/LaaZa/AutoGPTQ/tree/Mixtral
 
 
 
 
182
 
183
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
184
 
@@ -203,15 +215,21 @@ It is strongly recommended to use the text-generation-webui one-click-installers
203
 
204
  <!-- README_GPTQ.md-text-generation-webui end -->
205
 
 
 
 
 
 
 
206
  <!-- README_GPTQ.md-use-from-python start -->
207
  ## Python code example: inference from this GPTQ model
208
 
209
  ### Install the necessary packages
210
 
211
- Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
212
 
213
  ```shell
214
- pip3 install --upgrade transformers optimum
215
  # If using PyTorch 2.1 + CUDA 12.x:
216
  pip3 install --upgrade auto-gptq
217
  # or, if using PyTorch 2.1 + CUDA 11.x:
@@ -224,35 +242,28 @@ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Lik
224
  pip3 uninstall -y auto-gptq
225
  git clone https://github.com/PanQiWei/AutoGPTQ
226
  cd AutoGPTQ
227
- git checkout v0.5.1
228
- pip3 install .
229
  ```
230
 
231
  ### Example Python code
232
 
233
  ```python
234
- from transformers import AutoTokenizer
235
- from auto_gptq import AutoGPTQForCausalLM
236
 
237
  model_name_or_path = "TheBloke/Mixtral-8x7B-v0.1-GPTQ"
238
-
239
- model_name_or_path = args.model_dir
240
  # To use a different branch, change revision
241
- # For example: revision="gptq-4bit-32g-actorder_True"
242
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
243
- model_basename="model",
244
- use_safetensors=True,
245
- trust_remote_code=False,
246
- device="cuda:0",
247
- use_triton=False,
248
- disable_exllama=True,
249
- disable_exllamav2=True,
250
- quantize_config=None)
251
-
252
- tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True, trust_remote_code=False)
253
-
254
- prompt = "Tell me about AI"
255
- prompt_template=f'''{prompt}'''
256
 
257
  print("\n\n*** Generate:")
258
 
@@ -260,9 +271,31 @@ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
260
  output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
261
  print(tokenizer.decode(output[0]))
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  ```
264
  <!-- README_GPTQ.md-use-from-python end -->
265
 
 
 
 
 
 
 
266
 
267
  <!-- footer start -->
268
  <!-- 200823 -->
 
42
  <!-- description start -->
43
  # Description
44
 
45
+ This repo contains GPTQ model files for [Mistral AI_'s Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
46
 
47
+ Mixtral GPTQs currently require:
48
+ * Transformers 4.36.0 or later
49
+ * either, AutoGPTQ 0.6 compiled from source, or
50
+ * Transformers 4.37.0.dev0 compiled from Github with: `pip3 install git+https://github.com/huggingface/transformers`
 
 
 
51
 
52
  Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
53
 
 
55
  <!-- repositories-available start -->
56
  ## Repositories available
57
 
58
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/mixtral-8x7b-v0.1-AWQ)
59
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ)
60
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF)
61
  * [Mistral AI_'s original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)
 
72
  <!-- prompt-template end -->
73
 
74
 
75
+
76
+ <!-- README_GPTQ.md-compatible clients start -->
77
+ ## Known compatible clients / servers
78
+
79
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
80
+
81
+ Mixtral GPTQs currently have special requirements - see Description above.
82
+
83
+ <!-- README_GPTQ.md-compatible clients end -->
84
+
85
  <!-- README_GPTQ.md-provided-files start -->
86
  ## Provided files, and GPTQ parameters
87
 
 
106
 
107
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
108
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
109
+ | [main](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 23.81 GB | No | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
110
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 24.70 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
111
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 27.42 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
112
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.01 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
113
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.85 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
114
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 47.04 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
115
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 48.10 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
116
 
117
  <!-- README_GPTQ.md-provided-files end -->
118
 
 
186
  <!-- README_GPTQ.md-text-generation-webui start -->
187
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
188
 
189
+ **NOTE**: Requires:
190
+
191
+ * Transformers 4.36.0, or Transformers 4.37.0.dev0 from Github
192
+ * Either AutoGPTQ 0.6 compiled from source and `Loader: AutoGPTQ`,
193
+ * or, `Loader: Transformers`, if you installed Transformers from Github: `pip3 install git+https://github.com/huggingface/transformers`
194
 
195
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
196
 
 
215
 
216
  <!-- README_GPTQ.md-text-generation-webui end -->
217
 
218
+ <!-- README_GPTQ.md-use-from-tgi start -->
219
+ ## Serving this model from Text Generation Inference (TGI)
220
+
221
+ Not currently supported for Mixtral models.
222
+
223
+ <!-- README_GPTQ.md-use-from-tgi end -->
224
  <!-- README_GPTQ.md-use-from-python start -->
225
  ## Python code example: inference from this GPTQ model
226
 
227
  ### Install the necessary packages
228
 
229
+ Requires: Transformers 4.37.0.dev0 from Github, Optimum 1.16.0 or later, and AutoGPTQ 0.5.1 or later.
230
 
231
  ```shell
232
+ pip3 install --upgrade "git+https://github.com/huggingface/transformers" optimum
233
  # If using PyTorch 2.1 + CUDA 12.x:
234
  pip3 install --upgrade auto-gptq
235
  # or, if using PyTorch 2.1 + CUDA 11.x:
 
242
  pip3 uninstall -y auto-gptq
243
  git clone https://github.com/PanQiWei/AutoGPTQ
244
  cd AutoGPTQ
245
+ DISABLE_QIGEN=1 pip3 install .
 
246
  ```
247
 
248
  ### Example Python code
249
 
250
  ```python
251
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
252
 
253
  model_name_or_path = "TheBloke/Mixtral-8x7B-v0.1-GPTQ"
 
 
254
  # To use a different branch, change revision
255
+ # For example: revision="gptq-4bit-128g-actorder_True"
256
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
257
+ device_map="auto",
258
+ trust_remote_code=False,
259
+ revision="main")
260
+
261
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
262
+
263
+ prompt = "Write a story about llamas"
264
+ system_message = "You are a story writing assistant"
265
+ prompt_template=f'''{prompt}
266
+ '''
 
 
 
267
 
268
  print("\n\n*** Generate:")
269
 
 
271
  output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
272
  print(tokenizer.decode(output[0]))
273
 
274
+ # Inference can also be done using transformers' pipeline
275
+
276
+ print("*** Pipeline:")
277
+ pipe = pipeline(
278
+ "text-generation",
279
+ model=model,
280
+ tokenizer=tokenizer,
281
+ max_new_tokens=512,
282
+ do_sample=True,
283
+ temperature=0.7,
284
+ top_p=0.95,
285
+ top_k=40,
286
+ repetition_penalty=1.1
287
+ )
288
+
289
+ print(pipe(prompt_template)[0]['generated_text'])
290
  ```
291
  <!-- README_GPTQ.md-use-from-python end -->
292
 
293
+ <!-- README_GPTQ.md-compatibility start -->
294
+ ## Compatibility
295
+
296
+ The files provided are tested to work with AutoGPTQ 0.6 (compiled from source) and Transformers 4.37.0 (installed from Github).
297
+
298
+ <!-- README_GPTQ.md-compatibility end -->
299
 
300
  <!-- footer start -->
301
  <!-- 200823 -->