Experimental mixed-precision RCO quantization of
openbmb/MiniCPM5-2B, packed as
GGUF with bit-exact RCO codes for the linear layers.
[!IMPORTANT] This GGUF uses non-standard GGML types
RCO3(44) andRCO4(45). It does not load in stock llama.cpp. Use the patched llama.cpp v0.6.0 runtime inruntime/, or applyruntime/llama.cpp-v0.6.0-rco-minicpm5.patchto a clean v0.6.0 tree. The patch was dry-run checked against a clean clone.
| Item | Value |
|---|---|
| Base model | openbmb/MiniCPM5-2B |
| Architecture | LlamaForCausalLM, 42 layers |
| Parameters | 2.52 B |
| Quantized linear parameters | 1.982 B |
| Policy | attn4: all attention + MLP up/down 4-bit, MLP gate 3-bit |
| Average linear bits | 3.733 bpw |
| Bit distribution | 42 x RCO3, 252 x RCO4 |
| Walls | token_embd.weight + output.weight in Q6_K |
| Norms | F32 (85 tensors) |
| GGUF size | 1.333 GiB (1,431,297,440 bytes) |
| Tensor payload | 1.328 GiB |
| Effective bpw including walls/norms | 4.55 |
| Group size | 128, symmetric |
| Native context | 131,072 tokens |
| Patched runtime default context | 32,768 tokens |
| License | Apache-2.0 (base model license) |
The 294 quantized linears keep the exact integer codes, BF16 scales and BF16 zero points produced by the RCO/GPTQ pipeline. There is no BF16 dequantize-requantize step between the quantizer and the GGUF.
git clone --depth 1 --branch v0.6.0 https://github.com/ggml-org/llama.cpp
cd llama.cpp
patch -p1 < /path/to/minicpm5-2b-rco-attn4-q6walls/runtime/llama.cpp-v0.6.0-rco-minicpm5.patch
# CPU
cmake -B build-cpu -DGGML_CUDA=OFF -DGGML_VULKAN=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build-cpu -j --target llama-cli llama-server llama-bench llama-perplexity
# AMD ROCm/HIP, adjust GPU_TARGETS for your GPU
cmake -B build-rocm -DGGML_HIP=ON -DGPU_TARGETS=gfx1200 \
-DGGML_CUDA=OFF -DGGML_VULKAN=OFF -DLLAMA_CURL=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build-rocm -j --target llama-cli llama-server llama-bench llama-perplexity
See runtime/README.md for patch contents and build notes.
./build-rocm/bin/llama-cli \
-m minicpm5-2b-rco-attn4-q6walls.gguf \
-ngl 99 -c 4096 -n 512 -t 8 --jinja \
-p "Explain mixed-precision quantization in two sentences."
For CPU, replace -ngl 99 with -ngl 0 and use the CPU build. The patched
runtime defaults to a 32768-token context; pass -c to change it, up to the
model metadata limit of 131072 tokens if memory allows.
llama.cpp llama-perplexity --chunks 16 -c 512 on WikiText-2 test, which
scores only the last 256 tokens of each 512-token window:
| Model / runtime | PPL |
|---|---|
| F16 control (same attn4 HF checkpoint, same export pipeline) | 15.0641 |
| RCO attn4, BF16 walls | 15.0875 |
| RCO attn4, Q6_K walls (this file) | 15.1354 |
The final file is +0.47% versus the F16 control, inside the 0.5% fidelity target. RCO with BF16 walls is +0.155%; Q6_K walls add about 0.32%. Absolute HF PPL is not directly comparable to llama.cpp: HF reports 16.3268 for the same attn4 checkpoint, while the F16 control GGUF reports 15.0641 under the llama.cpp protocol. Use the F16 control for like-for-like comparisons.
On the full WikiText-2 test (277 x 1024, 283,371 scored tokens), the HF attn4 checkpoint with BF16 walls is 16.7418 versus 15.7711 for the original BF16 model: +6.16%.
Release-machine numbers. GPU: AMD Radeon RX 9060 XT 16 GB, gfx1200, ROCm 7.x. CPU: AMD Ryzen 9 7950X, 16 threads.
| Backend | Test | t/s |
|---|---|---|
ROCm/HIP, -ngl 99 |
pp16000 | 917 |
ROCm/HIP, -ngl 99 |
tg256 | 129 |
CPU, -ngl 0 |
tg256 | 27.8 |
The whole 1.33 GiB model fits in VRAM with room for a large KV cache. The RCO GPU path is MMVQ-only; there is no RCO MMQ/tensor-core path in this patch, and prompt batches are split into 8-column chunks. Re-run on your own hardware:
./build-rocm/bin/llama-bench \
-m minicpm5-2b-rco-attn4-q6walls.gguf \
-ngl 99 -p 16000 -n 256 -t 8 -r 3
Raw benchmark notes are in
metadata/benchmarks/.
The policy is fixed per projection type, not searched per layer:
| Module | Bits | GGML type |
|---|---|---|
self_attn.q_proj, k_proj, v_proj, o_proj |
4 | RCO4 |
mlp.up_proj, mlp.down_proj |
4 | RCO4 |
mlp.gate_proj |
3 | RCO3 |
metadata/assign_attn4.json.metadata/layer_bitwidths.csv.RCO block format: 128 weights share a BF16 scale d, a BF16 zero point z,
and packed 3/4-bit codes. Dequantization is y = d * (q - z). See
docs/QUANTIZATION.md for the full format and
verification details.
| Path | Description |
|---|---|
minicpm5-2b-rco-attn4-q6walls.gguf |
The quantized model |
runtime/llama.cpp-v0.6.0-rco-minicpm5.patch |
Runtime patch against llama.cpp v0.6.0 |
runtime/README.md |
Apply/build/verify instructions |
metadata/final_summary.json |
Machine-readable metrics |
metadata/assign_attn4.json |
Exact per-layer assignment |
metadata/layer_bitwidths.csv |
Human-readable assignment |
metadata/benchmarks/ |
Benchmark notes and commands |
docs/USAGE.md |
CLI/server usage |
docs/QUANTIZATION.md |
Quantization and parity details |
docs/RAPOR.tr.md |
Turkish experiment report |
SHA256SUMS |
Checksums |
openbmb/MiniCPM5-2B