Initial GPTQ model commit
Browse files
README.md
CHANGED
@@ -49,27 +49,42 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
|
|
49 |
<|prompter|>{prompt}<|endoftext|><|assistant|>
|
50 |
```
|
51 |
|
52 |
-
## Provided files
|
53 |
|
54 |
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
55 |
|
56 |
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
## How to download from branches
|
68 |
|
69 |
- In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ:gptq-4bit-32g-actorder_True`
|
70 |
- With Git, you can clone a branch with:
|
71 |
```
|
72 |
-
git clone --branch --
|
73 |
```
|
74 |
- In Python Transformers code, the branch is the `revision` parameter; see below.
|
75 |
|
@@ -94,9 +109,19 @@ It is strongly recommended to use the text-generation-webui one-click-installers
|
|
94 |
|
95 |
## How to use this GPTQ model from Python code
|
96 |
|
97 |
-
First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
Then try the following example code:
|
102 |
|
@@ -105,14 +130,12 @@ from transformers import AutoTokenizer, pipeline, logging
|
|
105 |
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
106 |
|
107 |
model_name_or_path = "TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ"
|
108 |
-
model_basename = "gptq_model-4bit-128g"
|
109 |
|
110 |
use_triton = False
|
111 |
|
112 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
113 |
|
114 |
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
115 |
-
model_basename=model_basename,
|
116 |
use_safetensors=True,
|
117 |
trust_remote_code=False,
|
118 |
device="cuda:0",
|
@@ -120,11 +143,11 @@ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
|
120 |
quantize_config=None)
|
121 |
|
122 |
"""
|
123 |
-
To download from a specific branch, use the revision parameter, as in this example:
|
|
|
124 |
|
125 |
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
126 |
revision="gptq-4bit-32g-actorder_True",
|
127 |
-
model_basename=model_basename,
|
128 |
use_safetensors=True,
|
129 |
trust_remote_code=False,
|
130 |
device="cuda:0",
|
|
|
49 |
<|prompter|>{prompt}<|endoftext|><|assistant|>
|
50 |
```
|
51 |
|
52 |
+
## Provided files and GPTQ parameters
|
53 |
|
54 |
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
55 |
|
56 |
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
57 |
|
58 |
+
All GPTQ files are made with AutoGPTQ.
|
59 |
+
|
60 |
+
<details>
|
61 |
+
<summary>Explanation of GPTQ parameters</summary>
|
62 |
+
|
63 |
+
- Bits: The bit size of the quantised model.
|
64 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
65 |
+
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have issues with models that use Act Order plus Group Size.
|
66 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
67 |
+
- GPTQ dataset: The dataset used for quantisation. The dataset used for quantisation can affect the quantisation accuracy. The dataset used for quantisation is not the same as the dataset used to train the model.
|
68 |
+
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only affects the quantisation accuracy on longer inference sequences.
|
69 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
70 |
+
|
71 |
+
</details>
|
72 |
+
|
73 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
74 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
75 |
+
| [main](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
|
76 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
|
77 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
|
78 |
+
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
|
79 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
|
80 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
|
81 |
|
82 |
## How to download from branches
|
83 |
|
84 |
- In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ:gptq-4bit-32g-actorder_True`
|
85 |
- With Git, you can clone a branch with:
|
86 |
```
|
87 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ
|
88 |
```
|
89 |
- In Python Transformers code, the branch is the `revision` parameter; see below.
|
90 |
|
|
|
109 |
|
110 |
## How to use this GPTQ model from Python code
|
111 |
|
112 |
+
First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) 0.3.1 or later installed:
|
113 |
|
114 |
+
```
|
115 |
+
pip3 install auto-gptq
|
116 |
+
```
|
117 |
+
|
118 |
+
If you have problems installing AutoGPTQ, please build from source instead:
|
119 |
+
```
|
120 |
+
pip3 uninstall -y auto-gptq
|
121 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
122 |
+
cd AutoGPTQ
|
123 |
+
pip3 install .
|
124 |
+
```
|
125 |
|
126 |
Then try the following example code:
|
127 |
|
|
|
130 |
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
131 |
|
132 |
model_name_or_path = "TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ"
|
|
|
133 |
|
134 |
use_triton = False
|
135 |
|
136 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
137 |
|
138 |
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
|
|
139 |
use_safetensors=True,
|
140 |
trust_remote_code=False,
|
141 |
device="cuda:0",
|
|
|
143 |
quantize_config=None)
|
144 |
|
145 |
"""
|
146 |
+
# To download from a specific branch, use the revision parameter, as in this example:
|
147 |
+
# Note that `revision` requires AutoGPTQ 0.3.1 or later!
|
148 |
|
149 |
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
150 |
revision="gptq-4bit-32g-actorder_True",
|
|
|
151 |
use_safetensors=True,
|
152 |
trust_remote_code=False,
|
153 |
device="cuda:0",
|