DeepSeek R1 671B backed by fast read IOPS?

Need to buy more ram to test tho sounds like a good balance of CPU and GPU.

1 Like

Hah interesting that ktransformers is blowing up suddenly in the past couple days with their teasing faster than llama.cpp.

I whipped up a rough guide and tried it out on that same 24 core Threadripper Pro w/ 256GB RAM and it did seem to inference faster. ~11 tok/sec over ~8 tok/sec w/ llama.cpp.

However, the output quality wasn’t as good using the exact same UD_Q2_K_XL as on llama.cpp, so there is something funky going on. I’m on a github thread mostly in chinese trying to follow along :sweat_smile:

But yeah it seems like their direction is to use a big dual Intel Xeon with AMX extensions, 768GB RAM, and as many 4090Ds as they need for kv-cache context length lol…

I did check and ktransformers might actually support mmap() GGUF loading, so it could work with less RAM too possibly. Haven’t tried it yet on my home rig.

ktransformers$ grep -ri 'mmap(' | grep -v website
util/custom_gguf.py:                            self.file_data_map[file_name] = np.memmap(file_name, mode = 'r')

Exciting so many folks across the world are working on reducing the barrier to entry to something less than a rack of H100s haha…

1 Like

Could you provide more details? My rig is 9554qs x2 48g 4800mhz x 24 with numa0, disable SMT. I got avg 6.8 tps via llama-bench -t 64.(671B Q8)

1 Like

Very nice rig! Welcome to the party!

We have a big thread over here with some more llama.cpp settings and examples. Some folks have had luck with --numa distribute and dialing in the exact number of CPU cores to use by searching with llama-bench --threads $(seq -s, 32 8 64) etc.

I don’t have access to such a rig, but curious what is the output on it in NPS0 with numactl --hardware ? Does it present 2 nodes, one for each socket, or really just one big single node weaved together with AMD magic?

Finally, if you have even a single CUDA GPU with 16GB VRAM or more installed, check into my ktransformers guide as folks are seeing almost 2x inference speeds with ktransformers on big MoE models over latest llama.cpp.

Keep us posted with your results!

1 Like

don’t forget big vcache and overclocked 5600 ram. with the other stuff in the other thread you’ll clear 10 tokens

we also found that with the more recent software smt on was good? iirc

3 Likes

$ numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
node 0 size: 1160391 MB
node 0 free: 332419 MB
node distances:
node 0
0: 10

In my tests, thread 64 or 80 is better;
Currently, I don’t own a GPU. Based on my research, the RTX 3080 20GB(modified) model appears to be the most cost-effective option for KT applications, priced at approximately 3,000 RMB (around $400). After discussing with friends who will test this card, I plan to purchase one soon.

2 Likes

Hi i am running 2 intel xeon Q30G, something like 8568 No HBM of course but i think i have similar issues. An maybe partly some solutions, or things to try. intel EMR switched from 4 to 2 chiplets or tiles. so each cpu with snc shows up as 2 numa nodes. With the 9480 Max you get 4 numa nodes per cpu.
Now with 1 cpu installed i get 2.7 tokens/s with SNC=Auto. (2 numa nodes per cpu). but 5.1 Tokens/s with SNC=disabled (1 numa node per cpu). So please try disabling sub numa clustering (SNC). However when i install the second cpu i get 0.5 tokens per second :slight_smile: Which maybe corresponds to your 0.9 T/s. because i expect 9480 to be faster of course.

So please if possible do me a favour and try if you can run it at only 1 cpu, and see if things get faster for you to? I have not been able to find a numa setting that with 2 cpu’s enabled gave me performance of near to 1 cpu. Strangely enough with 2 cpu’s installed all is much worse. CPU usage is always around 100% so it must be some memory thing. Most of the time i am running on 1 cpu and the other ones is on the desk. But i hope to find a solution of course. But please try it. My estimation is that you get 10 tokens/s on 1 cpu!

1 Like

in addition to my previous reply.
Best settings with dual cpu setup on lga 4677 so far.
SNC=Disable, numa=Disable, HT=Disable.
And only use 1 out of 2 cpu’s :face_with_peeking_eye:
I also received an offer for nice priced used 9480 Max.
Even it is now not performing so well, i see potential.
So i am tempted. Please report any improved performance with other settings.

1 Like

Yeah, similar here on the Dual Socket Intel Xeon 6980P.

I have a big write-up on it on the llama.cpp github discussions here:

Given this rig has no GPU on it I have not tried ktransformers (I have a guide for that on github too if you have GPU).

As we speak I’m about to try an experimental branch of:

This new fork of llama.cpp by ikawrakow has a few optimizations including MLA and repacked quants for better CPU matrix math optimizations. There is a branch that will dynamically generate MLA tensors and repack “on-the-fly” for an existing unsloth quant so you can skip the time consuming process of rolling your own quant.

I have also begun rolling my own quants and testing perplexity and slowly moving up that learning curve.

:crossed_fingers: this runs faster on the intel box. Though the ability to use both CPU sockets at the same time is yet to be added anywhere except one guy hacked llama.cpp to load the model twice (data parallel) for each NUMA node and manually pinned threads to maximize CPU cache etc (but the code is not released)…

1 Like

Hi, Thanks for the links. I am sort of new to all of this. So probably still missing a lot, but i will try to catch up in due time. I can not prioritize this topic as much as i would like to. But very happy to see that there are more people in this fight for effective dual (or multi) cpu inference. And even maybe using ssd as extended memory. Somewhere i have heared about ssd being directly accesed by the gpu, might be relevant.

The idea you mentioned with the data parallel for each numa node, reminded me of a bios setting to mirror the memory, which cuts the memory in half, but could also speed things up, cross cpu memory acces becomes as fast as native memory i guess. But when i just tried that, i get emergency mode on ubuntu. :melting_face: But it is something to try. At least as some temporary experiment, to see the performance.

1 Like

Woah that is wild, it sounds kinda like data parallel but implemented in BIOS ?? I never heard of that, might have to look into it. Though sounds like it didn’t work out of the box. Also no fun giving up so much RAM just to get both CPUs to work together.

Also some fresh benchmarks hot off the press:

numactl -N 0 -m 0 \
./build/bin/llama-bench \
    --model /mnt/ai/models/unsloth/DeepSeek-R1-GGUF/DeepSeek-R1-UD-Q2_K_XL/DeepSeek-R1-UD-Q2_K_XL-00001-of-00005.gguf \
    -ctk f16 -ctv f16 \
    -mla 2 -fa 1 \
    -amb 2048 \
    -fmoe 1 \
    -rtr 1 \
    --numa numactl \
    --threads 64,43,64,86,128,172
model size params backend threads fa mla amb rtr fmoe test t/s
deepseek2 671B Q2_K - Medium 211.03 GiB 671.03 B CPU 128 1 2 2048 1 1 pp512 147.49 ± 12.00
deepseek2 671B Q2_K - Medium 211.03 GiB 671.03 B CPU 128 1 2 2048 1 1 tg128 9.94 ± 0.00

If you want the fastest CPU only inferencing on Intel Xeon today check out this experimental branch on ik_llama.cpp project!

2 Likes