README: architecture, split-part download, 0.2.4 requirement, DSA opt-in, M3 Ultra measurements
Browse files
README.md
CHANGED
|
@@ -4,16 +4,18 @@ base_model: zai-org/GLM-5.2
|
|
| 4 |
library_name: basert
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
---
|
| 11 |
|
| 12 |
# GLM-5.2
|
| 13 |
|
| 14 |
-
[BaseRT](https://github.com/basecompute/baseRT) `.base`
|
| 15 |
|
| 16 |
-
A 78-layer
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## Files
|
| 19 |
|
|
@@ -21,21 +23,45 @@ Q4 is 432 GB, past the Hub's per-file ceiling, so it ships as 9 parts of ≤45 G
|
|
| 21 |
|
| 22 |
| File | Precision | Size |
|
| 23 |
|------|-----------|------|
|
| 24 |
-
| `parts/GLM-5.2-Q4.base.part-000` … `part-008` | 4-bit | 432 GB total |
|
| 25 |
|
| 26 |
-
Reassemble before use:
|
| 27 |
|
| 28 |
```sh
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
shasum -a 256 GLM-5.2-Q4.base # expect e7cf483188806908f290a6eed1d96ec6a974cb3d4751a867d5c67a317646c230
|
| 31 |
```
|
| 32 |
|
| 33 |
## Usage
|
| 34 |
|
|
|
|
|
|
|
| 35 |
```bash
|
| 36 |
curl -LsSf https://basecompute.co/install.sh | sh
|
| 37 |
-
basert
|
| 38 |
-
basert
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
```
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
Released under the mit license, inherited from the base model.
|
|
|
|
| 4 |
library_name: basert
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
+
- basert
|
| 8 |
+
- apple-silicon
|
| 9 |
+
- quantized
|
| 10 |
---
|
| 11 |
|
| 12 |
# GLM-5.2
|
| 13 |
|
| 14 |
+
[BaseRT](https://github.com/basecompute/baseRT) `.base` build of [`zai-org/GLM-5.2`](https://huggingface.co/zai-org/GLM-5.2) for local inference on Apple Silicon (Metal).
|
| 15 |
|
| 16 |
+
A 78-layer mixture-of-experts reasoning model: 256 routed experts with 8 active per token plus one always-on shared expert (sigmoid gating), Multi-head Latent Attention (MLA, 64 heads over a single 576-wide latent KV row) with DeepSeek-style sparse attention (DSA), a 155k vocabulary and a 1M-token context window. The first three layers use a dense FFN.
|
| 17 |
+
|
| 18 |
+
Needs 512 GB of unified memory: the Q4 weights alone are ~418 GB resident. Apple Silicon only — the MLA/DSA kernels have no CUDA build.
|
| 19 |
|
| 20 |
## Files
|
| 21 |
|
|
|
|
| 23 |
|
| 24 |
| File | Precision | Size |
|
| 25 |
|------|-----------|------|
|
| 26 |
+
| `parts/GLM-5.2-Q4.base.part-000` … `part-008` | 4-bit (group-quantized, f16 attention norms / MLA projections) | 432 GB total |
|
| 27 |
|
| 28 |
+
Reassemble before use. The parts concatenate in order into one file; stream them so the download never needs a second 432 GB of free space:
|
| 29 |
|
| 30 |
```sh
|
| 31 |
+
for i in 0 1 2 3 4 5 6 7 8; do
|
| 32 |
+
curl -L -H "Authorization: Bearer $HF_TOKEN" \
|
| 33 |
+
"https://huggingface.co/basecompute/GLM-5.2/resolve/main/parts/GLM-5.2-Q4.base.part-00$i" >> GLM-5.2-Q4.base
|
| 34 |
+
done
|
| 35 |
shasum -a 256 GLM-5.2-Q4.base # expect e7cf483188806908f290a6eed1d96ec6a974cb3d4751a867d5c67a317646c230
|
| 36 |
```
|
| 37 |
|
| 38 |
## Usage
|
| 39 |
|
| 40 |
+
GLM 5.2 needs BaseRT 0.2.4 or newer. `basert pull` does not yet reassemble split bundles, so point the CLI at the reassembled file:
|
| 41 |
+
|
| 42 |
```bash
|
| 43 |
curl -LsSf https://basecompute.co/install.sh | sh
|
| 44 |
+
basert chat ./GLM-5.2-Q4.base
|
| 45 |
+
basert serve ./GLM-5.2-Q4.base # OpenAI-compatible HTTP server
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
DSA sparse attention is opt-in. Dense MLA is the default and matches llama.cpp's glm-dsa implementation bitwise; set `BASERT_DSA=1` to decode on the sparse top-k path once the context is deeper than the indexer's selection width (2048 tokens):
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
BASERT_DSA=1 basert serve ./GLM-5.2-Q4.base
|
| 52 |
```
|
| 53 |
|
| 54 |
+
## Measured
|
| 55 |
+
|
| 56 |
+
Mac Studio M3 Ultra (80-core GPU, 512 GB), BaseRT 0.2.4 (staging build of commit 36bd7e24), greedy, single stream, `basert bench` (pp = prompt tokens/s, tg = generated tokens/s):
|
| 57 |
+
|
| 58 |
+
| test | dense MLA | `BASERT_DSA=1` |
|
| 59 |
+
|---|---:|---:|
|
| 60 |
+
| pp512 | 236 t/s | — |
|
| 61 |
+
| tg128 | 22.9 t/s | — |
|
| 62 |
+
| pp4096 | 178 t/s | 188 t/s |
|
| 63 |
+
| tg128 after 4096 | 22.7 t/s | 22.4 t/s |
|
| 64 |
+
|
| 65 |
+
Weights resident: ~418 GB. First load after a reboot streams the whole file from disk (about 3.5 minutes on the Studio's internal SSD); a warm load is under 10 seconds. At a 4k context the sparse path is a wash — its selection width is 2048 tokens, so it only starts to pay past that, and generation is weight-bandwidth-bound at this size either way.
|
| 66 |
+
|
| 67 |
Released under the mit license, inherited from the base model.
|