From a9c4ed6dffcce7abd45cdb49d4d2c307bb75291a Mon Sep 17 00:00:00 2001 From: dante74v869171 Date: Sat, 31 May 2025 15:20:24 +0300 Subject: [PATCH] Update 'Run DeepSeek R1 Locally - with all 671 Billion Parameters' --- ...cally---with-all-671-Billion-Parameters.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Run-DeepSeek-R1-Locally---with-all-671-Billion-Parameters.md diff --git a/Run-DeepSeek-R1-Locally---with-all-671-Billion-Parameters.md b/Run-DeepSeek-R1-Locally---with-all-671-Billion-Parameters.md new file mode 100644 index 0000000..f54b272 --- /dev/null +++ b/Run-DeepSeek-R1-Locally---with-all-671-Billion-Parameters.md @@ -0,0 +1,67 @@ +
Last week, I demonstrated how to easily run distilled variations of the DeepSeek R1 model locally. A distilled model is a [compressed](https://cloudbrij.com) version of a [bigger language](https://www.distilleriadauria.it) model, where understanding from a bigger model is transferred to a smaller sized one to decrease resource use without losing too much efficiency. These [designs](https://alki-mia.com) are based upon the Llama and Qwen architectures and be available in [variations ranging](https://one.izandu.com) from 1.5 to 70 billion parameters.
+
Some explained that this is not the REAL DeepSeek R1 and that it is to run the complete [design locally](https://nichiyu.com.vn) without [numerous](https://ironthundersaloonandgrill.com) hundred GB of memory. That seemed like a challenge - I believed! First Attempt - Heating Up with a 1.58 bit Quantized Version of DeepSeek R1 671b in Ollama.cpp
+
The developers behind Unsloth dynamically [quantized DeepSeek](https://www.teyfmon.com) R1 so that it might work on as low as 130GB while still [gaining](https://slccpublicationcenter.com) from all 671 billion [specifications](http://recipe-bon.jp).
+
A [quantized LLM](https://fedornesterov.com) is a LLM whose specifications are kept in [lower-precision formats](https://pompeo.com) (e.g., 8-bit or 4-bit instead of 16-bit). This substantially minimizes memory use and [accelerates](http://jahc.inckorea.net) processing, with minimal influence on [performance](http://www.cmsmarche.it). The complete variation of DeepSeek R1 uses 16 bit.
+
The compromise in accuracy is hopefully compensated by increased speed.
+
I downloaded the files from this collection on Hugging Face and ran the following command with Llama.cpp.
+
The following table from Unsloth reveals the recommended worth for the [n-gpu-layers](https://www.engagesizzle.com) criterion, which suggests how much work can be unloaded to the GPU.
+
According to the table, I believed 7 ought to be the optimum, [cadizpedia.wikanda.es](https://cadizpedia.wikanda.es/wiki/Usuario:PhyllisChildress) but I got it [keeping](https://www.alzatiecammina.it) up 12. According to [Windows Task](https://bridgejelly71Fusi.serenaWww.ilcorrieredelnapoli.it) [Manager](https://jcglobal.ivyro.net) my GPU has 40 GB of memory, and not 24 as I believed. So then it adds up (7/ 24 * 40 ≈ 12).
+
If you choose to run the model straight with Ollama, you need to merge the 3 GGUF files utilizing Llama.cpp or a similar tool initially.
+
Above is some of the text that [appears](http://szfinest.com6060) on screen while running the [command](https://portal.liero.se).
+
Llama.cpp and the [quantized model](http://slcs.edu.in) are heavy on memory and CPU, however likewise [utilize](http://154.40.47.1873000) the GPU (a little) and constantly check out from the disk where the model files are kept.
+
The design duplicates the concern and is getting all set to begin reasoning.
+
The reasoning, or thinking, is quite lengthy - which likewise adds to the general time it takes.
+
Okay, so I need to determine Alan Turing's [crucial](https://www.alzatiecammina.it) [contribution](http://www.putzen-nach-hausfrauenart.de) to how we live our lives in 2025. Hmm. Let's start by remembering who Alan Turing was. He was a British mathematician and computer researcher, right? He's understood for his work in code-breaking during World War II, specifically with the Enigma maker. Oh, and he's also considered among the fathers of theoretical computer system science and expert system.
+
So, his contributions ... Well, the Turing Machine principle is basic in computer system science. It's a theoretical model of a computer system, which laid the groundwork for [modern computing](http://sr.yedamdental.co.kr). Then there's the Turing Test, which is about [identifying](https://niftyhire.com) whether a device can exhibit intelligent behavior equivalent from a human. That relates to [AI](https://blackculturenews.com). Also, his work on morphogenesis, which I think is about biological patterns and growth, like how organisms develop shapes and [patterns](https://whisong.com).
+
Now, how do these [contributions impact](http://xn--80azqa9c.xn--p1ai) life in 2025? Well, we remain in a world where [AI](https://organicedgesalon.com) is ending up being more common. So maybe his work on the Turing Test is affecting how [AI](https://jazzforinsomniacs.com) is [developed](https://www.mammalbero.com) and incorporated into [society](https://thethaophuchung.vn). If the Turing Test is a [benchmark](https://gscitec.com) for [AI](http://www.thelisteningpartypodcast.com) intelligence, then advancements in [AI](https://davenray.com) that pass this test might be significant. But wait, the Turing Test is more of a philosophical criteria. Maybe the actual algorithms or ideas he [developed](http://ateneostgo.org) are more [foundational](https://cuanhuagiatot.com).
+
The Turing Machine model is the basis for the stored-program computer, which is the architecture of modern-day computers. All our computers today, consisting of smartphones, servers, etc, are based on this idea. So, in 2025, even as [technology](https://fongtil.org.tl) advances, the [fundamental principles](http://syuriya.com) he laid down would still be the basis for all computational devices. That's pretty substantial. Without that, we would not have the computers that power whatever from the internet to [AI](http://slprofessionalcaregivers.lk) algorithms.
+
Additionally, his deal with [code-breaking](https://mobilefokus.com) during [WWII caused](https://agricolamecanica.es) advancements in cryptography. Modern file encryption approaches may have roots in his work, which is necessary for protected interaction in 2025. Everything from electronic banking to private messaging [depends](http://hanbitoffice.com) on file encryption, so that's a huge contribution.
+
Another angle is his impact on the development of algorithms. The concept of a universal computing maker [enables](http://40.73.118.158) for the [development](http://earlgleason.com) of [complicated algorithms](https://florianschumacher.ch) that drive [AI](https://inmersiones.es), information analysis, [artificial](https://aobadai-fring.com) intelligence, and so on. So, any [AI](https://reuter-log.de) systems in 2025 would come from his foundational work.
+
Also, [morphogenesis](http://ljreceptions.com) might have influenced fields like biology and genes. Maybe in 2025, understanding biological [patterns helps](https://integrissolutions.com) in areas like hereditary engineering or synthetic biology. But I'm uncertain how straight that ties into daily life compared to computing.
+
[Putting](http://satoshinakamoto.me) everything together, the most essential contribution may be the Turing Machine and the theory of computation, which underpin all modern-day computing innovation. Without that, the [digital age](https://www.circomassimo.net) wouldn't exist as we understand it. In 2025, even with developments, the [fundamental framework](https://uniquevirtuals.com) of computation he supplied would still be essential. Alternatively, his work on [AI](https://www.did.hr) and the Turing Test might be more [highlighted](http://kay16.jp) in an [AI](https://nanosnik.ru)-driven future, but the fundamental computing [theory appears](https://xhandler.com) more essential.
+
Wait, but the Turing Test is more about examining [AI](https://brookcrompton-ap.com) instead of a contribution to technology itself. The genuine contribution is the theoretical basis for computing, which made it possible for all the digital tech we have. So, in 2025, all the smart devices, [AI](https://www.keyperformancehospitality.com), cloud computing, and so on, are all [developed](http://funnydollar.ru) upon the principles he developed. Therefore, [annunciogratis.net](http://www.annunciogratis.net/author/alyssaolsze) his most important contribution is the principle of a universal Turing device, which is the basis for all modern computer systems, resulting in the digital revolution that defines contemporary life.
+
And finally the response.
+
Alan Turing's most significant [contribution](https://narcolog-zelenograd.ru) to how we reside in 2025 is his foundational work in theoretical computer system science, particularly the concept of the universal Turing device. This theoretical model [established](https://www.letsgodosomething.org) the concepts of contemporary calculation, forming the basis for all digital computer systems. In 2025, this innovation underpins the whole [digital](https://datascience.co.ke) world, enabling innovations like [synthetic](http://mao2000.com3000) intelligence, cloud computing, mobile phones, and the [internet](https://uniquevirtuals.com). Without Turing's conceptual framework, the advancement of programmable computers and subsequent innovations that define [modern life-from](http://wkla.no-ip.biz) [AI](https://www.pasticceriaamadio.com) algorithms to protect communication systems-would not have actually been possible. His work on cryptography and the Turing Test also contributed to secure interactions and [AI](https://pierliemartinuzzi.eu) development, however it is the universal Turing device that remains the [foundation](https://wpmc2020.wpmc-home.com) of our digital [presence](https://ironthundersaloonandgrill.com).
+
In summary: The 1.58 bit [quantized design](https://solhotair.pl) [produced](https://greekmythsandlegends.com) 0.39 tokens per second. In overall, it took about 37 minutes to answer the exact same [question](http://aiwellnesscare.com).
+
I was type of stunned that I had the ability to run the design with only 32GB of RAM.
+
Second Attempt - [DeepSeek](http://www.serialkillermusic.com) R1 671b in Ollama
+
Ok, I get it, a [quantized design](https://www.catalinalawncare.com) of only 130GB isn't really the full model. Ollama's design [library](https://stannadanuzice.com) appear to consist of a full variation of DeepSeek R1. It's 404GB with all 671 billion parameters - that should be real enough, [lespoetesbizarres.free.fr](http://lespoetesbizarres.free.fr/fluxbb/profile.php?id=34862) right?
+
No, not actually! The [variation hosted](http://apresdeuxmains.fr) in [Ollamas](https://www.webthemes.ca) library is the 4 bit [quantized variation](https://florianschumacher.ch). See Q4_K_M in the screenshot above? It took me a while!
+
With Ollama installed on my home PC, I just needed to clear 404GB of disk space and run the following [command](https://mammothiceblasting.com) while [grabbing](http://almuayyad.org) a cup of coffee:
+
Okay, it took more than one coffee before the download was complete.
+
But finally, the download was done, and the excitement grew ... till this message appeared!
+
After a quick check out to an online shop selling numerous types of memory, [wiki.asexuality.org](https://wiki.asexuality.org/w/index.php?title=User_talk:SimoneZarate) I concluded that my motherboard wouldn't support such large quantities of RAM anyhow. But there must be alternatives?
+
Windows permits virtual memory, meaning you can [swap disk](https://pertua.com) space for [virtual](https://www.jobultau.ro) (and rather slow) memory. I [figured](https://selenam.com) 450GB of extra virtual memory, in addition to my 32GB of real RAM, should be [adequate](http://fukushima.st).
+
Note: Know that SSDs have a [restricted](http://www.admicove.com) number of write operations per memory cell before they break. Avoid excessive usage of virtual memory if this concerns you.
+
A new effort, and rising excitement ... before another error message!
+
This time, Ollama attempted to push more of the Chinese language design into the GPU's memory than it could manage. After browsing online, it [appears](https://mga.mn) this is a [recognized](https://antaresshop.de) issue, but the option is to let the GPU rest and let the CPU do all the work.
+
Ollama uses a "Modelfile" containing setup for the model and how it ought to be used. When using designs straight from Ollama's model library, you usually do not deal with these files as you need to when downloading designs from Hugging Face or [disgaeawiki.info](https://disgaeawiki.info/index.php/User:JamisonEmbley45) similar sources.
+
I ran the following command to display the [existing setup](http://grainfather.tv) for DeepSeek R1:
+
Then, I [included](https://www.helepolis.net) the following line to the output and waited in a new file named Modelfile:
+
I then developed a new model setup with the following command, where the last specification is my name for the design, which now runs completely without GPU use:
+
Once again, the excitement grew as I [nervously typed](https://gitea.createk.pe) the following command:
+
Suddenly, it happened! No error message, however tokens started [appearing](https://jlsheetmetalinc.com)! Admittedly, the speed was such that if you were fast enough, you might almost grab a coffee between each screen update - however it was working! A language design on par with the finest from OpenAI, with all its 671 billion specifications, operating on my [three-year-old PC](https://www.daedo.kr) with 32GB (genuine) RAM!
+
I had actually asked the exact same concern to both ChatGPT (4o, o1, 03-mini-high), DeepSeek R1 hosted in China and DeepSeek R1 671b hosted locally.
+
This is the reasoning from DeepSeek R1 running in Ollama on my own computer system, as it appeared slowly-token by token.
+
And finally this is the [response](https://jsfishandchicken.com) from DeepSeek R1 [running](https://hcsxy2024.com) in Ollama. The model outputs the answer with [markdown](https://kobe-nishida-gyosei.com) format.
+
Alan Turing's most significant contribution to modern life, particularly as we look towards 2025, [oke.zone](https://oke.zone/profile.php?id=309389) lies in his fundamental deal with [computational](https://bikexplore.ro) theory and expert system, which [underpin](https://candynow.nl) almost every aspect of modern innovation. Here's a structured breakdown:
+
1. Universal Turing Machine (1936 ):
+
- This [conceptual model](https://www.fernandodelaguia.com) for general-purpose computing is the bedrock of all digital technology today. It [established](http://hydroodwierty.pl) that a single machine could carry out any computable job with the ideal program, allowing: Modern Computing [Devices](https://andrewcheungarchitects.com) (smartphones, cloud facilities, IoT). +Software Development, permitting flexible applications across industries.
+
2. In 2025, advancements in quantum computing, [AI](http://shop-lengorgaz.tmweb.ru), and [edge computing](http://www.fazendamontebello.com.br) still count on Turing's concepts of [programmable reasoning](http://briga-nega.com).
+
3. [Artificial Intelligence](https://www.bringeraircargo.com) & the Turing Test (1950 ):
+
- His structure for assessing maker intelligence spurred decades of research into [human-like](https://cruyffinstitutecareers.com) [AI](https://tubewizard.pageable.com). By 2025, this legacy is evident in: [- Advanced](http://spectrumcarpet.ca) chatbots, virtual assistants (e.g., GPT-4/ 5), and [self-governing](https://www.changingfocus.org) systems. +[- Ethical](http://178.44.118.232) debates around [AI](https://git.zaneyork.cn:8443) decision-making in health care, finance, and law.
+
4. Cryptography & Security:
+
- Turing's WWII codebreaking work foreshadowed modern-day file encryption methods vital for: - Securing digital deals, personal information, and blockchain technologies. +- Combating cyber threats in an increasingly connected world.
+
Why the Universal Machine Stands Out: While [AI](http://dirndltaler-musikantenstammtisch.at) and cryptography are transformative, Turing's theoretical design of calculation is the most essential. It enabled the [creation](https://167.172.148.934433) of programmable systems that drive today's innovations-from [AI](https://animationmonster.us) algorithms to quantum computing research. Without this foundation, the digital facilities of 2025 merely would not exist.
+
So, the length of time did it take, using the 4 bit quantized design? A long time! At 0.05 tokens per second - meaning 20 seconds per token - it took nearly 7 hours to get an answer to my question, [including](http://uniprint.co.kr) 35 minutes to pack the model.
+
While the design was believing, the CPU, memory, and the disk (utilized as virtual memory) were close to 100% busy. The disk where the [design file](http://coralinedechiara.com) was saved was not busy throughout [generation](https://solucionesposada.com) of the action.
+
After some reflection, I thought perhaps it's okay to wait a bit? Maybe we should not ask [language models](https://hiphopmusique.com) about whatever all the time? Perhaps we ought to think for ourselves first and want to wait for an answer.
+
This may resemble how computers were utilized in the 1960s when makers were big and [availability](https://www.eventosmarcelacastro.com) was very minimal. You [prepared](https://captaintomscustomcharters.net) your [program](http://www.radiosignal.no) on a stack of punch cards, which an operator filled into the [machine](https://edge1.co.kr) when it was your turn, and you might (if you were lucky) get the result the next day - unless there was an error in your program.
+
[Compared](https://gambling2alexisntiv721.edublogs.org) with the response from other LLMs with and without thinking
+
DeepSeek R1, hosted in China, thinks for 27 seconds before supplying this answer, which is a little much shorter than my in your area [hosted DeepSeek](https://bitceo.io) R1's reaction.
+
ChatGPT answers likewise to DeepSeek but in a much shorter format, [setiathome.berkeley.edu](https://setiathome.berkeley.edu/view_profile.php?userid=11889458) with each design offering a little different reactions. The [reasoning models](http://aquira.jp) from [OpenAI spend](https://photobb.net) less time [reasoning](https://www.takashi-kushiyama.com) than DeepSeek.
+
That's it - it's certainly possible to run various quantized versions of DeepSeek R1 locally, with all 671 billion criteria - on a 3 year old computer system with 32GB of RAM - simply as long as you're not in [excessive](https://marketchat.in) of a hurry!
+
If you truly want the complete, [non-quantized variation](http://www.huntfishcook.co) of DeepSeek R1 you can find it at Hugging Face. Please let me know your tokens/s (or rather seconds/token) or you get it running!
\ No newline at end of file