infosave commited on
Commit
09eca95
·
verified ·
1 Parent(s): 84a2b57

Document GLM-5.3-Flash Q2TP and bounded runtime

Browse files
Files changed (1) hide show
  1. README.md +41 -28
README.md CHANGED
@@ -8,17 +8,19 @@ tags:
8
  - cmf
9
  - cortiq
10
  - quantized
 
11
  - q4tp
12
  - mixed-precision
13
  - moe
14
  - hybrid-attention
 
15
  - 4-bit
16
  language:
17
  - en
18
  - zh
19
  ---
20
 
21
- # GLM-5.3-Flash Q4TP — universal CPU/GPU CMF
22
 
23
  This repository contains the **text tower** of
24
  [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash),
@@ -35,12 +37,15 @@ speculative MTP block. `cortiq info` reports 313.33B retained text parameters,
35
  and 37,534 payload tensors.
36
 
37
  ```bash
38
- hf download infosave/GLM-5.3-Flash-cmf glm-5.3-flash-q4tp.cmf --local-dir .
39
- cortiq verify glm-5.3-flash-q4tp.cmf
40
- cortiq run glm-5.3-flash-q4tp.cmf \
41
  --prompt "What is 2+2? Answer briefly." --no-think
42
  ```
43
 
 
 
 
44
  The file requires a GLM-5.3-compatible Cortiq build containing the dedicated
45
  `glm5_next` runtime. Older binaries reject this architecture instead of
46
  silently treating it as a generic Transformer. A packaged version will be
@@ -50,19 +55,23 @@ listed here after the remaining GPU release gate.
50
 
51
  | file | profile | exact size | status |
52
  |---|---|---:|---|
 
53
  | `glm-5.3-flash-q4tp.cmf` | mixed q4tp + q8_2f + f16 | 167,164,530,274 bytes (155.68 GiB) | 37,534/37,534 tensor hashes pass |
54
 
55
  SHA-256:
56
 
57
  ```text
 
58
  6bd350591e1efd9dd098a189abf603467eed8387ee38d28f805e0891cedf36c6 glm-5.3-flash-q4tp.cmf
59
  ```
60
 
61
- This is a quality-oriented mixed profile, not a uniform four-bit dump. The
62
- large routed/shared expert payloads use q4tp. Always-active KDA/DSA attention
63
- projections and both vocabulary edges use q8_2f to protect recurrent error and
64
- input-channel outliers. Small norms, routers, convolution taps, mHC controls,
65
- and other sensitive nonlinear control tensors remain f16.
 
 
66
 
67
  The source checkpoint's fine-grained E4M3 weights are decoded with their
68
  F32 `weight_scale_inv` planes using the official 128×128 tile orientation,
@@ -94,7 +103,7 @@ marker. `cortiq verify` independently checks every payload hash.
94
 
95
  ## Models larger than VRAM
96
 
97
- The 155.68 GiB file does not need to fit in VRAM. CMF keeps weights mmap-backed
98
  in host memory and detects the available adapter budget. When dynamic pooling
99
  is enabled, routed experts use a bounded global GPU pool: resident experts run
100
  on the GPU, while cache misses are completed exactly on CPU and accumulated
@@ -105,44 +114,48 @@ Useful controls:
105
 
106
  ```bash
107
  cortiq gpu
108
- CMF_GPU=0 cortiq run glm-5.3-flash-q4tp.cmf --prompt "CPU check" --no-think
109
  CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1 \
110
- cortiq run glm-5.3-flash-q4tp.cmf \
111
  --prompt "bounded forced GPU pool" --no-think
112
- CMF_GPU_ADAPTER=0 cortiq run glm-5.3-flash-q4tp.cmf \
113
  --prompt "select adapter 0" --no-think
114
- CMF_GLM_DYNAMIC_MOE=0 cortiq run glm-5.3-flash-q4tp.cmf \
115
  --prompt "force exact CPU MoE" --no-think
116
  ```
117
 
118
- For this **Q4TP** artifact, automatic mode deliberately keeps the MoE on exact
119
- CPU. On the measured host, forcing Q4TP expert pooling was substantially slower
120
- than CPU execution. Automatic dynamic pooling is therefore reserved for Q2TP
121
- gate/up tensors on supported Vulkan devices with at least a 14 GB detected
122
- budget. Explicit `CMF_GLM_DYNAMIC_MOE=1` remains available for bounded-memory
123
- compatibility testing; `CMF_GLM_DYNAMIC_MOE=0` always disables it.
124
 
125
  Measured on an RTX 3090 with dual AMD EPYC 7H12 CPUs and 32 CPU worker threads:
126
 
127
  | execution path | steady decode | notes |
128
  |---|---:|---|
 
 
 
129
  | Q4TP CPU, final run A | 1.912 tok/s | exact path, zero GPU submissions |
130
  | Q4TP CPU, final run B | 2.350 tok/s | exact path, zero GPU submissions |
131
  | Q4TP CPU, final run C | 2.207 tok/s | exact path, zero GPU submissions |
132
  | Q4TP CPU, three-run mean | **2.156 tok/s** | 1.26% below the earlier 2.184 tok/s baseline |
133
  | Q4TP forced dynamic Vulkan | **0.634 tok/s** | 40-token run, 42 submissions/token, 13.9 GB pool |
134
 
135
- The CPU result varies with NUMA placement; the three-run spread is reported
136
  instead of presenting one noisy maximum. Forced Vulkan was about 3.4× slower,
137
  which is why it is not the Q4TP default.
138
 
139
- A bounded compatibility run with
140
- `CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1` completed successfully, emitted
141
- `Hello`, and used a 9.9 GB/792-slot expert pool. Process VRAM samples peaked at
142
- 10,260 MiB on the 24 GB test card. This proves that the dynamic pool respects a
143
- 16,000 MB budget; the one-token run is not a throughput claim. CPU-only systems
144
- and smaller adapters remain valid through the exact CPU fallback. Metal will be
145
- tested from this same immutable artifact.
 
146
 
147
  ## Scope and license
148
 
 
8
  - cmf
9
  - cortiq
10
  - quantized
11
+ - q2tp
12
  - q4tp
13
  - mixed-precision
14
  - moe
15
  - hybrid-attention
16
+ - 2-bit
17
  - 4-bit
18
  language:
19
  - en
20
  - zh
21
  ---
22
 
23
+ # GLM-5.3-Flash Q2TP and Q4TP — universal CPU/GPU CMF
24
 
25
  This repository contains the **text tower** of
26
  [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash),
 
37
  and 37,534 payload tensors.
38
 
39
  ```bash
40
+ hf download infosave/GLM-5.3-Flash-cmf glm-5.3-flash-q2tp.cmf --local-dir .
41
+ cortiq verify glm-5.3-flash-q2tp.cmf
42
+ cortiq run glm-5.3-flash-q2tp.cmf \
43
  --prompt "What is 2+2? Answer briefly." --no-think
44
  ```
45
 
46
+ Replace `q2tp` with `q4tp` in these commands for the larger,
47
+ quality-oriented profile.
48
+
49
  The file requires a GLM-5.3-compatible Cortiq build containing the dedicated
50
  `glm5_next` runtime. Older binaries reject this architecture instead of
51
  silently treating it as a generic Transformer. A packaged version will be
 
55
 
56
  | file | profile | exact size | status |
57
  |---|---|---:|---|
58
+ | `glm-5.3-flash-q2tp.cmf` | mixed q2tp + q4tp + q8_2f + f16 | 116,254,068,322 bytes (108.27 GiB) | 37,534/37,534 tensor hashes pass |
59
  | `glm-5.3-flash-q4tp.cmf` | mixed q4tp + q8_2f + f16 | 167,164,530,274 bytes (155.68 GiB) | 37,534/37,534 tensor hashes pass |
60
 
61
  SHA-256:
62
 
63
  ```text
64
+ 818d997b7c19dd0da1b3424ed12d869e8ff6fc4a187154c23b08f2efc4198cde glm-5.3-flash-q2tp.cmf
65
  6bd350591e1efd9dd098a189abf603467eed8387ee38d28f805e0891cedf36c6 glm-5.3-flash-q4tp.cmf
66
  ```
67
 
68
+ Neither file is a uniform low-bit dump. In Q2TP, routed/shared expert gate and
69
+ up projections use q2tp while their down projections remain q4tp. In Q4TP,
70
+ all large routed/shared expert projections use q4tp. Both profiles preserve
71
+ always-active KDA/DSA attention projections and both vocabulary edges as
72
+ q8_2f to protect recurrent error and input-channel outliers. Small norms,
73
+ routers, convolution taps, mHC controls, and other sensitive nonlinear control
74
+ tensors remain f16.
75
 
76
  The source checkpoint's fine-grained E4M3 weights are decoded with their
77
  F32 `weight_scale_inv` planes using the official 128×128 tile orientation,
 
103
 
104
  ## Models larger than VRAM
105
 
106
+ Neither the 108.27 GiB nor the 155.68 GiB file needs to fit in VRAM. CMF keeps weights mmap-backed
107
  in host memory and detects the available adapter budget. When dynamic pooling
108
  is enabled, routed experts use a bounded global GPU pool: resident experts run
109
  on the GPU, while cache misses are completed exactly on CPU and accumulated
 
114
 
115
  ```bash
116
  cortiq gpu
117
+ CMF_GPU=0 cortiq run glm-5.3-flash-q2tp.cmf --prompt "CPU check" --no-think
118
  CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1 \
119
+ cortiq run glm-5.3-flash-q2tp.cmf \
120
  --prompt "bounded forced GPU pool" --no-think
121
+ CMF_GPU_ADAPTER=0 cortiq run glm-5.3-flash-q2tp.cmf \
122
  --prompt "select adapter 0" --no-think
123
+ CMF_GLM_DYNAMIC_MOE=0 cortiq run glm-5.3-flash-q2tp.cmf \
124
  --prompt "force exact CPU MoE" --no-think
125
  ```
126
 
127
+ Automatic mode deliberately keeps both profiles on the exact CPU MoE path. On
128
+ the measured host, bounded Vulkan expert pooling was slower for both Q2TP and
129
+ Q4TP. Explicit `CMF_GLM_DYNAMIC_MOE=1` remains available for compatibility and
130
+ experimentation; `CMF_GLM_DYNAMIC_MOE=0` always disables it. The GLM-specific
131
+ pool is limited to 20–40% of the configured physical-memory envelope, and an
132
+ explicit `CMF_GLM_EXPERT_SLOTS` value cannot bypass that cap.
133
 
134
  Measured on an RTX 3090 with dual AMD EPYC 7H12 CPUs and 32 CPU worker threads:
135
 
136
  | execution path | steady decode | notes |
137
  |---|---:|---|
138
+ | Q2TP CPU32, automatic | **2.498 tok/s** | 20-token clean run, zero GPU submissions |
139
+ | Q2TP CPU32, explicit CPU | **2.492 tok/s** | 20-token clean run |
140
+ | Q2TP forced dynamic Vulkan, 16-GB target | **1.413 tok/s** | 512 slots / 4,352 MB pool, 42 submissions/token |
141
  | Q4TP CPU, final run A | 1.912 tok/s | exact path, zero GPU submissions |
142
  | Q4TP CPU, final run B | 2.350 tok/s | exact path, zero GPU submissions |
143
  | Q4TP CPU, final run C | 2.207 tok/s | exact path, zero GPU submissions |
144
  | Q4TP CPU, three-run mean | **2.156 tok/s** | 1.26% below the earlier 2.184 tok/s baseline |
145
  | Q4TP forced dynamic Vulkan | **0.634 tok/s** | 40-token run, 42 submissions/token, 13.9 GB pool |
146
 
147
+ The Q4TP CPU result varies with NUMA placement; the three-run spread is reported
148
  instead of presenting one noisy maximum. Forced Vulkan was about 3.4× slower,
149
  which is why it is not the Q4TP default.
150
 
151
+ For Q2TP, a bounded compatibility run with
152
+ `CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1` completed successfully with the
153
+ official-template answer `4`. Its 4,352-MB/512-slot expert pool peaked at
154
+ 6,563 MiB of total sampled process VRAM on the physical 24-GB test card, safely
155
+ below 16 GiB. The automatic normal-budget run also emitted `4`, used the exact
156
+ CPU path, and peaked at 331 MiB of VRAM. CPU-only systems and smaller adapters
157
+ remain valid through the same exact fallback. Metal will be tested from these
158
+ immutable artifacts.
159
 
160
  ## Scope and license
161