donghyunli commited on
Commit
334bc10
·
verified ·
1 Parent(s): 2e7a456

KronQ W4A16 packed int4 (L2-13B)

Browse files
README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/Llama-2-13b-hf
3
+ license: llama2
4
+ tags:
5
+ - kronq
6
+ - quantization
7
+ - int4
8
+ - weight-only
9
+ language:
10
+ - en
11
+ pipeline_tag: text-generation
12
+ ---
13
+
14
+ # Llama-2-13b — KronQ W4A16 (packed int4)
15
+
16
+ [Llama-2-13b](https://huggingface.co/meta-llama/Llama-2-13b-hf) quantized to **4-bit weights / 16-bit activations** with **KronQ** (Kronecker-factored Hessian quantization). Weights are stored **packed int4** (~6.9 GB vs 26 GB fp16); a fused dequant + bidirectional-incoherence (BiIP) CUDA kernel unpacks them on the fly.
17
+
18
+ ## Results (WikiText-2, seqlen 2048)
19
+
20
+ **Perplexity:** **4.96**
21
+
22
+ **Zero-shot accuracy:**
23
+
24
+ | PIQA | HellaSwag | ARC-E | ARC-C | WinoGrande | BoolQ | Average |
25
+ |---|---|---|---|---|---|---|
26
+ | 80.20 | 79.14 | 74.71 | 47.95 | 71.82 | 82.14 | **72.66** |
27
+
28
+ (lm-evaluation-harness, 0-shot. `acc_norm` for PIQA/HellaSwag/ARC, `acc` for WinoGrande/BoolQ.)
29
+
30
+ ## Usage
31
+
32
+ KronQ-packed checkpoint (`model.safetensors` carries `biip_w_codes`/scale/zero + BiIP buffers, see `kronq_packed_config.json`). Load with the KronQ runtime:
33
+
34
+ ```bash
35
+ python eval_pretrained.py meta-llama/Llama-2-13b-hf donghyunli/Llama-2-13b-KronQ-W4A16 --ppl --zs
36
+ ```
37
+
38
+ ## Recipe
39
+
40
+ Per-channel asymmetric W4, weight-only (a_bits=16), `--alpha 0.25`, bidirectional incoherence processing (BiIP), `act_order`, raw H_G. Calibrated on 128 WikiText-2 sequences.
41
+
42
+ ## License
43
+
44
+ Derivative of Llama-2-13b — subject to the [Llama 2 Community License](https://ai.meta.com/llama/license/).
kronq_packed_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "format": "kronq-packed",
3
+ "bits": 4,
4
+ "n_compressed": 280
5
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:826580592e5965f924b76aab5d1a037f768d4cb24f2a4090df7defa0953f36e7
3
+ size 7352355120
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,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "bos_token": {
5
+ "__type": "AddedToken",
6
+ "content": "<s>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "clean_up_tokenization_spaces": false,
13
+ "eos_token": {
14
+ "__type": "AddedToken",
15
+ "content": "</s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "legacy": false,
22
+ "model_max_length": 1000000000000000019884624838656,
23
+ "pad_token": null,
24
+ "padding_side": "right",
25
+ "sp_model_kwargs": {},
26
+ "tokenizer_class": "LlamaTokenizer",
27
+ "unk_token": {
28
+ "__type": "AddedToken",
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false
34
+ }
35
+ }