Downloads · 30 days
97
3% of all-time downloads
jmarceno/Xing4.0-29B-A4B-GGUF
Xing4.0-29B-A4B-GGUF is a machine learning model from jmarceno. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A 12.04 GiB / 3.31 BPW dynamic quantization of Xing4.0-29B-A4B (China Telecom / TeleAI, Apache-2.0), plus the importance matrix and the exact recipe used to make it — so the quant is reproducible and re-tunable.
Downloads · 30 days
97
3% of all-time downloads
All-time downloads
2.9K
Public
Repo size
13 GB
Likes
6
Public
Click a slice to open those files.
.gguf13 GB · 100%
From the Hugging Face model README
A 12.04 GiB / 3.31 BPW dynamic quantization of Xing4.0-29B-A4B (China Telecom / TeleAI, Apache-2.0), plus the importance matrix and the exact recipe used to make it — so the quant is reproducible and re-tunable.
Run it on jmarceno/llama.cpp-xing4
(branch xing4_0-port). That fork is the Xing4.0 engine plus CUDA changes that
keep q8_0/q4_0 MLA K/V quantized inside FlashAttention and keep 64-expert MoE
fusion valid. The stock shuxiaoqiong/llama.cpp xing4_0-port
binary loads this file, and it converts the whole KV cache to f16 on every
attention step. Use the fork for speed.
This repo exists because the upstream publisher ships one IQ4_NL artifact and does not publish the imatrix behind it. An imatrix cannot be recovered from a quantized GGUF (it is activation statistics, not weights), so we regenerated one from the BF16 source and built a smaller artifact. Both are here.
| file | size | what |
|---|---|---|
Xing4.0-29B-A4B-DYN-DIQ4XS-GU2XXS-Q8_0.gguf | 12.04 GiB | the quant |
imatrix-Xing4.0-29B-A4B-820chunks.gguf | 91 MB | imatrix: 592 entries, 820 chunks × 512 tokens, mixed EN/ZH/code calibration |
quantize-recipe.txt | 2 kB | exact llama-quantize invocation + per-family type map |
sha256 (quant):
d33dd4172959af2f55c458b8168ac7cc9a90a26e9e68520653ec61fc50836e75
Base ftype Q8_0, with expert families overridden:
| tensor family | type | round |
|---|---|---|
ffn_down_exps.weight | IQ4_XS | 4.50 bpw |
ffn_gate_exps.weight, ffn_up_exps.weight | IQ2_XXS | 2.06 bpw |
shared-expert FFN (ffn_{down,gate,up}_shexp.weight) | IQ4_XS | 4.50 bpw |
MLA attention, dense FFN (blocks 0-1), token_embd | Q8_0 | 8.5 bpw |
output.weight | Q6_K | 6.56 bpw |
blk.40 MTP block FFN experts / vocab tensors | IQ4_XS / IQ4_NL | — |
hc_*_fn, norms, routers, biases | BF16 / F32 (engine-protected) | — |
The down-projection gets more bits than gate/up because its output feeds the
residual stream unattenuated — the same family-level logic measured in
docs/qwen36-mix-stq-experiment.md.
Same engine, same flags, held-out WikiText-2 raw test (-c 512 --chunks 16,
English-only corpus — a caveat, the model is Chinese-centric):
| artifact | size | bpw | perplexity |
|---|---|---|---|
| upstream IQ4_NL | 20.1 GB | 4.57 | 11.4322 ± 0.509 |
| this quant | 12.04 GiB | 3.31 | 13.7041 ± 0.625 |
Speed on 2× RTX 3060 (CUDA, all layers offloaded): pp512 1100.6 t/s,
tg128 65.9 t/s; ~2.8× faster than the upstream IQ4_NL at PPL preprocessing
(2.70 s vs 7.46 s per 512-token chunk). Generation through llama-server:
52.9 t/s.
Net: 36 % smaller for +19.9 % perplexity.
xing4_0 (mHC + MLA + 64-expert MoE + MTP block) is not merged upstream yet.
Upstream support is open PR
ggml-org/llama.cpp#29012.
Build jmarceno/llama.cpp-xing4,
branch xing4_0-port. It is the vendor port plus:
GGML_CUDA_FA_INKERNEL_DEQUANT=0 restores the old path);A 2048-token greedy smoke matched the previous binary on the same prompt. The removed conversion grows with context; that is why the fork is the one to serve with. Daily KV for this quant is q8_0/q8_0, which is the shape the kernel handles.
# build https://github.com/jmarceno/llama.cpp-xing4 branch xing4_0-port, then:
./llama-server \
-m Xing4.0-29B-A4B-DYN-DIQ4XS-GU2XXS-Q8_0.gguf \
--alias xing4-29b-a4b -c 131072 --parallel 1 \
--n-gpu-layers 99 -ctk q8_0 -ctv q8_0 -fa on \
--jinja --chat-template-kwargs '{"enable_thinking":true}' \
--temp 1.0 --top-p 0.95 --repeat-penalty 1.05 \
--spec-type none
Sampling follows the model card: temp 1.0 / top_p 0.95 / repetition_penalty
1.05 for complex reasoning and general tasks, temp 0.8 for coding/agent
tasks. The card specifies no top_k, so leave it disabled. Measured VRAM on
2× 12 GB (KV q8_0/q8_0): 65536 ctx → 5.2 GiB free on the display card; 131072 →
4.5 GiB; 262144 (native max) → 3.1 GiB, but only ~305 MiB free on the second
card, so it is tight for long prefills.
# 1. BF16 GGUF from the official safetensors
python3 convert_hf_to_gguf.py /path/to/Xing4.0-29B-A4B \
--outfile Xing4.0-29B-A4B-BF16.gguf --outtype bf16
# 2. imatrix (this is the published file; collected on an IQ4_NL working model
# because the 62 GB BF16 model does not fit 24 GB VRAM + 31 GB RAM)
llama-imatrix -m Xing4.0-29B-A4B-IQ4_NL-working.gguf -f calibration.txt \
-o imatrix-Xing4.0-29B-A4B-820chunks.gguf -c 512 -ngl 999
# 3. quantize with the recipe (see quantize-recipe.txt for the full list)
llama-quantize --imatrix imatrix-Xing4.0-29B-A4B-820chunks.gguf \
--output-tensor-type q6_k --token-embedding-type q8_0 \
--tensor-type 'ffn_down_exps\.weight=iq4_xs' \
--tensor-type 'ffn_gate_exps\.weight=iq2_xxs' \
--tensor-type 'ffn_up_exps\.weight=iq2_xxs' \
... Xing4.0-29B-A4B-BF16.gguf out.gguf Q8_0
The calibration corpus was assembled round-robin from WikiText-2 raw, a source
tree, and Chinese Wikipedia extracts (12.8 MB total; 820 chunks were consumed,
≈420K tokens). The imatrix is reusable: llama-quantize --imatrix accepts it
directly for any other Xing4.0-29B-A4B recipe (IQ3_XXS, Q4 mixes, ...).
blk.40) experts are pinned to IQ4_XS / IQ4_NL because
llama-imatrix was collected with the block unloaded and has no entries for
it. llama-quantize refuses imatrix-requiring types (IQ1_/IQ2_/IQ3_XXS) on
those tensors. The upstream IQ4_NL artifact made the same choice (592 imatrix
entries). On this fork, blk.40 runs when you pass --spec-type draft-mtp;
with speculation off the loader prints unused tensor blk.40.* and skips it.llama-cli has no single-turn mode and loops on stdin EOF; use
llama-server for generation tests.Quantized and measured 2026-09-17 on 2× RTX 3060 12 GB. Base model: Xing4.0-29B-A4B, Apache-2.0, © China Telecom AI Technology Co., Ltd.