Views
No views yet
ik_llama.cpp imatrix MLA Quantizations of DeepSeek-R1-0528ik_llama.cpp can also run your existing GGUFs from bartowski, unsloth, mradermacher, etc if you want to try it out before downloading my quants.R1 and V3 while offloading MoE layers to RAM._R4 repacked quants onto GPUs as of ik_llama.cpp PR462. So these quants are good for multi-GPU setups as well now!ik_llama.cpp quickly with your existing quants, as it computes MLA tensors and repacks quants on the fly at startup (if you have enough RAM+VRAM to fit entire model). Then come check out these fat quants here once you see the difference.r/LocalLLaMA for tips and tricks helping each other run all the fun new models!
DeepSeek-R1-0528-Q8_0 666GiB
Final estimate: PPL = 3.2130 +/- 0.01698DeepSeek-R1-0528-IQ4_KS_R4 368GiB
Final estimate: PPL = 3.2286 +/- 0.01710DeepSeek-R1-0528-IQ3_K_R4 301GiB
Final estimate: PPL = 3.2730 +/- 0.01738DeepSeek-R1-0528-IQ3_KS 282 GiB
DeepSeek-R1-0528-IQ2_K_R4 220GiB
Final estimate: PPL = 3.5069 +/- 0.01893DeepSeek-R1-0528-IQ1_S_R4 131GiB
Final estimate: PPL = 4.8805 +/- 0.02876Qwen3-235B-A22B-Q8_0 @ ~5.31 though you can't really make comparisons like this.IQ4_KS_R4 4.701 BPW (368GiB)IQ5_KS_R4 ffn_down and IQ4_KS_R4 ffn_(up|gate) routed experts. All other layers q8_0 for CPU+GPU offload. For max speed on CPU only rigs use --run-time-repack._KS quant inferencing optimizations. Made this as there were some requests for a larger size. This on might fit on 368GB RAM if you have more than average VRAM, or comfortably on a 512GB RAM rig preferably with 24GB VRAM though fine for CPU only as well.1#!/usr/bin/env bash
2
3custom="
4# Token embedding and output tensors (GPU)
5token_embd\.weight=q8_0
6output\.weight=q8_0
7output_norm\.weight=q8_0
8
9# First 3 dense layers (0-3) (GPU)
10blk\.[0-2]\..*=q8_0
11
12# All attention, weights, and bias tensors for MoE layers (3-60) (GPU)
13blk\.[3-9]\.attn_.*=q8_0
14blk\.[1-5][0-9]\.attn_.*=q8_0
15blk\.60\.attn_.*=q8_0
16
17blk\.[3-9]\.ffn_norm\.weight=q8_0
18blk\.[1-5][0-9]\.ffn_norm\.weight=q8_0
19blk\.60\.ffn_norm\.weight=q8_0
20
21blk\.[3-9]\.exp_probs_b\.bias=q8_0
22blk\.[1-5][0-9]\.exp_probs_b\.bias=q8_0
23blk\.60\.exp_probs_b\.bias=q8_0
24
25# Shared Experts (3-60) (GPU)
26blk\.[3-9]\.ffn_down_shexp\.weight=q8_0
27blk\.[1-5][0-9]\.ffn_down_shexp\.weight=q8_0
28blk\.60\.ffn_down_shexp\.weight=q8_0
29
30blk\.[3-9]\.ffn_(gate|up)_shexp\.weight=q8_0
31blk\.[1-5][0-9]\.ffn_(gate|up)_shexp\.weight=q8_0
32blk\.60\.ffn_(gate|up)_shexp\.weight=q8_0
33
34# MoE Experts (3-60) (CPU)
35blk\.[3-9]\.ffn_down_exps\.weight=iq5_ks_r4
36blk\.[1-5][0-9]\.ffn_down_exps\.weight=iq5_ks_r4
37blk\.60\.ffn_down_exps\.weight=iq5_ks_r4
38
39blk\.[3-9]\.ffn_(gate|up)_exps\.weight=iq4_ks_r4
40blk\.[1-5][0-9]\.ffn_(gate|up)_exps\.weight=iq4_ks_r4
41blk\.60\.ffn_(gate|up)_exps\.weight=iq4_ks_r4
42"
43
44custom=$(
45 echo "$custom" | grep -v '^#' | \
46 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
47)
48
49./build/bin/llama-quantize \
50 --custom-q "$custom" \
51 --imatrix /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
52 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-256x21B-0528-BF16-00001-of-00030.gguf \
53 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ4_KS_R4.gguf \
54 IQ4_KS_R4 \
55 24IQ3_K_R4 3.847 BPW (301GiB)IQ4_KS_R4 ffn_down and IQ3_K_R4 ffn_(up|gate) routed experts. All other layers q8_0 for CPU+GPU offload. For max speed on CPU only rigs use --run-time-repack.1 --n-gpu-layers 63 \
2 -ot "blk\.(3|4|5|6|7)\.ffn_.*=CUDA0" \
3 -ot "blk\.(8|9|10|11|12)\.ffn_.*=CUDA1" \
4 --override-tensor exps=CPU \
5
6llm_load_tensors: CPU buffer size = 252646.07 MiB
7llm_load_tensors: CPU buffer size = 938.98 MiB
8llm_load_tensors: CUDA0 buffer size = 33753.38 MiB
9llm_load_tensors: CUDA1 buffer size = 33900.64 MiB
10...
11llama_kv_cache_init: CUDA0 KV buffer size = 592.89 MiB
12llama_kv_cache_init: CUDA1 KV buffer size = 573.76 MiB
13llama_new_context_with_model: KV self size = 1166.62 MiB, c^KV (q8_0): 1166.62 MiB, kv^T: not used
14llama_new_context_with_model: CUDA_Host output buffer size = 0.99 MiB
15llama_new_context_with_model: pipeline parallelism enabled (n_copies=1)
16llama_new_context_with_model: CUDA0 compute buffer size = 3425.00 MiB
17llama_new_context_with_model: CUDA1 compute buffer size = 3386.00 MiB
18llama_new_context_with_model: CUDA_Host compute buffer size = 78.01 MiB1#!/usr/bin/env bash
2
3custom="
4# Token embedding and output tensors (GPU)
5token_embd\.weight=q8_0
6output\.weight=q8_0
7output_norm\.weight=q8_0
8
9# First 3 dense layers (0-3) (GPU)
10blk\.[0-2]\..*=q8_0
11
12# All attention, weights, and bias tensors for MoE layers (3-60) (GPU)
13blk\.[3-9]\.attn_.*=q8_0
14blk\.[1-5][0-9]\.attn_.*=q8_0
15blk\.60\.attn_.*=q8_0
16
17blk\.[3-9]\.ffn_norm\.weight=q8_0
18blk\.[1-5][0-9]\.ffn_norm\.weight=q8_0
19blk\.60\.ffn_norm\.weight=q8_0
20
21blk\.[3-9]\.exp_probs_b\.bias=q8_0
22blk\.[1-5][0-9]\.exp_probs_b\.bias=q8_0
23blk\.60\.exp_probs_b\.bias=q8_0
24
25# Shared Experts (3-60) (GPU)
26blk\.[3-9]\.ffn_down_shexp\.weight=q8_0
27blk\.[1-5][0-9]\.ffn_down_shexp\.weight=q8_0
28blk\.60\.ffn_down_shexp\.weight=q8_0
29
30blk\.[3-9]\.ffn_(gate|up)_shexp\.weight=q8_0
31blk\.[1-5][0-9]\.ffn_(gate|up)_shexp\.weight=q8_0
32blk\.60\.ffn_(gate|up)_shexp\.weight=q8_0
33
34# MoE Experts (3-60) (CPU)
35blk\.[3-9]\.ffn_down_exps\.weight=iq4_ks_r4
36blk\.[1-5][0-9]\.ffn_down_exps\.weight=iq4_ks_r4
37blk\.60\.ffn_down_exps\.weight=iq4_ks_r4
38
39blk\.[3-9]\.ffn_(gate|up)_exps\.weight=iq3_k_r4
40blk\.[1-5][0-9]\.ffn_(gate|up)_exps\.weight=iq3_k_r4
41blk\.60\.ffn_(gate|up)_exps\.weight=iq3_k_r4
42"
43
44custom=$(
45 echo "$custom" | grep -v '^#' | \
46 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
47)
48
49./build/bin/llama-quantize \
50 --custom-q "$custom" \
51 --imatrix /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
52 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-256x21B-0528-BF16-00001-of-00030.gguf \
53 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf \
54 IQ3_K_R4 \
55 24IQ3_KS 281.463 GiB (3.598 BPW)IQ3_KS ffn_(gate|up)_exps and IQ4_KS ffn_down_exps routed experts. Mostly iq5_ks/iq4_ks for attn and shared expert. iq5_k token_embd and iq6_k output "head".1#!/usr/bin/env bash
2
3custom="
4# First 3 dense layers (0-3) (GPU)
5# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
6blk\.[0-2]\.attn_k_b.*=q5_0
7blk\.[0-2]\.attn_.*=iq5_ks
8blk\.[0-2]\.ffn_down.*=iq5_ks
9blk\.[0-2]\.ffn_(gate|up).*=iq4_ks
10blk\.[0-2]\..*=iq5_ks
11
12# All attention, norm weights, and bias tensors for MoE layers (3-60) (GPU)
13# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
14blk\.[3-9]\.attn_k_b.*=q5_0
15blk\.[1-5][0-9]\.attn_k_b.*=q5_0
16blk\.60\.attn_k_b.*=q5_0
17
18blk\.[3-9]\.attn_.*=iq5_ks
19blk\.[1-5][0-9]\.attn_.*=iq5_ks
20blk\.60\.attn_.*=iq5_ks
21
22#blk\.[3-9]\.ffn_norm\.weight=iq5_ks
23#blk\.[1-5][0-9]\.ffn_norm\.weight=iq5_ks
24#blk\.60\.ffn_norm\.weight=iq5_ks
25
26#blk\.[3-9]\.exp_probs_b\.bias=iq5_ks
27#blk\.[1-5][0-9]\.exp_probs_b\.bias=iq5_ks
28#blk\.60\.exp_probs_b\.bias=iq5_ks
29
30# Shared Experts (3-60) (GPU)
31blk\.[3-9]\.ffn_down_shexp\.weight=iq5_ks
32blk\.[1-5][0-9]\.ffn_down_shexp\.weight=iq5_ks
33blk\.60\.ffn_down_shexp\.weight=iq5_ks
34
35blk\.[3-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
36blk\.[1-5][0-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
37blk\.60\.ffn_(gate|up)_shexp\.weight=iq4_ks
38
39# Routed Experts (3-60) (CPU)
40blk\.[3-9]\.ffn_down_exps\.weight=iq4_ks
41blk\.[1-5][0-9]\.ffn_down_exps\.weight=iq4_ks
42blk\.60\.ffn_down_exps\.weight=iq4_ks
43
44blk\.[3-9]\.ffn_(gate|up)_exps\.weight=iq3_ks
45blk\.[1-5][0-9]\.ffn_(gate|up)_exps\.weight=iq3_ks
46blk\.60\.ffn_(gate|up)_exps\.weight=iq3_ks
47
48# put last so output weight doesn't catch all the attn ones
49# Token embedding and output tensors (GPU)
50# note token_embd cannot be repacked quant type
51token_embd\.weight=iq5_k
52output\.weight=iq6_k
53"
54
55custom=$(
56 echo "$custom" | grep -v '^#' | \
57 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
58)
59
60./build/bin/llama-quantize \
61 --custom-q "$custom" \
62 --imatrix /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
63 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-256x21B-0528-BF16-00001-of-00030.gguf \
64 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_KS.gguf \
65 IQ3_KS \
66 24IQ2_K_R4 2.799 BPW (220GiB)IQ3_K_R4 ffn_down and IQ2_K_R4 ffn_(up|gate) routed experts. All other layers roughly iq5_ks for CPU+GPU offload. For max speed on CPU only rigs use --run-time-repack or manually ofline repack if you want to mmap() off disk.1#!/usr/bin/env bash
2
3# Notes:
4# https://github.com/ikawrakow/ik_llama.cpp/issues/296#issuecomment-2765210993
5# https://github.com/ikawrakow/ik_llama.cpp/issues/296#issuecomment-2768567062
6custom="
7# Token embedding and output tensors (GPU)
8# note token_embd cannot be repacked quant type
9token_embd\.weight=iq5_ks
10output\.weight=iq5_ks
11output_norm\.weight=iq5_ks
12
13# First 3 dense layers (0-3) (GPU)
14# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
15blk\.[0-2]\.attn_k_b.*=q5_0
16blk\.[0-2]\.attn_.*=iq5_ks
17blk\.[0-2]\..*=iq5_ks
18
19# All attention, norm weights, and bias tensors for MoE layers (3-60) (GPU)
20# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
21blk\.[3-9]\.attn_k_b.*=q5_0
22blk\.[1-5][0-9]\.attn_k_b.*=q5_0
23blk\.60\.attn_k_b.*=q5_0
24
25blk\.[3-9]\.attn_.*=iq5_ks
26blk\.[1-5][0-9]\.attn_.*=iq5_ks
27blk\.60\.attn_.*=iq5_ks
28
29blk\.[3-9]\.ffn_norm\.weight=iq5_ks
30blk\.[1-5][0-9]\.ffn_norm\.weight=iq5_ks
31blk\.60\.ffn_norm\.weight=iq5_ks
32
33blk\.[3-9]\.exp_probs_b\.bias=iq5_ks
34blk\.[1-5][0-9]\.exp_probs_b\.bias=iq5_ks
35blk\.60\.exp_probs_b\.bias=iq5_ks
36
37# Shared Experts (3-60) (GPU)
38blk\.[3-9]\.ffn_down_shexp\.weight=iq5_ks
39blk\.[1-5][0-9]\.ffn_down_shexp\.weight=iq5_ks
40blk\.60\.ffn_down_shexp\.weight=iq5_ks
41
42blk\.[3-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
43blk\.[1-5][0-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
44blk\.60\.ffn_(gate|up)_shexp\.weight=iq4_ks
45
46# Routed Experts (3-60) (CPU)
47blk\.[3-9]\.ffn_down_exps\.weight=iq3_k_r4
48blk\.[1-5][0-9]\.ffn_down_exps\.weight=iq3_k_r4
49blk\.60\.ffn_down_exps\.weight=iq3_k_r4
50
51blk\.[3-9]\.ffn_(gate|up)_exps\.weight=iq2_k_r4
52blk\.[1-5][0-9]\.ffn_(gate|up)_exps\.weight=iq2_k_r4
53blk\.60\.ffn_(gate|up)_exps\.weight=iq2_k_r4
54"
55
56custom=$(
57 echo "$custom" | grep -v '^#' | \
58 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
59)
60
61./build/bin/llama-quantize \
62 --custom-q "$custom" \
63 --imatrix /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
64 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-256x21B-0528-BF16-00001-of-00030.gguf \
65 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ2_K_R4.gguf \
66 IQ2_K_R4 \
67 24IQ2_KT Not Yet Releasediq2_kt "QTIP/exl3/trellis" style quant, but it is rather experimental and the inferencing implementation needs more time to bake. Quality wise it is slightly smaller than the above IQ2_K_R4 with slightly worse perplexity and KLD.IQ1_S_R4 130.203 GiB (1.664 BPW)
Q8_0. Lower is better.IQ1_M_R4 ffn_down and IQ1_S_R4 ffn_(up|gate) routed experts. All other layers mostly iq4_ks for CPU+GPU offload. For max speed on CPU only rigs use --run-time-repack (only appleis to the iq4_ks tensors etc.)._R4 variant which does allow for GPU offload to run.1# You can use more CUDA devices just set them all visibile and do *not* use `-ts ...` with this `-ot ...` strategy.
2CUDA_VISIBLE_DEVICES="0" \
3./build/bin/llama-server \
4 --model /mnt/raid/hf/DeepSeek-R1-0528-GGUF/IQ1_S_R4/DeepSeek-R1-0528-IQ1_S_R4-00001-of-00003.gguf \
5 --alias ubergarm/DeepSeek-R1-0528-IQ1_S_R4 \
6 --ctx-size 32768 \
7 -ctk q8_0 \
8 -mla 3 -fa \
9 -amb 256 \
10 -fmoe \
11 --n-gpu-layers 99 \
12 -ot "blk\.(3|4|5|6)\.ffn_.*=CUDA0" \
13 --override-tensor exps=CPU \
14 -rtr \
15 --parallel 1 \
16 --threads 24 \
17 --host 127.0.0.1 \
18 --port 8080
19
20llm_load_tensors: CPU buffer size = 117936.00 MiB
21llm_load_tensors: CUDA_Host buffer size = 469.99 MiB
22llm_load_tensors: CUDA0 buffer size = 17851.01 MiB
23....................................................................................................
24llama_kv_cache_init: CUDA0 KV buffer size = 2196.00 MiB
25llama_new_context_with_model: KV self size = 2196.00 MiB, c^KV (f16): 2196.00 MiB, kv^T: not used
26llama_new_context_with_model: CUDA_Host output buffer size = 0.99 MiB
27llama_new_context_with_model: CUDA0 compute buffer size = 3041.00 MiB
28llama_new_context_with_model: CUDA_Host compute buffer size = 78.01 MiB
IQ1_S so use the IQ1_S_R4 now with the recent updates supporting GPU offload and better speeds with the repacked quant on CUDA.1#!/usr/bin/env bash
2
3custom="
4# Token embedding and output tensors (GPU)
5# note token_embd cannot be repacked quant type
6token_embd\.weight=iq4_ks
7output\.weight=iq4_ks
8output_norm\.weight=iq4_ks
9
10# First 3 dense layers (0-3) (GPU)
11# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
12blk\.[0-2]\.attn_k_b.*=q4_0
13blk\.[0-2]\.attn_.*=iq4_ks
14blk\.[0-2]\..*=iq4_ks
15
16# All attention, norm weights, and bias tensors for MoE layers (3-60) (GPU)
17# Except blk.*.attn_k_b.weight is not divisible by 256 so only supports qN_0
18blk\.[3-9]\.attn_k_b.*=q4_0
19blk\.[1-5][0-9]\.attn_k_b.*=q4_0
20blk\.60\.attn_k_b.*=q4_0
21
22blk\.[3-9]\.attn_.*=iq4_ks
23blk\.[1-5][0-9]\.attn_.*=iq4_ks
24blk\.60\.attn_.*=iq4_ks
25
26blk\.[3-9]\.ffn_norm\.weight=iq4_ks
27blk\.[1-5][0-9]\.ffn_norm\.weight=iq4_ks
28blk\.60\.ffn_norm\.weight=iq4_ks
29
30blk\.[3-9]\.exp_probs_b\.bias=iq4_ks
31blk\.[1-5][0-9]\.exp_probs_b\.bias=iq4_ks
32blk\.60\.exp_probs_b\.bias=iq4_ks
33
34# Shared Experts (3-60) (GPU)
35blk\.[3-9]\.ffn_down_shexp\.weight=iq4_ks
36blk\.[1-5][0-9]\.ffn_down_shexp\.weight=iq4_ks
37blk\.60\.ffn_down_shexp\.weight=iq4_ks
38
39blk\.[3-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
40blk\.[1-5][0-9]\.ffn_(gate|up)_shexp\.weight=iq4_ks
41blk\.60\.ffn_(gate|up)_shexp\.weight=iq4_ks
42
43# Routed Experts (3-60) (CPU)
44blk\.[3-9]\.ffn_down_exps\.weight=iq1_m_r4
45blk\.[1-5][0-9]\.ffn_down_exps\.weight=iq1_m_r4
46blk\.60\.ffn_down_exps\.weight=iq1_m_r4
47
48blk\.[3-9]\.ffn_(gate|up)_exps\.weight=iq1_s_r4
49blk\.[1-5][0-9]\.ffn_(gate|up)_exps\.weight=iq1_s_r4
50blk\.60\.ffn_(gate|up)_exps\.weight=iq1_s_r4
51"
52
53custom=$(
54 echo "$custom" | grep -v '^#' | \
55 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
56)
57
58./build/bin/llama-quantize \
59 --custom-q "$custom" \
60 --imatrix /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
61 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-256x21B-0528-BF16-00001-of-00030.gguf \
62 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ1_S_R4.gguf \
63 IQ1_S_R4 \
64 24ik_llama.cpp API server for GPU+CPU1# Fits 32k context in under 24GB VRAM
2# Optional `-ser 6,1` improves speed at some cost to quality
3# Recommended sampling: --temp 0.6 --top-p 0.95
4CUDA_VISIBLE_DEVICES="0," \
5./build/bin/llama-server \
6 --model /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf \
7 --alias ubergarm/DeepSeek-R1-0528-IQ3_K_R4 \
8 --ctx-size 32768 \
9 -ctk q8_0 \
10 -mla 3 -fa \
11 -amb 512 \
12 -fmoe \
13 --n-gpu-layers 63 \
14 --override-tensor exps=CPU \
15 --parallel 1 \
16 --threads 16 \
17 --host 127.0.0.1 \
18 --port 8080ik_llama.cpp API server for MultiGPU(+CPU)1# Adjust number of routed expert layers for additional VRAM on each GPU
2# Compile with -DGGML_SCHED_MAX_COPIES=1 for multi-GPUs
3# Compile with -DGGML_CUDA_IQK_FORCE_BF16=1 if putting `_R4` tensors on GPU (for DeepSeek only)
4# (might go faster or slower with FORCE_BF16 depending on GPU model)
5# If you have extra VRAM go with `-b 4096 -ub 4096` for potential big PP gains!
6./build/bin/llama-server \
7 --model /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf \
8 --alias ubergarm/DeepSeek-R1-0528-IQ3_K_R4 \
9 --ctx-size 32768 \
10 -ctk q8_0 \
11 -mla 3 -fa \
12 -amb 512 \
13 -fmoe \
14 --n-gpu-layers 63 \
15 -ot "blk\.(3|4)\.ffn_.*=CUDA0" \
16 -ot "blk\.(5|6)\.ffn_.*=CUDA1" \
17 --override-tensor exps=CPU \
18 --parallel 1 \
19 --threads 16 \
20 --host 127.0.0.1 \
21 --port 8080ik_llama.cpp API server for CPU only# The goal for now is as much RAM bandwidth in a single NUMA node e.g.
# Use BIOS `NPS0` on AMD Epyc or single socket of Intel Xeon in BIOS `SNC=Disable` & Snoop Interleave
# Tune your `--threads` for token generation, and `--threads-batch` for prompt processing (prefill)
# Note `--run-time-repack` will pre-allocate enough RAM for model weights instead of mmap()'ing off disk
# Note there are options for both Explicit and Transparent Huge Pages with tuning discussions in [git repo](https://github.com/ikawrakow/ik_llama.cpp/pull/278#issuecomment-2746381515)
numactl -N 0 -m 0 \
./build/bin/llama-server \
--model /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf \
--alias ubergarm/DeepSeek-R1-0528-IQ3_K_R4 \
--run-time-repack \
--ctx-size 65536 \
-ctk q8_0 \
-mla 3 -fa \
-amb 512 \
-fmoe \
--parallel 1 \
--threads 88 \
--threads-batch 128 \
--numa numactl \
--host 127.0.0.1 \
--port 8080standard_cal_data in addition to my usual calibration_data_v5_rc.txt linked below.1cat calibration_data_v5_rc.txt > ubergarm-imatrix-calibration-corpus-v02.txt
2cat c4.utf8 >> ubergarm-imatrix-calibration-corpus-v02.txt
3cat code.utf8 >> ubergarm-imatrix-calibration-corpus-v02.txt
4cat multilingual.utf8 >> ubergarm-imatrix-calibration-corpus-v02.txt
5cat technical.utf8 >> ubergarm-imatrix-calibration-corpus-v02.txt
6cat tiny.utf8 >> ubergarm-imatrix-calibration-corpus-v02.txt
7# Do *not* use the wiki.utf8 to avoid potential over-fitting on wiki.test.raw common test corpus
8# 1.7MiB total size of ubergarm-imatrix-calibration-corpus-v02.txt
9
10./build/bin/llama-imatrix \
11 -m /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-Q8_0.gguf \
12 -f ubergarm-imatrix-calibration-corpus-v02.txt \
13 -o /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/imatrix-DeepSeek-R1-0528.dat \
14 --verbosity 1 \
15 --ctx-size 512 \
16 --layer-similarity \
17 --threads 128Q8_0 without imatrix as the baseline against wiki.test.raw:1$ ./build/bin/llama-perplexity \
2 --model /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf \
3 -f wiki.test.raw \
4 --seed 1337 \
5 --ctx-size 512 \
6 -mla 3 -fa \
7 -amb 512 \
8 -fmoe \
9 --n-gpu-layers 63 \
10 -ot "blk\.(3|4|5|6|7|8)\.ffn_.*=CUDA0" \
11 -ot "blk\.(9|10|11|12|13)\.ffn_.*=CUDA1" \
12 --override-tensor exps=CPU \
13 --threads 24
14
15Final estimate: PPL = 3.2730 +/- 0.017381$ ./build/bin/llama-gguf-split \
2 --dry-run \
3 --split \
4 --split-max-size 50G \
5 /mnt/raid/models/ubergarm/DeepSeek-R1-0528-GGUF/DeepSeek-R1-0528-IQ3_K_R4.gguf
6 /mnt/raid/hf/DeepSeek-R1-0528-GGUF/IQ3_K_R4/DeepSeek-R1-0528-IQ3_K_R4