donghyunli commited on
Commit
9cf50a6
·
verified ·
1 Parent(s): 5d5c6f6

KronQ g128

Browse files
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/Llama-2-13b-hf
3
+ license: llama2
4
+ tags:
5
+ - kronq
6
+ - quantization
7
+ - group-quantization
8
+ - fake-quant
9
+ - fp16
10
+ language:
11
+ - en
12
+ pipeline_tag: text-generation
13
+ ---
14
+ # Llama-2-13b — KronQ W3A16 g128 (fake-quant fp16)
15
+
16
+ > ⚠️ **Fake-quant fp16 checkpoint.** 3-bit group-128 weights stored in **fp16** (KronQ does not pack int3) — **same size as bf16**, for PPL/accuracy reproduction. For deployable low-bit see the W4A16-g128 / W2A16-g128 (packed) repos.
17
+
18
+ [Llama-2-13b](https://huggingface.co/meta-llama/Llama-2-13b-hf) quantized to 3-bit weights (group 128) with **KronQ**, exported as a standard fp16 model.
19
+
20
+ ## Results (WikiText-2, seqlen 2048)
21
+
22
+ **Perplexity:** **5.135**
23
+
24
+ **Zero-shot accuracy:**
25
+
26
+ | PIQA | HellaSwag | ARC-E | ARC-C | WinoGrande | BoolQ | Average |
27
+ |---|---|---|---|---|---|---|
28
+ | 79.22 | 77.53 | 76.30 | 48.72 | 72.14 | 81.62 | **72.59** |
29
+
30
+ (lm-evaluation-harness 0-shot.)
31
+
32
+ ## Usage
33
+
34
+ Loads as a **standard fp16 model** (no KronQ code):
35
+
36
+ ```python
37
+ from transformers import AutoModelForCausalLM
38
+ m = AutoModelForCausalLM.from_pretrained("donghyunli/Llama-2-13b-KronQ-W3A16-g128-fake", torch_dtype="float16", device_map="auto")
39
+ ```
40
+
41
+ ## Recipe
42
+
43
+ Group-128 asymmetric W3, weight-only, `--alpha 0.25`, `--act_order`, BiIP, raw H_G.
44
+
45
+ ## License
46
+
47
+ Derivative of Llama-2-13b — [llama2 license](https://ai.meta.com/llama/license/).
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 5120,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 13824,
14
+ "max_position_embeddings": 4096,
15
+ "mlp_bias": false,
16
+ "model_type": "llama",
17
+ "num_attention_heads": 40,
18
+ "num_hidden_layers": 40,
19
+ "num_key_value_heads": 40,
20
+ "pretraining_tp": 1,
21
+ "rms_norm_eps": 1e-05,
22
+ "rope_scaling": null,
23
+ "rope_theta": 10000.0,
24
+ "tie_word_embeddings": false,
25
+ "torch_dtype": "float16",
26
+ "transformers_version": "4.51.0",
27
+ "use_cache": true,
28
+ "vocab_size": 32000
29
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83cb92e244888cb24f9f961dec774d33c6f6f21b6d094b9522d212abd5adf366
3
+ size 26031771000
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "extra_special_tokens": {},
35
+ "legacy": false,
36
+ "model_max_length": 1000000000000000019884624838656,
37
+ "pad_token": null,
38
+ "padding_side": "right",
39
+ "sp_model_kwargs": {},
40
+ "tokenizer_class": "LlamaTokenizer",
41
+ "unk_token": "<unk>",
42
+ "use_default_system_prompt": false
43
+ }