MATE
Collection
2-to-4 bit CPTC-TQIR trellis-quantized checkpoints for MATE (Memory-Aligned Trellis Engine): dense, hybrid, and frontier MoE models. โข 20 items โข Updated โข 1
MATE 2-bit (2.00 bpw, 3.70 GB) | 6 GB VRAM at 32K context
| Spec | Value |
|---|---|
| Base model | NousResearch/Meta-Llama-3.1-8B-Instruct |
| Parameters | 8.0B dense |
| Quantization | 2-bit CPTC-TQIR trellis |
| Effective bpw / Size | 2.00 bpw / 3.70 GB |
| KV cache runtime | 4-bit rotated KV cache (R4KV) |
| Min GPU VRAM (32K context) | 6 GB |
| Quality (WT-2 PPL / KLD / Top-1) | 11.002 (+3.784) / 0.4850 / 73.34% |
| Variant | Min GPU (32K context) | When to Pick |
|---|---|---|
| 4b | 8 GB | Default pick for 8 GB+ GPUs; minimal perplexity drift |
| 3b | 6-8 GB | Extra headroom for long context on 8 GB GPUs |
| 2b (this repo) | 6 GB | Fastest single-stream decode and tightest 6 GB fit |
| Component (32K ctx) | FP16 KV | R4KV (4-bit) |
|---|---|---|
| Quantized weights | 4.38 GB | 4.38 GB |
| 32K KV cache | 4.00 GB | 1.12 GB (saves 2.88 GB) |
| Total (Weights + 32K KV) | 8.38 GB | 5.50 GB |
mate run)
mate run inspects your GPU/RAM, configures KV compression, offload, and speculative decoding automatically, and loads the checkpoint:
pip install mate-llm[hf]
mate run Honkware/Meta-Llama-3.1-8B-Instruct-MATE-2b --ctx 32768
mate run Honkware/Meta-Llama-3.1-8B-Instruct-MATE-2b --ctx 32768 --serve --port 8000
Query the running server via OpenAI (/v1/chat/completions) or Anthropic (/v1/messages, ANTHROPIC_BASE_URL=http://127.0.0.1:8000):
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"Honkware/Meta-Llama-3.1-8B-Instruct-MATE-2b","messages":[{"role":"user","content":"Write a C++20 lock-free ring buffer."}]}'
from mate import FastDecodeRunner, load_quantized_model
model, tokenizer = load_quantized_model("Honkware/Meta-Llama-3.1-8B-Instruct-MATE-2b")
runner = FastDecodeRunner(model, tokenizer=tokenizer, max_seq_len=32768, kv_mode="r4kv")
out = runner.generate("Explain trellis quantization in two sentences.", max_new_tokens=128)
print(tokenizer.decode(out["token_ids"], skip_special_tokens=True))
mate-serve)
cmake -S mate/csrc/runtime -B build/runtime -DCMAKE_BUILD_TYPE=Release
cmake --build build/runtime -j
./build/runtime/mate-serve --model ./Meta-Llama-3.1-8B-Instruct-MATE-2b --host 127.0.0.1 --port 8000 --max-batch 64 --max-kv-pages 1024
| Mode | Temperature | Top-P | Top-K | Notes |
|---|---|---|---|---|
| Default chat | 0.6 |
0.90 |
- |
Standard Llama-3.1-Instruct defaults; use the tokenizer chat template |
| Coding / deterministic | 0.2 |
0.90 |
- |
Lower variance for structured output and code |
At 2-bit (
2b), keep temperature at or below0.6(or add a mildmin_pfilter in your client) to suppress rare tail tokens.
Quality is evaluated on wikitext-2-raw-v1:test (seq_len=2048, BF16 ref PPL 7.217).
| Variant | bpw | Size | WT-2 PPL | KLD | Top-1 |
|---|---|---|---|---|---|
| 4b | 4.00 | 5.33 GB | 7.378 (+0.161) | 0.0277 | 93.13% |
| 3b | 3.00 | 4.51 GB | 7.894 (+0.677) | 0.1035 | 86.87% |
| 2b | 2.00 | 3.70 GB | 11.002 (+3.784) | 0.4850 | 73.34% |
lm_head, embeddings, and norms stay in BF16/FP16; linear blocks use B=64 2D-FWHT + CPTC-TQIR (trellis_depth=10).H_G, JARQ refinement, per-head V-O Hadamard folding (R2), lossless AWQ MLP smoothing, and pure KL scale distillation.trellis_gemv_v3 (dp4a + svh epilogue + Stream-K) paired with 4-bit rotated KV cache (R4KV) and 128-split Blackwell merge.| Target | Compute Path | Notes |
|---|---|---|
NVIDIA Blackwell (sm_120a) |
Native CUDA (trellis_gemv_v3, r4kv, t2tc) |
Full DP4A, PDL, Stream-K, 128-split R4KV |
NVIDIA Ada / Hopper (sm_89 / sm_90) |
Native CUDA (trellis_gemv_v3, r4kv, t2tc) |
CUDA-Graph decode and 4-bit rotated KV cache (R4KV) |
NVIDIA Ampere (sm_80 / sm_86) |
Native CUDA (trellis_gemv_v3, r4kv, e8_v3) |
DP4A GEMV and compressed KV |
| CPU x86-64 / ARM64 (AVX-512 VNNI, AVX2, NEON) | Mojo 1.2 / MAX 26.7 ops (mate/libmate.so) |
Zero libmax.so runtime dependency; optional on CUDA hosts |
| Bare-metal C++20 runtime | mate-serve + libmate_runtime.so |
Zero-Python mmap, BPE/Unigram, Jinja2, epoll HTTP/SSE |
| Field | Value |
|---|---|
| Method | CPTC-TQIR trellis quantization with sequential GPTAQ asymmetric LDLQ, YAQA 2D Kronecker H_G, JARQ refinement, per-head V-O Hadamard folding (R2), lossless AWQ MLP smoothing, and pure KL scale distillation (mode="ldlq", 64 x 512 tokens from wikitext-2-raw-v1:train+mate_prose_code_mix, disjoint from wikitext-2-raw-v1:test). |
| Base model | NousResearch/Meta-Llama-3.1-8B-Instruct |
| Bitwidth & precision | 2-bit CPTC-TQIR trellis (trellis_depth=10, B=64 2D-FWHT; lm_head, embeddings and norms kept in BF16/FP16) |
| KV cache runtime | 4-bit rotated KV cache (R4KV) |
| Engine commit | mate-llm 378ecdb |
| Raw results | eval.json |
# Weight-space MSE CLI command (calibrated LDLQ uses mate.hf.quantize_model(..., mode="ldlq")):
mate quantize NousResearch/Meta-Llama-3.1-8B-Instruct -o Meta-Llama-3.1-8B-Instruct-MATE-2b.safetensors --bits 2 --depth 10 --double-hadamard
Base model
NousResearch/Meta-Llama-3.1-8B-Instruct