Text Generation
cortiq
English
Chinese
cmf
quantized
q2tp
q4tp
mixed-precision
Mixture of Experts
hybrid-attention
2-bit
4-bit precision
Instructions to use infosave/GLM-5.3-Flash-cmf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- cortiq
How to use infosave/GLM-5.3-Flash-cmf with cortiq:
# one Rust binary, no additional dependencies cargo install cortiq-cli # or a prebuilt binary from github.com/infosave2007/cmf/releases hf download infosave/GLM-5.3-Flash-cmf --include "*.cmf" --local-dir . ls *.cmf # some repos ship more than one quantization
cortiq run FILE.cmf --prompt "What is the capital of France?"
cortiq serve FILE.cmf --port 8080 # OpenAI-compatible server
- Notebooks
- Google Colab
- Kaggle
Document GLM-5.3-Flash Q2TP and bounded runtime
Browse files
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-
|
| 39 |
-
cortiq verify glm-5.3-flash-
|
| 40 |
-
cortiq run glm-5.3-flash-
|
| 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 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
| 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 |
-
|
| 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-
|
| 109 |
CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1 \
|
| 110 |
-
cortiq run glm-5.3-flash-
|
| 111 |
--prompt "bounded forced GPU pool" --no-think
|
| 112 |
-
CMF_GPU_ADAPTER=0 cortiq run glm-5.3-flash-
|
| 113 |
--prompt "select adapter 0" --no-think
|
| 114 |
-
CMF_GLM_DYNAMIC_MOE=0 cortiq run glm-5.3-flash-
|
| 115 |
--prompt "force exact CPU MoE" --no-think
|
| 116 |
```
|
| 117 |
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 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 |
-
|
| 140 |
-
`CMF_GPU_VRAM_MB=16000 CMF_GLM_DYNAMIC_MOE=1` completed successfully
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
16
|
| 144 |
-
|
| 145 |
-
|
|
|
|
| 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 |
|