thetom-ai commited on
Commit
aeffb79
·
verified ·
1 Parent(s): cb73237

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +50 -32
README.md CHANGED
@@ -13,7 +13,7 @@ tags:
13
  - config-i
14
  - moe
15
  - apple-silicon
16
- quantized_by: pidtom
17
  inference: false
18
  ---
19
 
@@ -62,41 +62,59 @@ Methodology: single-pass, 200 questions (10 MMLU subjects x 20), reasoning enabl
62
  | 4.4K | ✓ | ✓ | ✓ |
63
  | 8.3K | ✓ | ✓ | ✓ |
64
 
65
- ## Speed (Apple M5 Max 128 GB, mlx-swift-lm)
66
 
67
- Speed benchmarks measured with [ekryski/mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm/tree/ek/tom-eric-moe-tuning) (`ek/tom-eric-moe-tuning` branch).
68
 
69
- | Context | Prefill (t/s) | Decode (tok/s) |
70
- |---------|---------------|----------------|
71
- | 128 | 186 | 61.4 |
72
- | 256 | 268 | 60.4 |
73
- | 512 | 254 | 59.4 |
74
- | 1024 | 292 | 57.7 |
75
- | 2048 | 312 | 55.7 |
76
- | 4096 | 318 | 52.0 |
77
- | 8192 | 303 | 46.2 |
78
- | 16384 | 271 | 38.7 |
79
 
80
- ## TurboQuant KV Cache Compression (mlx-swift-lm)
81
 
82
- KV cache compression via [ekryski/mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm/tree/ek/tom-eric-moe-tuning) (`ek/tom-eric-moe-tuning` branch). Stacks on top of Config-I weight compression for additional memory savings at long context.
 
 
 
 
 
 
 
 
 
83
 
84
- | | bf16 | turbo4 | turbo2 |
85
- |---|---|---|---|
86
- | Per token | 248 KB | 62 KB | 31 KB |
87
- | Compression | 1x | 4x (75% saved) | 8x (88% saved) |
88
- | 8K context | 1.94 GB | 0.48 GB | 0.24 GB |
89
- | 16K context | 3.88 GB | 0.97 GB | 0.48 GB |
90
- | 32K context | 7.75 GB | 1.94 GB | 0.97 GB |
91
- | 64K context | 15.50 GB | 3.88 GB | 1.94 GB |
92
- | 128K context | 31.00 GB | 7.75 GB | 3.88 GB |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  **Max context on 128 GB M5 Max** (87 GB model, ~36 GB free):
95
  - bf16 KV: **149K tokens**
96
- - turbo4 KV: **595K tokens** (4x more context)
97
- - turbo2 KV: **1.2M tokens** (8x more context)
98
 
99
- PPL of 4.604 measured with turbo4v2 KV compression active — weight compression and KV compression stack with no additional quality penalty.
100
 
101
  ## Config-I Policy (MiniMax M2.7 Adaptation)
102
 
@@ -129,12 +147,12 @@ Uniform MLX quantization produces broken output (~25% MMLU, random guessing) on
129
 
130
  ```bash
131
  pip install mlx-lm
132
- python -m mlx_lm.generate --model pidtom/MiniMax-M2.7-ConfigI-MLX --prompt "Hello"
133
  ```
134
 
135
  ```python
136
  from mlx_lm import load, generate
137
- model, tokenizer = load("pidtom/MiniMax-M2.7-ConfigI-MLX")
138
  print(generate(model, tokenizer, prompt="Hello", max_tokens=256, temp=1.0, top_p=0.95))
139
  ```
140
 
@@ -148,7 +166,7 @@ For the speed and KV compression results above, use [ekryski/mlx-swift-lm](https
148
  import MLXLLM
149
 
150
  let container = try await LLMModelFactory.shared.loadContainer(
151
- configuration: ModelConfiguration(id: "pidtom/MiniMax-M2.7-ConfigI-MLX"))
152
 
153
  let result = try await container.generate(
154
  input: .init(text: .init(tokens: tokenArray)),
@@ -164,7 +182,7 @@ git checkout ek/tom-eric-moe-tuning
164
  swift build -c release
165
 
166
  # Download the model
167
- hf download pidtom/MiniMax-M2.7-ConfigI-MLX --local-dir ~/models/MiniMax-M2.7-ConfigI-MLX
168
 
169
  # Run server
170
  .build/release/MLXServer --model ~/models/MiniMax-M2.7-ConfigI-MLX --port 8080
@@ -204,4 +222,4 @@ For MoE models like MiniMax M2.7, expert MLPs dominate parameter count but toler
204
 
205
  ---
206
 
207
- Quantized by [@pidtom](https://huggingface.co/pidtom) | [GitHub](https://github.com/TheTom) | [X](https://x.com/no_stp_on_snek) | [Sponsor](https://github.com/sponsors/TheTom)
 
13
  - config-i
14
  - moe
15
  - apple-silicon
16
+ quantized_by: thetom-ai
17
  inference: false
18
  ---
19
 
 
62
  | 4.4K | ✓ | ✓ | ✓ |
63
  | 8.3K | ✓ | ✓ | ✓ |
64
 
65
+ ## Speed (Apple M5 Max 128 GB)
66
 
67
+ All benchmarks with turbo4v2 KV compression enabled. Measured with [ekryski/mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm/tree/ek/tom-eric-moe-tuning) (`ek/tom-eric-moe-tuning` branch).
68
 
69
+ ### Prefill
 
 
 
 
 
 
 
 
 
70
 
71
+ The "Bridge" column uses a native C++ prefill path that bypasses Swift overhead for 5-48% faster prompt processing, with the biggest gains at 512-1024 token prompts.
72
 
73
+ | Context | Bridge + turbo4v2 | Swift + turbo4v2 | Swift vanilla | Bridge vs Swift turbo4 |
74
+ |---------|-------------------|------------------|---------------|------------------------|
75
+ | 128 | 199 t/s | 185 t/s | 185 t/s | +8% |
76
+ | 256 | 281 t/s | 267 t/s | 267 t/s | +5% |
77
+ | 512 | 368 t/s | 293 t/s | 293 t/s | +26% |
78
+ | 1024 | 462 t/s | 351 t/s | 351 t/s | +32% |
79
+ | 2048 | 510 t/s | 430 t/s | 430 t/s | +19% |
80
+ | 4096 | 514 t/s | 468 t/s | 468 t/s | +10% |
81
+ | 8192 | 477 t/s | 436 t/s | 436 t/s | +9% |
82
+ | 16384 | 396 t/s | 267 t/s | 267 t/s | +48% |
83
 
84
+ Note: turbo4v2 adds zero prefill overhead — Swift turbo4v2 and Swift vanilla prefill are identical.
85
+
86
+ ### Decode
87
+
88
+ | Context | Bridge + turbo4v2 | Swift + turbo4v2 |
89
+ |---------|-------------------|------------------|
90
+ | 128 | 59.2 t/s | 61.1 t/s |
91
+ | 256 | 58.7 t/s | 60.5 t/s |
92
+ | 512 | 56.6 t/s | 58.5 t/s |
93
+ | 1024 | 54.7 t/s | 57.4 t/s |
94
+ | 2048 | 53.4 t/s | 50.0 t/s |
95
+ | 4096 | 50.0 t/s | 52.1 t/s |
96
+ | 8192 | 44.4 t/s | 45.4 t/s |
97
+ | 16384 | 37.3 t/s | 36.9 t/s |
98
+
99
+ Decode is comparable between Bridge and Swift — both paths hit ~61 tok/s at short context and degrade gracefully to ~37 tok/s at 16K.
100
+
101
+ ## TurboQuant KV Cache Compression
102
+
103
+ turbo4v2 provides **5.3x KV compression** (81% memory saved) with no measurable quality or prefill speed penalty. Stacks on top of Config-I weight compression.
104
+
105
+ | Context | bf16 KV | turbo4v2 KV | Saved |
106
+ |---------|---------|-------------|-------|
107
+ | 8K | 7.9 GB | 1.5 GB | 6.4 GB |
108
+ | 16K | 15.8 GB | 3.0 GB | 12.8 GB |
109
+ | 32K | 31.6 GB | 6.0 GB | 25.6 GB |
110
+ | 64K | 63.2 GB | 11.9 GB | 51.3 GB |
111
+ | 128K | 126.4 GB | 23.9 GB | 102.5 GB |
112
 
113
  **Max context on 128 GB M5 Max** (87 GB model, ~36 GB free):
114
  - bf16 KV: **149K tokens**
115
+ - turbo4v2 KV: **595K tokens** (4x more context)
 
116
 
117
+ The full package: Config-I weights (62% smaller) + turbo4v2 KV (81% smaller) + Bridge prefill (5-48% faster). PPL of 4.604 measured with everything stacked — no additional quality penalty.
118
 
119
  ## Config-I Policy (MiniMax M2.7 Adaptation)
120
 
 
147
 
148
  ```bash
149
  pip install mlx-lm
150
+ python -m mlx_lm.generate --model thetom-ai/MiniMax-M2.7-ConfigI-MLX --prompt "Hello"
151
  ```
152
 
153
  ```python
154
  from mlx_lm import load, generate
155
+ model, tokenizer = load("thetom-ai/MiniMax-M2.7-ConfigI-MLX")
156
  print(generate(model, tokenizer, prompt="Hello", max_tokens=256, temp=1.0, top_p=0.95))
157
  ```
158
 
 
166
  import MLXLLM
167
 
168
  let container = try await LLMModelFactory.shared.loadContainer(
169
+ configuration: ModelConfiguration(id: "thetom-ai/MiniMax-M2.7-ConfigI-MLX"))
170
 
171
  let result = try await container.generate(
172
  input: .init(text: .init(tokens: tokenArray)),
 
182
  swift build -c release
183
 
184
  # Download the model
185
+ hf download thetom-ai/MiniMax-M2.7-ConfigI-MLX --local-dir ~/models/MiniMax-M2.7-ConfigI-MLX
186
 
187
  # Run server
188
  .build/release/MLXServer --model ~/models/MiniMax-M2.7-ConfigI-MLX --port 8080
 
222
 
223
  ---
224
 
225
+ Quantized by [@thetom-ai](https://huggingface.co/thetom-ai) | [GitHub](https://github.com/TheTom) | [X](https://x.com/no_stp_on_snek) | [Sponsor](https://github.com/sponsors/TheTom)