Views
No views yet
ik_llama.cpp imatrix quantization of Qwen/Qwen3.6-27B.IQ4_NL), SSM state arrays are pinned to F32, and the FFN bottleneck (ffn_down) is boosted to IQ5_KS along with the first and last 8 "sandwich" layers.wiki.test.raw with n_ctx=512 over 580 chunks:| Quant | Size | PPL |
|---|---|---|
| Hybrid IQ4_KS | 16.6 GiB | 6.9267 +/- 0.04554 |
1custom="
2# SSM State Logic
3blk\..*\.ssm_alpha\.weight=f32
4blk\..*\.ssm_beta\.weight=f32
5blk\..*\.ssm_out\.weight=q8_0
6
7# 1. Non-linear mapping strictly for attention
8blk\..*\.attn_.*\.weight=iq4_nl
9
10# 2. Sandwich boost (First 8 / Last 8) -> iq5_ks for ALL FFN tensors
11blk\.[0-7]\.ffn_.*\.weight=iq5_ks
12blk\.(5[6-9]|6[0-3])\.ffn_.*\.weight=iq5_ks
13
14# 3. Global bottleneck boost -> iq5_ks for remaining ffn_down
15blk\..*\.ffn_down\.weight=iq5_ks
16
17# 4. Fallback -> iq4_ks for remaining ffn_gate / ffn_up
18blk\..*\.ffn_.*\.weight=iq4_ks
19
20# 5. High precision anchors
21token_embd\.weight=q8_0
22output\.weight=q8_0
23"
24
25custom=$(
26 echo "$custom" | grep -v '^#' | \
27 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
28)1python llama.cpp/convert_hf_to_gguf.py \
2 --outtype bf16 \
3 --outfile ./Qwen3.6-27B-BF16.gguf \
4 /path/to/Qwen3.6-27B/1./ik_llama.cpp/build/bin/llama-quantize \
2 ./Qwen3.6-27B-BF16.gguf \
3 ./Qwen3.6-27B-Q8_0.gguf \
4 Q8_0 16GGML_CUDA_NO_PINNED=1 is used to prevent system RAM exhaustion on 24GB VRAM setups.1GGML_CUDA_NO_PINNED=1 ./ik_llama.cpp/build/bin/llama-imatrix \
2 -m ./Qwen3.6-27B-Q8_0.gguf \
3 -f /path/to/ubergarm-imatrix-calibration-corpus-v02.txt \
4 -o Qwen3.6-27B-imatrix.dat \
5 --ctx-size 512 \
6 -t 11 \
7 --fit1./ik_llama.cpp/build/bin/llama-quantize \
2 --imatrix ./Qwen3.6-27B-imatrix.dat \
3 --custom-q "$custom" \
4 ./Qwen3.6-27B-BF16.gguf \
5 ./Qwen3.6-27B-IQ4_KS.gguf \
6 IQ4_KS 161wget https://huggingface.co/datasets/ikawrakow/validation-datasets-for-llama.cpp/resolve/main/wiki.test.raw.gz
2gunzip wiki.test.raw.gz
3
4./ik_llama.cpp/build/bin/llama-perplexity \
5 -m ./Qwen3.6-27B-IQ4_KS.gguf \
6 -f ./wiki.test.raw \
7 -c 512 \
8 --chunks 580 \
9 -ngl 99 \
10 -t 11./ik_llama.cpp/build/bin/llama-server \
2 -m ./Qwen3.6-27B-IQ4_KS.gguf \
3 -c 131072 \
4 -ngl 99