sahilchachra commited on
Commit
2ca79c7
·
verified ·
1 Parent(s): 9713a81

Upload mxfp4 MLX quantization

Browse files
README.md ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: SupraLabs/Supra-1.5-50M-Instruct-exp
4
+ tags:
5
+ - mlx
6
+ - quantized
7
+ - apple-silicon
8
+ ---
9
+
10
+ # supra-1.5-50m-instruct-exp-mxfp4-mlx
11
+
12
+ MLX quantization of [SupraLabs/Supra-1.5-50M-Instruct-exp](https://huggingface.co/SupraLabs/Supra-1.5-50M-Instruct-exp) for Apple Silicon.
13
+
14
+ **Variant**: Block float MX FP4
15
+ **Disk size**: 28 MB
16
+ **Quantized by**: [sahilchachra](https://huggingface.co/sahilchachra)
17
+
18
+ ## Benchmark results
19
+
20
+ Evaluated on Apple M4 Pro with MLX. Model loaded once; performance and quality measured in a single pass.
21
+
22
+ ### Performance
23
+
24
+ | | This model | FP16 baseline |
25
+ |---|---:|---:|
26
+ | Decode tok/s (avg, long traces) | 1675.62 | 1025.59 |
27
+ | Peak memory (GB) | 0.126 | 0.223 |
28
+ | Disk size (MB) | 28 | 101 |
29
+
30
+ ### Quality
31
+
32
+ | Benchmark | This model | FP16 baseline | n |
33
+ |---|---:|---:|---:|
34
+ | IFEval (instruction following) | 20.5% | 15.9% | 44 |
35
+ | Alpaca-cleaned (instruct F1 vs reference) | 36.8 | 40.9 | 50 |
36
+
37
+ ### Context scaling (decode tok/s)
38
+
39
+ | Context length | Decode tok/s |
40
+ |---:|---:|
41
+ | ~128 tokens | 1675.2 |
42
+ | ~256 tokens | 1685.8 |
43
+ | ~512 tokens | 1655.6 |
44
+ | ~1024 tokens | 1685.9 |
45
+
46
+ ## Usage
47
+
48
+ ```bash
49
+ pip install mlx-lm
50
+ ```
51
+
52
+ ```python
53
+ from mlx_lm import load, generate
54
+
55
+ model, tokenizer = load("sahilchachra/supra-1.5-50m-instruct-exp-mxfp4-mlx")
56
+ response = generate(model, tokenizer, prompt="Your prompt here", max_tokens=256, verbose=True)
57
+ ```
58
+
59
+ ## All variants in this collection
60
+
61
+ | Model | Variant |
62
+ |---|---|
63
+ | [sahilchachra/supra-1.5-50m-instruct-exp-mxfp4-mlx](https://huggingface.co/sahilchachra/supra-1.5-50m-instruct-exp-mxfp4-mlx) | Block float MX FP4 ← this model |
64
+ | [sahilchachra/supra-1.5-50m-instruct-exp-mxfp8-mlx](https://huggingface.co/sahilchachra/supra-1.5-50m-instruct-exp-mxfp8-mlx) | Block float MX FP8 |
65
+
66
+ ## Notes
67
+
68
+ - Requires Apple Silicon (M1 or later) with MLX
69
+ - Benchmarks run on Apple M4 Pro, 24 GB unified memory
70
+ - License: see [SupraLabs/Supra-1.5-50M-Instruct-exp](https://huggingface.co/SupraLabs/Supra-1.5-50M-Instruct-exp) for the original model's license
71
+
72
+ ## Original model
73
+
74
+ See [SupraLabs/Supra-1.5-50M-Instruct-exp](https://huggingface.co/SupraLabs/Supra-1.5-50M-Instruct-exp) for full model details and intended use.
config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 512,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1408,
15
+ "max_position_embeddings": 5120,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 8,
19
+ "num_hidden_layers": 12,
20
+ "num_key_value_heads": 4,
21
+ "pad_token_id": 1,
22
+ "pretraining_tp": 1,
23
+ "quantization": {
24
+ "group_size": 32,
25
+ "bits": 4,
26
+ "mode": "mxfp4"
27
+ },
28
+ "quantization_config": {
29
+ "group_size": 32,
30
+ "bits": 4,
31
+ "mode": "mxfp4"
32
+ },
33
+ "rms_norm_eps": 1e-06,
34
+ "rope_parameters": {
35
+ "factor": 1.0,
36
+ "rope_theta": 10000.0,
37
+ "rope_type": "linear",
38
+ "type": "linear"
39
+ },
40
+ "tie_word_embeddings": true,
41
+ "transformers_version": "5.8.1",
42
+ "use_cache": false,
43
+ "vocab_size": 32000
44
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 2,
5
+ "pad_token_id": 1,
6
+ "transformers_version": "5.8.1"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8bb2c4f39f1103596b64897e63439833aea2ca4a85dd70f2d4587afd52afe8d
3
+ size 27551049
model.safetensors.index.json ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 27530240,
4
+ "total_parameters": 51786240
5
+ },
6
+ "weight_map": {
7
+ "model.embed_tokens.scales": "model.safetensors",
8
+ "model.embed_tokens.weight": "model.safetensors",
9
+ "model.layers.0.input_layernorm.weight": "model.safetensors",
10
+ "model.layers.0.mlp.down_proj.scales": "model.safetensors",
11
+ "model.layers.0.mlp.down_proj.weight": "model.safetensors",
12
+ "model.layers.0.mlp.gate_proj.scales": "model.safetensors",
13
+ "model.layers.0.mlp.gate_proj.weight": "model.safetensors",
14
+ "model.layers.0.mlp.up_proj.scales": "model.safetensors",
15
+ "model.layers.0.mlp.up_proj.weight": "model.safetensors",
16
+ "model.layers.0.post_attention_layernorm.weight": "model.safetensors",
17
+ "model.layers.0.self_attn.k_proj.scales": "model.safetensors",
18
+ "model.layers.0.self_attn.k_proj.weight": "model.safetensors",
19
+ "model.layers.0.self_attn.o_proj.scales": "model.safetensors",
20
+ "model.layers.0.self_attn.o_proj.weight": "model.safetensors",
21
+ "model.layers.0.self_attn.q_proj.scales": "model.safetensors",
22
+ "model.layers.0.self_attn.q_proj.weight": "model.safetensors",
23
+ "model.layers.0.self_attn.v_proj.scales": "model.safetensors",
24
+ "model.layers.0.self_attn.v_proj.weight": "model.safetensors",
25
+ "model.layers.1.input_layernorm.weight": "model.safetensors",
26
+ "model.layers.1.mlp.down_proj.scales": "model.safetensors",
27
+ "model.layers.1.mlp.down_proj.weight": "model.safetensors",
28
+ "model.layers.1.mlp.gate_proj.scales": "model.safetensors",
29
+ "model.layers.1.mlp.gate_proj.weight": "model.safetensors",
30
+ "model.layers.1.mlp.up_proj.scales": "model.safetensors",
31
+ "model.layers.1.mlp.up_proj.weight": "model.safetensors",
32
+ "model.layers.1.post_attention_layernorm.weight": "model.safetensors",
33
+ "model.layers.1.self_attn.k_proj.scales": "model.safetensors",
34
+ "model.layers.1.self_attn.k_proj.weight": "model.safetensors",
35
+ "model.layers.1.self_attn.o_proj.scales": "model.safetensors",
36
+ "model.layers.1.self_attn.o_proj.weight": "model.safetensors",
37
+ "model.layers.1.self_attn.q_proj.scales": "model.safetensors",
38
+ "model.layers.1.self_attn.q_proj.weight": "model.safetensors",
39
+ "model.layers.1.self_attn.v_proj.scales": "model.safetensors",
40
+ "model.layers.1.self_attn.v_proj.weight": "model.safetensors",
41
+ "model.layers.10.input_layernorm.weight": "model.safetensors",
42
+ "model.layers.10.mlp.down_proj.scales": "model.safetensors",
43
+ "model.layers.10.mlp.down_proj.weight": "model.safetensors",
44
+ "model.layers.10.mlp.gate_proj.scales": "model.safetensors",
45
+ "model.layers.10.mlp.gate_proj.weight": "model.safetensors",
46
+ "model.layers.10.mlp.up_proj.scales": "model.safetensors",
47
+ "model.layers.10.mlp.up_proj.weight": "model.safetensors",
48
+ "model.layers.10.post_attention_layernorm.weight": "model.safetensors",
49
+ "model.layers.10.self_attn.k_proj.scales": "model.safetensors",
50
+ "model.layers.10.self_attn.k_proj.weight": "model.safetensors",
51
+ "model.layers.10.self_attn.o_proj.scales": "model.safetensors",
52
+ "model.layers.10.self_attn.o_proj.weight": "model.safetensors",
53
+ "model.layers.10.self_attn.q_proj.scales": "model.safetensors",
54
+ "model.layers.10.self_attn.q_proj.weight": "model.safetensors",
55
+ "model.layers.10.self_attn.v_proj.scales": "model.safetensors",
56
+ "model.layers.10.self_attn.v_proj.weight": "model.safetensors",
57
+ "model.layers.11.input_layernorm.weight": "model.safetensors",
58
+ "model.layers.11.mlp.down_proj.scales": "model.safetensors",
59
+ "model.layers.11.mlp.down_proj.weight": "model.safetensors",
60
+ "model.layers.11.mlp.gate_proj.scales": "model.safetensors",
61
+ "model.layers.11.mlp.gate_proj.weight": "model.safetensors",
62
+ "model.layers.11.mlp.up_proj.scales": "model.safetensors",
63
+ "model.layers.11.mlp.up_proj.weight": "model.safetensors",
64
+ "model.layers.11.post_attention_layernorm.weight": "model.safetensors",
65
+ "model.layers.11.self_attn.k_proj.scales": "model.safetensors",
66
+ "model.layers.11.self_attn.k_proj.weight": "model.safetensors",
67
+ "model.layers.11.self_attn.o_proj.scales": "model.safetensors",
68
+ "model.layers.11.self_attn.o_proj.weight": "model.safetensors",
69
+ "model.layers.11.self_attn.q_proj.scales": "model.safetensors",
70
+ "model.layers.11.self_attn.q_proj.weight": "model.safetensors",
71
+ "model.layers.11.self_attn.v_proj.scales": "model.safetensors",
72
+ "model.layers.11.self_attn.v_proj.weight": "model.safetensors",
73
+ "model.layers.2.input_layernorm.weight": "model.safetensors",
74
+ "model.layers.2.mlp.down_proj.scales": "model.safetensors",
75
+ "model.layers.2.mlp.down_proj.weight": "model.safetensors",
76
+ "model.layers.2.mlp.gate_proj.scales": "model.safetensors",
77
+ "model.layers.2.mlp.gate_proj.weight": "model.safetensors",
78
+ "model.layers.2.mlp.up_proj.scales": "model.safetensors",
79
+ "model.layers.2.mlp.up_proj.weight": "model.safetensors",
80
+ "model.layers.2.post_attention_layernorm.weight": "model.safetensors",
81
+ "model.layers.2.self_attn.k_proj.scales": "model.safetensors",
82
+ "model.layers.2.self_attn.k_proj.weight": "model.safetensors",
83
+ "model.layers.2.self_attn.o_proj.scales": "model.safetensors",
84
+ "model.layers.2.self_attn.o_proj.weight": "model.safetensors",
85
+ "model.layers.2.self_attn.q_proj.scales": "model.safetensors",
86
+ "model.layers.2.self_attn.q_proj.weight": "model.safetensors",
87
+ "model.layers.2.self_attn.v_proj.scales": "model.safetensors",
88
+ "model.layers.2.self_attn.v_proj.weight": "model.safetensors",
89
+ "model.layers.3.input_layernorm.weight": "model.safetensors",
90
+ "model.layers.3.mlp.down_proj.scales": "model.safetensors",
91
+ "model.layers.3.mlp.down_proj.weight": "model.safetensors",
92
+ "model.layers.3.mlp.gate_proj.scales": "model.safetensors",
93
+ "model.layers.3.mlp.gate_proj.weight": "model.safetensors",
94
+ "model.layers.3.mlp.up_proj.scales": "model.safetensors",
95
+ "model.layers.3.mlp.up_proj.weight": "model.safetensors",
96
+ "model.layers.3.post_attention_layernorm.weight": "model.safetensors",
97
+ "model.layers.3.self_attn.k_proj.scales": "model.safetensors",
98
+ "model.layers.3.self_attn.k_proj.weight": "model.safetensors",
99
+ "model.layers.3.self_attn.o_proj.scales": "model.safetensors",
100
+ "model.layers.3.self_attn.o_proj.weight": "model.safetensors",
101
+ "model.layers.3.self_attn.q_proj.scales": "model.safetensors",
102
+ "model.layers.3.self_attn.q_proj.weight": "model.safetensors",
103
+ "model.layers.3.self_attn.v_proj.scales": "model.safetensors",
104
+ "model.layers.3.self_attn.v_proj.weight": "model.safetensors",
105
+ "model.layers.4.input_layernorm.weight": "model.safetensors",
106
+ "model.layers.4.mlp.down_proj.scales": "model.safetensors",
107
+ "model.layers.4.mlp.down_proj.weight": "model.safetensors",
108
+ "model.layers.4.mlp.gate_proj.scales": "model.safetensors",
109
+ "model.layers.4.mlp.gate_proj.weight": "model.safetensors",
110
+ "model.layers.4.mlp.up_proj.scales": "model.safetensors",
111
+ "model.layers.4.mlp.up_proj.weight": "model.safetensors",
112
+ "model.layers.4.post_attention_layernorm.weight": "model.safetensors",
113
+ "model.layers.4.self_attn.k_proj.scales": "model.safetensors",
114
+ "model.layers.4.self_attn.k_proj.weight": "model.safetensors",
115
+ "model.layers.4.self_attn.o_proj.scales": "model.safetensors",
116
+ "model.layers.4.self_attn.o_proj.weight": "model.safetensors",
117
+ "model.layers.4.self_attn.q_proj.scales": "model.safetensors",
118
+ "model.layers.4.self_attn.q_proj.weight": "model.safetensors",
119
+ "model.layers.4.self_attn.v_proj.scales": "model.safetensors",
120
+ "model.layers.4.self_attn.v_proj.weight": "model.safetensors",
121
+ "model.layers.5.input_layernorm.weight": "model.safetensors",
122
+ "model.layers.5.mlp.down_proj.scales": "model.safetensors",
123
+ "model.layers.5.mlp.down_proj.weight": "model.safetensors",
124
+ "model.layers.5.mlp.gate_proj.scales": "model.safetensors",
125
+ "model.layers.5.mlp.gate_proj.weight": "model.safetensors",
126
+ "model.layers.5.mlp.up_proj.scales": "model.safetensors",
127
+ "model.layers.5.mlp.up_proj.weight": "model.safetensors",
128
+ "model.layers.5.post_attention_layernorm.weight": "model.safetensors",
129
+ "model.layers.5.self_attn.k_proj.scales": "model.safetensors",
130
+ "model.layers.5.self_attn.k_proj.weight": "model.safetensors",
131
+ "model.layers.5.self_attn.o_proj.scales": "model.safetensors",
132
+ "model.layers.5.self_attn.o_proj.weight": "model.safetensors",
133
+ "model.layers.5.self_attn.q_proj.scales": "model.safetensors",
134
+ "model.layers.5.self_attn.q_proj.weight": "model.safetensors",
135
+ "model.layers.5.self_attn.v_proj.scales": "model.safetensors",
136
+ "model.layers.5.self_attn.v_proj.weight": "model.safetensors",
137
+ "model.layers.6.input_layernorm.weight": "model.safetensors",
138
+ "model.layers.6.mlp.down_proj.scales": "model.safetensors",
139
+ "model.layers.6.mlp.down_proj.weight": "model.safetensors",
140
+ "model.layers.6.mlp.gate_proj.scales": "model.safetensors",
141
+ "model.layers.6.mlp.gate_proj.weight": "model.safetensors",
142
+ "model.layers.6.mlp.up_proj.scales": "model.safetensors",
143
+ "model.layers.6.mlp.up_proj.weight": "model.safetensors",
144
+ "model.layers.6.post_attention_layernorm.weight": "model.safetensors",
145
+ "model.layers.6.self_attn.k_proj.scales": "model.safetensors",
146
+ "model.layers.6.self_attn.k_proj.weight": "model.safetensors",
147
+ "model.layers.6.self_attn.o_proj.scales": "model.safetensors",
148
+ "model.layers.6.self_attn.o_proj.weight": "model.safetensors",
149
+ "model.layers.6.self_attn.q_proj.scales": "model.safetensors",
150
+ "model.layers.6.self_attn.q_proj.weight": "model.safetensors",
151
+ "model.layers.6.self_attn.v_proj.scales": "model.safetensors",
152
+ "model.layers.6.self_attn.v_proj.weight": "model.safetensors",
153
+ "model.layers.7.input_layernorm.weight": "model.safetensors",
154
+ "model.layers.7.mlp.down_proj.scales": "model.safetensors",
155
+ "model.layers.7.mlp.down_proj.weight": "model.safetensors",
156
+ "model.layers.7.mlp.gate_proj.scales": "model.safetensors",
157
+ "model.layers.7.mlp.gate_proj.weight": "model.safetensors",
158
+ "model.layers.7.mlp.up_proj.scales": "model.safetensors",
159
+ "model.layers.7.mlp.up_proj.weight": "model.safetensors",
160
+ "model.layers.7.post_attention_layernorm.weight": "model.safetensors",
161
+ "model.layers.7.self_attn.k_proj.scales": "model.safetensors",
162
+ "model.layers.7.self_attn.k_proj.weight": "model.safetensors",
163
+ "model.layers.7.self_attn.o_proj.scales": "model.safetensors",
164
+ "model.layers.7.self_attn.o_proj.weight": "model.safetensors",
165
+ "model.layers.7.self_attn.q_proj.scales": "model.safetensors",
166
+ "model.layers.7.self_attn.q_proj.weight": "model.safetensors",
167
+ "model.layers.7.self_attn.v_proj.scales": "model.safetensors",
168
+ "model.layers.7.self_attn.v_proj.weight": "model.safetensors",
169
+ "model.layers.8.input_layernorm.weight": "model.safetensors",
170
+ "model.layers.8.mlp.down_proj.scales": "model.safetensors",
171
+ "model.layers.8.mlp.down_proj.weight": "model.safetensors",
172
+ "model.layers.8.mlp.gate_proj.scales": "model.safetensors",
173
+ "model.layers.8.mlp.gate_proj.weight": "model.safetensors",
174
+ "model.layers.8.mlp.up_proj.scales": "model.safetensors",
175
+ "model.layers.8.mlp.up_proj.weight": "model.safetensors",
176
+ "model.layers.8.post_attention_layernorm.weight": "model.safetensors",
177
+ "model.layers.8.self_attn.k_proj.scales": "model.safetensors",
178
+ "model.layers.8.self_attn.k_proj.weight": "model.safetensors",
179
+ "model.layers.8.self_attn.o_proj.scales": "model.safetensors",
180
+ "model.layers.8.self_attn.o_proj.weight": "model.safetensors",
181
+ "model.layers.8.self_attn.q_proj.scales": "model.safetensors",
182
+ "model.layers.8.self_attn.q_proj.weight": "model.safetensors",
183
+ "model.layers.8.self_attn.v_proj.scales": "model.safetensors",
184
+ "model.layers.8.self_attn.v_proj.weight": "model.safetensors",
185
+ "model.layers.9.input_layernorm.weight": "model.safetensors",
186
+ "model.layers.9.mlp.down_proj.scales": "model.safetensors",
187
+ "model.layers.9.mlp.down_proj.weight": "model.safetensors",
188
+ "model.layers.9.mlp.gate_proj.scales": "model.safetensors",
189
+ "model.layers.9.mlp.gate_proj.weight": "model.safetensors",
190
+ "model.layers.9.mlp.up_proj.scales": "model.safetensors",
191
+ "model.layers.9.mlp.up_proj.weight": "model.safetensors",
192
+ "model.layers.9.post_attention_layernorm.weight": "model.safetensors",
193
+ "model.layers.9.self_attn.k_proj.scales": "model.safetensors",
194
+ "model.layers.9.self_attn.k_proj.weight": "model.safetensors",
195
+ "model.layers.9.self_attn.o_proj.scales": "model.safetensors",
196
+ "model.layers.9.self_attn.o_proj.weight": "model.safetensors",
197
+ "model.layers.9.self_attn.q_proj.scales": "model.safetensors",
198
+ "model.layers.9.self_attn.q_proj.weight": "model.safetensors",
199
+ "model.layers.9.self_attn.v_proj.scales": "model.safetensors",
200
+ "model.layers.9.self_attn.v_proj.weight": "model.safetensors",
201
+ "model.norm.weight": "model.safetensors"
202
+ }
203
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<s>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "</s>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_max_length": 5120,
9
+ "pad_token": "<pad>",
10
+ "tokenizer_class": "TokenizersBackend",
11
+ "unk_token": "<unk>"
12
+ }