250 points · by olalonde · 1y ago · 192 comments
And since X sucks today just about as much as it sucked yesterday: https://nitter.poast.org/carrigmat/status/188424436990727810...
https://www.dailydot.com/debug/poast-hack-leaked-emails-dms/
We need Nitter and BitTorrent to have a baby, p2p so we can share the load.
It's probably for the same reason I can't view many other sites like Reddit, Imgur etc, because our VPN exit IP is from a cloud hosting provider.
I just finished a test of running this Deepseek-R1 768 GB model locally on a cluster of computers with 800 GB/s memory bandwidth (faster than the machine in the twitter post) and I can now extrapolate to a cluster with 6000 GB/s aggregate memory bandwidth and I'm sure we can reach higher speeds than Groq and Cerebras [1] on these large models.
We might even be cheap enough in OPEX to retrain these models.
Would anyone with cofounder or commercial skills be willing to set up this hosting service with me, it will take less than $30K investment but could be profitable in weeks?
[1] https://hc2024.hotchips.org/assets/program/conference/day2/7...
Given the propensity for these big tech companies to hoover up/steal any information they can gather, running these models locally, with local fine tuning looks quite attractive.
at the end of the day you still have to sell this product to the sorts of companies that are far and away all microsoft 365/google workspace clients and we're gonna have to figure that out one day or another
think inside the box
As someone not familiar with investment sourcing or SME financing. Could you break down the maths/accounting? How do you go from sinking 40k in a business to losing 6.5k if you turn the lights off at the end?
In my house I currently have almost 900 GB/S memory bandwidth in aggregate but only 132 GB total DRAM.
Especially because these models <think> for a long bit before actually answering, so they generate for a longer period. (to be clear - I find the <think> section useful, but it also means waiting for more tokens)
Personally - I end up moving down to lower quality models (quants/less params) until I hit about 15 tokens/second. For chat, that seems to be the magical spot where I stop caring and it's "fast enough" to keep me engaged.
For inline code helpers (ex - copilot) you really need to be up near 30 tokens/second to make it feel fast enough to be helpful.
For DeekSeek 1 token ~= 3 English characters.
See: https://api-docs.deepseek.com/quick_start/token_usage/
It comes out to around 1-3 words/second. This is not so slow that it's maddening (ex 2 token/second is frustratingly slow, like walk away and make coffee while it's answering slow), but it's still slow enough to make it hard to functionally use and not break flow state. You get bored and distracted reading at that pace.
I'll ask it to do a task, then it will do it in a few steps and notify me when it's done. I use that time to take care of something else.
[0] direct link with login https://x.com/carrigmat/status/1884244369907278106
[1] alt link without login but with ads https://threadreaderapp.com/thread/1884244369907278106.html
Edit: someone posted xcancel link above - no ads https://xcancel.com/carrigmat/status/1884244369907278106
It's going to take some time, but the farce is gone. We'll have parity to Chat GPT on consumer hardware soon enough. 6k is still too much. I suspect the community will be able to get this down to 2K.
I'm tempted to cancel my Chat GPT subscription!
Not every single person needs to have it. But if someone in your circle has the needed hardware...
https://www.newegg.com/p/N82E16819113866
https://www.newegg.com/supermicro-h13ssl-nt-amd-epyc-9004-se...
As for memory, these two kits should work (both are needed for the full 12 DIMMs):
https://www.newegg.com/owc-256gb/p/1X5-005D-001G0
https://www.newegg.com/owc-512gb/p/1X5-005D-001G4
Since it would be a 2DPC configuration, the memory would be limited to 4400MT/sec unless you overclock it. That would give 422.4GB/sec, which should be enough to run the full model at 11 tokens per second according to a simple napkin math calculation. In practice, it might not run that fast. If the memory is overclocked, getting to 16 tokens per second might be possible (according to napkin math).
The subtotal for the linked parts alone is $5,139.98. It should stay below $6000 even after adding the other things needed, although perhaps it would be more after tax.
Note that I have not actually built this to know how it works in practice. My description here is purely hypothetical.
> Also, an important tip: Go into the BIOS and set the number of NUMA groups to 0. This will ensure that every layer of the model is interleaved across all RAM chips, doubling our throughput. Don't forget!
This does not actually make sense. It is well known that there is a penalty for accessing memory attached to a different CPU. You don’t get more bandwidth from disabling the NUMA node information and his token generation performance reflects that. If there was a doubling effect from using two CPU sockets, he should be getting twice the performance, but he is not.
Additionally, llama.cpp’s NUMA support is suboptimal, so he is likely taking a performance hit:
https://github.com/ggerganov/llama.cpp/issues/11333
When llama.cpp fixes its NUMA support, using two sockets should be no worse than using one socket, but it will not become better unless some new way of doing the calculations is devised that benefits from NUMA. This might be possible (particularly if you can get GEMV to run faster using NUMA), but it is not how things are implemented right now.
Also how much would stuffing a GPU or 3 (3090/4090) improve speeds, even with heavy CPU layer offloading, or would the penalty be too big? I know in some cases you're swapping data into the GPU, but in others you're just doing parts on the CPU. I'm curious what the comparison for speed would be.
Since tensor cores are so fast you still come out ahead when you send the weights over PCIE to the GPU and return the completed products back to main memory.
Complete hardware + software setup for running Deepseek-R1 locally. The actual model, no distillations, and Q8 quantization for full quality. Total cost, $6,000. All download and part links below:
Motherboard: Gigabyte MZ73-LM0 or MZ73-LM1. We want 2 EPYC sockets to get a massive 24 channels of DDR5 RAM to max out that memory size and bandwidth. https://t.co/GCYsoYaKvZ
CPU: 2x any AMD EPYC 9004 or 9005 CPU. LLM generation is bottlenecked by memory bandwidth, so you don't need a top-end one. Get the 9115 or even the 9015 if you really want to cut costs https://t.co/TkbfSFBioq
RAM: This is the big one. We are going to need 768GB (to fit the model) across 24 RAM channels (to get the bandwidth to run it fast enough). That means 24 x 32GB DDR5-RDIMM modules. Example kits: https://t.co/pJDnjxnfjg https://t.co/ULXQen6TEc
Case: You can fit this in a standard tower case, but make sure it has screw mounts for a full server motherboard, which most consumer cases won't. The Enthoo Pro 2 Server will take this motherboard: https://t.co/m1KoTor49h
PSU: The power use of this system is surprisingly low! (<400W) However, you will need lots of CPU power cables for 2 EPYC CPUs. The Corsair HX1000i has enough, but you might be able to find a cheaper option: https://t.co/y6ug3LKd2k
Heatsink: This is a tricky bit. AMD EPYC is socket SP5, and most heatsinks for SP5 assume you have a 2U/4U server blade, which we don't for this build. You probably have to go to Ebay/Aliexpress for this. I can vouch for this one: https://t.co/51cUykOuWG
And if you find the fans that come with that heatsink noisy, replacing with 1 or 2 of these per heatsink instead will be efficient and whisper-quiet: https://t.co/CaEwtoxRZj
And finally, the SSD: Any 1TB or larger SSD that can fit R1 is fine. I recommend NVMe, just because you'll have to copy 700GB into RAM when you start the model, lol. No link here, if you got this far I assume you can find one yourself!
And that's your system! Put it all together and throw Linux on it. Also, an important tip: Go into the BIOS and set the number of NUMA groups to 0. This will ensure that every layer of the model is interleaved across all RAM chips, doubling our throughput. Don't forget!
Now, software. Follow the instructions here to install llama.cpp https://t.co/jIkQksXZzu
Next, the model. Time to download 700 gigabytes of weights from @huggingface! Grab every file in the Q8_0 folder here: https://t.co/9ni1Miw73O
Believe it or not, you're almost done. There are more elegant ways to set it up, but for a quick demo, just do this. llama-cli -m ./DeepSeek-R1.Q8_0-00001-of-00015.gguf --temp 0.6 -no-cnv -c 16384 -p "<|User|>How many Rs are there in strawberry?<|Assistant|>"
If all goes well, you should witness a short load period followed by the stream of consciousness as a state-of-the-art local LLM begins to ponder your question:
And once it passes that test, just use llama-server to host the model and pass requests in from your other software. You now have frontier-level intelligence hosted entirely on your local machine, all open-source and free to use!
And if you got this far: Yes, there's no GPU in this build! If you want to host on GPU for faster generation speed, you can! You'll just lose a lot of quality from quantization, or if you want Q8 you'll need >700GB of GPU memory, which will probably cost $100k+
The memory bandwidth might be an issue, and it would be a pretty small percentage of the model, but I'd guess the speedup would be apparent.
Maybe not worth the few thousand for the card + more power/cooling/space, of course.
Because in 2x CPU system, the model may have to be passed via NUMA, which has 10% - 30% of memory bandwidth bandwidth
I'm not so convinced that the Nvidia panic is justified.
I think this is a deeper question about the bounds of human desire... which seem virtually limitless. We seem to have an unlimited appetite for answering questions on the complexity of existence. Pair that with arms race issues, and you have an obvious need for massive compute regardless of how efficient the algorithms are.
How about the amount of compute to take a buggy hextree implementation I've been poking at for a few years and completely rewrite it into a fully functioning implementation (with test cases) without me having to write a single line of code? Well...other than me having to break out the printf debugger to help with tracking down some deep bugs that is.
I've been trying to get the original implementation to work correctly for so long I don't even remember what I wanted to use it for in the first place, I just mess with it a bit here and there when I have nothing better to do.
And that's just me, a half-assed self-taught junior woodchuck coder, playing around to see what all the hype is about.
I can only imagine that I'm giving them valuable training data as some of the bugs were very deep and took a whole lot of 'thinking' to track down the root cause. It does take a bit of prodding to get it to look in the right place but so far it has found and fixed them all. The last bug was an overflow in the tree iterator's stack it uses to track state across iterations that I was concerned would time out as it was thinking for a long, long time.
I'm not really one to defend the robots but this one is actually uesful.
--edit--
Oh... I guess that's a meme now. Nothing to see here, move along...
I do agree that it's very funny though.
You need to think really hard to get to an answer, because that’s more fine grained than the way you usually think about words and letters.
And M4 Ultra Mac Pros are probably only weeks away too.
That said, a similar upgrade has been done on the raspberry pi 4, so it is theoretically possible:
https://hackaday.com/2023/03/05/upgrade-ram-on-your-pi-4-the...
(You don’t have to take it from me: if CPU were good enough, AMD’s valuation would be 100x its current value.)
https://github.com/ggerganov/llama.cpp/issues/11333
The TLDR is that llama.cpp’s NUMA support is suboptimal, which is hurting performance versus what it should be on this machine. A single socket version likely would perform better until it is fixed. After it is fixed, a dual socket machine would likely run at the same speed as a single socket machine.
If someone implemented a GEMV that scales with NUMA nodes (i.e. PBLAS, but for the data types used in inference), it might be possible to get higher performance from a dual socket machine than we get from a single socket machine.
v3 yes w/ 37B activated params, yes, but terrible on 405B as it's a dense model.
These guys say they got really good results with 2.51-bit quantization of the original R1. The original has 671B params weighing in at 720GB - that's what they're running on this $6000 setup. According to these guys[0] they get really good results at 2.51bit quantization which would be this model[1] which is still 671B params, but weighs in at 212GB.
[0] https://unsloth.ai/blog/deepseekr1-dynamic [1] https://huggingface.co/unsloth/DeepSeek-R1-GGUF/tree/main/De...
Not completely clear what changing numa nodes per socket from 1 to 0 does, possibly gives linux less information about when to migrate threads across x64 cores? (didn't upset llvm compile time so I'll leave it on nsp0)
If I wanted to run a production-grade service using the full Deepseek model, with good tokens/sec and the ability to serve concurrent requests, what sort of hardware are we looking at?
This is going to drop by half when Nvidia starts shipping DIGITS. I think we’re all going to want one. It’ll probably have a much bigger impact than Apple VisionPro, that costs the same.
I can already think of using it as a much more intelligent local Siri/Alexa to control devices. It’s something that can actually keep the kids engaged with useful trivia/knowlege (better than watching mindless trash on YT) or it can just humour me whenever I want - all without needing to worry about privacy.
Hopefully this year's M4 Ultra systems will at least allow a much higher top spec.
Apple is going in the direction of total integration. Louis Rossmann and iFixit will hem and haw, but soon there will be a MacBook whose motherboard, besides cooling, PSU, and ports, consists simply of a single component that houses CPU, GPU, RAM, storage, I/O port controllers, radios (wifi, Bluetooth, etc.), firmware for all of the above, and a security module plus keys, all directly on the CPU bus, and it will be glorious. It will absolutely lap any PC laptop, and in single-core performance will smoke even high-end AMD Epyc beastbox builds because of the aggressive elimination of inter-component latency.
But there won't be a need to fix it. If it breaks you just recycle it and buy new, being sure to sync your data back from Apple Cloud -- but it probably won't break. Kinda like how unibody cars are both safer and more reliable than the much more fixable cars of the 60s, even if they crumple like tinfoil and must be totaled upon experiencing any sort of impact.
Source: first figure from https://www.anandtech.com/show/17024/apple-m1-max-performanc...
Now this is basically the moment of Apache/ngnix being free and open source.
You then have share hosting phenomenon out of it.
But that's fixable.
Since it's memory bound, it might be possible to reach 15 tok/sec with this build.
> ...if you want Q8 you'll need >700GB of GPU memory, which will probably cost $100k+
Now it makes sense.
Still undecided how I feel about having the ability to use all that quality in the full size model if one could only retrieve it at 6-8 tokens per second.
Screenshots or mirrors (without the login requirement) are okay.
Nitter Chrome redirection extension: https://chromewebstore.google.com/detail/nitter-redirect/moh...
(I use this firefox extension to automatically rewrite twitter links into it: https://addons.mozilla.org/en-US/firefox/addon/privacy-redir... )
Once the brain dead greedy MBAs get involved, is just how much you can steal. It should all be sold short, as we watch the world burn.
$6k is much less than the millions that would be required to run anything by OpenAI. And it's a first pass. It could get much lower by the end of the year