TheBloke commited on
Commit
38dda63
·
1 Parent(s): 0ebc0b9

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +39 -16
README.md CHANGED
@@ -54,27 +54,42 @@ Below is an instruction that describes a task. Write a response that appropriate
54
  ### Response:
55
  ```
56
 
57
- ## Provided files
58
 
59
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
60
 
61
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
62
 
63
- | Branch | Bits | Group Size | Act Order (desc_act) | GPTQ Dataset | Size | ExLlama Compat? | Made With | Desc |
64
- | ------ | ---- | ---------- | -------------------- | ------------ | ---- | --------------- | --------- | ---- |
65
- | [main](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/main) | 4 | 128 | No | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 7.26 GB | Yes | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
66
- | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8.00 GB | Yes | AutoGPTQ | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
67
- | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 7.51 GB | Yes | AutoGPTQ | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
68
- | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 7.26 GB | Yes | AutoGPTQ | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
69
- | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 13.36 GB | No | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
70
- | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 13.65 GB | No | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ## How to download from branches
73
 
74
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ:gptq-4bit-32g-actorder_True`
75
  - With Git, you can clone a branch with:
76
  ```
77
- git clone --branch --single-branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ
78
  ```
79
  - In Python Transformers code, the branch is the `revision` parameter; see below.
80
 
@@ -99,9 +114,19 @@ It is strongly recommended to use the text-generation-webui one-click-installers
99
 
100
  ## How to use this GPTQ model from Python code
101
 
102
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
103
 
104
- `GITHUB_ACTIONS=true pip install auto-gptq`
 
 
 
 
 
 
 
 
 
 
105
 
106
  Then try the following example code:
107
 
@@ -110,14 +135,12 @@ from transformers import AutoTokenizer, pipeline, logging
110
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
111
 
112
  model_name_or_path = "TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ"
113
- model_basename = "gptq_model-4bit-128g"
114
 
115
  use_triton = False
116
 
117
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
118
 
119
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
120
- model_basename=model_basename,
121
  use_safetensors=True,
122
  trust_remote_code=False,
123
  device="cuda:0",
@@ -125,11 +148,11 @@ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
125
  quantize_config=None)
126
 
127
  """
128
- To download from a specific branch, use the revision parameter, as in this example:
 
129
 
130
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
131
  revision="gptq-4bit-32g-actorder_True",
132
- model_basename=model_basename,
133
  use_safetensors=True,
134
  trust_remote_code=False,
135
  device="cuda:0",
 
54
  ### Response:
55
  ```
56
 
57
+ ## Provided files and GPTQ parameters
58
 
59
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
60
 
61
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
62
 
63
+ All GPTQ files are made with AutoGPTQ.
64
+
65
+ <details>
66
+ <summary>Explanation of GPTQ parameters</summary>
67
+
68
+ - Bits: The bit size of the quantised model.
69
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
70
+ - 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.
71
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
72
+ - 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.
73
+ - 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.
74
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
75
+
76
+ </details>
77
+
78
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
79
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
80
+ | [main](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 7.26 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
81
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-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) | 4096 | 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. |
82
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-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) | 4096 | 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. |
83
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-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) | 4096 | 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. |
84
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-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) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
85
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-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) | 4096 | 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. |
86
 
87
  ## How to download from branches
88
 
89
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ:gptq-4bit-32g-actorder_True`
90
  - With Git, you can clone a branch with:
91
  ```
92
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ
93
  ```
94
  - In Python Transformers code, the branch is the `revision` parameter; see below.
95
 
 
114
 
115
  ## How to use this GPTQ model from Python code
116
 
117
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) 0.3.1 or later installed:
118
 
119
+ ```
120
+ pip3 install auto-gptq
121
+ ```
122
+
123
+ If you have problems installing AutoGPTQ, please build from source instead:
124
+ ```
125
+ pip3 uninstall -y auto-gptq
126
+ git clone https://github.com/PanQiWei/AutoGPTQ
127
+ cd AutoGPTQ
128
+ pip3 install .
129
+ ```
130
 
131
  Then try the following example code:
132
 
 
135
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
136
 
137
  model_name_or_path = "TheBloke/CodeUp-Llama-2-13B-Chat-HF-GPTQ"
 
138
 
139
  use_triton = False
140
 
141
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
142
 
143
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
 
144
  use_safetensors=True,
145
  trust_remote_code=False,
146
  device="cuda:0",
 
148
  quantize_config=None)
149
 
150
  """
151
+ # To download from a specific branch, use the revision parameter, as in this example:
152
+ # Note that `revision` requires AutoGPTQ 0.3.1 or later!
153
 
154
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
155
  revision="gptq-4bit-32g-actorder_True",
 
156
  use_safetensors=True,
157
  trust_remote_code=False,
158
  device="cuda:0",