Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I infotopia
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 55
    • Issues 55
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • Aliza Flinn
  • infotopia
  • Issues
  • #12

Closed
Open
Created Feb 10, 2025 by Aliza Flinn@alizaflinn3888Maintainer

Run DeepSeek R1 Locally - with all 671 Billion Parameters


Last week, I demonstrated how to quickly run distilled versions of the DeepSeek R1 design locally. A distilled design is a compressed version of a bigger language design, where knowledge from a bigger model is transferred to a smaller sized one to decrease resource use without losing excessive performance. These designs are based on the Llama and Qwen architectures and be available in variants varying from 1.5 to 70 billion specifications.

Some explained that this is not the REAL DeepSeek R1 and that it is impossible to run the complete design locally without several hundred GB of memory. That sounded like a difficulty - I believed! First Attempt - Heating Up with a 1.58 bit Quantized Version of DeepSeek R1 671b in Ollama.cpp

The designers behind Unsloth dynamically quantized DeepSeek R1 so that it could run on as low as 130GB while still gaining from all 671 billion criteria.

A quantized LLM is a LLM whose parameters are saved in lower-precision formats (e.g., 8-bit or 4-bit instead of 16-bit). This substantially minimizes memory use and speeds up processing, with very little impact on efficiency. The complete variation of DeepSeek R1 utilizes 16 bit.

The trade-off 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 shows the advised value for the n-gpu-layers parameter, which suggests just how much work can be offloaded to the GPU.

According to the table, I thought 7 need to be the optimum, however I got it running with 12. According to Windows Task Manager my GPU has 40 GB of memory, and not 24 as I thought. So then it accumulates (7/ 24 * 40 ≈ 12).

If you prefer to run the design straight with Ollama, you must combine the three GGUF files using Llama.cpp or a comparable tool first.

Above is some of the text that appears on screen while running the command.

Llama.cpp and the quantized model are heavy on memory and CPU, however also use the GPU (a little) and continuously read from the disk where the model files are kept.

The design duplicates the concern and is preparing to begin reasoning.

The thinking, or thinking, is quite lengthy - which likewise contributes to the general time it takes.

Okay, so I need to determine Alan Turing's essential contribution to how we live our lives in 2025. Hmm. Let's begin by remembering who Alan Turing was. He was a British mathematician and computer system scientist, right? He's known for his work in throughout The second world war, specifically with the Enigma machine. Oh, and he's likewise thought about one of the daddies of theoretical computer technology and expert system.

So, his contributions ... Well, the Turing Machine principle is basic in computer technology. It's a theoretical model of a computer, which laid the foundation for modern computing. Then there's the Turing Test, which has to do with identifying whether a machine can show intelligent habits indistinguishable from a human. That's related to AI. Also, his work on morphogenesis, which I think has to do with biological patterns and growth, like how organisms establish shapes and patterns.

Now, how do these contributions impact life in 2025? Well, we remain in a world where AI is ending up being more widespread. So possibly his work on the Turing Test is affecting how AI is developed and integrated into society. If the Turing Test is a benchmark for AI intelligence, then improvements in AI that pass this test might be substantial. But wait, the Turing Test is more of a philosophical benchmark. Maybe the actual algorithms or ideas he established are more fundamental.

The Turing Machine model is the basis for the stored-program computer, which is the architecture of modern computer systems. All our computer systems today, including smart devices, servers, and so on, are based on this idea. So, in 2025, even as technology advances, the fundamental principles he laid down would still be the basis for all computational gadgets. That's quite big. Without that, we would not have the computers that power everything from the internet to AI algorithms.

Additionally, his deal with code-breaking during WWII resulted in advancements in cryptography. Modern file encryption methods may have roots in his work, which is essential for secure interaction in 2025. Everything from online banking to personal messaging depends on file encryption, so that's a big contribution.

Another angle is his impact on the advancement of algorithms. The concept of a universal computing machine permits the development of complicated algorithms that drive AI, data analysis, artificial intelligence, etc. So, any AI systems in 2025 would come from his fundamental work.

Also, morphogenesis might have affected fields like biology and genes. Maybe in 2025, comprehending biological patterns helps in locations like genetic engineering or artificial biology. But I'm uncertain how straight that ties into daily life compared to computing.

Putting everything together, the most essential contribution may be the Turing Machine and the theory of computation, which underpin all contemporary computing innovation. Without that, the digital age would not exist as we know it. In 2025, even with developments, the standard framework of calculation he offered would still be necessary. Alternatively, his work on AI and the Turing Test might be more highlighted in an AI-driven future, however the fundamental computing theory seems more essential.

Wait, but the Turing Test is more about assessing AI rather than a contribution to technology itself. The genuine contribution is the theoretical basis for computing, which allowed all the digital tech we have. So, in 2025, all the smart devices, AI, cloud computing, and so on, are all built on the concepts he established. Therefore, his essential contribution is the idea of a universal Turing machine, which is the basis for all contemporary computers, causing the digital transformation that defines modern life.

And lastly the response.

Alan Turing's most considerable contribution to how we live in 2025 is his fundamental operate in theoretical computer technology, especially the idea of the universal Turing device. This theoretical design developed the concepts of contemporary computation, forming the basis for all digital computer systems. In 2025, this development underpins the whole digital world, making it possible for innovations like synthetic intelligence, cloud computing, mobile phones, and the internet. Without Turing's conceptual structure, the development of programmable computers and wiki.woge.or.at subsequent innovations that define contemporary life-from AI algorithms to secure interaction systems-would not have been possible. His work on cryptography and the Turing Test likewise added to protect communications and AI advancement, however it is the universal Turing machine that remains the foundation of our digital existence.

In summary: The 1.58 bit quantized model produced 0.39 tokens per second. In total, it took about 37 minutes to respond to the exact same question.

I was sort of shocked that I was able to run the design with only 32GB of RAM.

Second Attempt - DeepSeek R1 671b in Ollama

Ok, I get it, a quantized design of just 130GB isn't really the full model. Ollama's model library seem to include a full variation of DeepSeek R1. It's 404GB with all 671 billion specifications - that should be real enough, right?

No, not truly! The variation hosted in Ollamas library is the 4 bit quantized version. See Q4_K_M in the screenshot above? It took me a while!

With Ollama set up on my home PC, I simply required to clear 404GB of disk space and run the following command while getting a cup of coffee:

Okay, it took more than one coffee before the download was total.

But lastly, the download was done, and the enjoyment grew ... up until this message appeared!

After a fast see to an online shop selling various kinds of memory, I concluded that my motherboard wouldn't support such large quantities of RAM anyhow. But there must be options?

Windows enables for virtual memory, implying you can switch disk area for virtual (and rather sluggish) memory. I figured 450GB of extra virtual memory, in addition to my 32GB of real RAM, ought to suffice.

Note: Understand that SSDs have a limited number of write operations per memory cell before they wear. Avoid extreme usage of virtual memory if this issues you.

A brand-new effort, and rising enjoyment ... before another error message!

This time, Ollama tried to push more of the Chinese language model into the GPU's memory than it might manage. After searching online, it appears this is a recognized issue, but the service is to let the GPU rest and let the CPU do all the work.

Ollama utilizes a "Modelfile" containing configuration for the model and how it need to be utilized. When utilizing designs straight from Ollama's design library, you generally don't handle these files as you need to when downloading designs from Hugging Face or comparable sources.

I ran the following command to show the existing configuration for DeepSeek R1:

Then, I included the following line to the output and waited in a new file named Modelfile:

I then produced a new model configuration with the following command, where the last parameter is my name for the model, which now runs entirely without GPU use:

Once again, the excitement grew as I nervously typed the following command:

Suddenly, it occurred! No mistake message, but tokens started appearing! Admittedly, the speed was such that if you fasted enough, you might almost grab a coffee in between each screen upgrade - however it was working! A language model on par with the best from OpenAI, with all its 671 billion specifications, running on my three-year-old PC with 32GB (genuine) RAM!

I had asked the same concern to both ChatGPT (4o, o1, 03-mini-high), DeepSeek R1 hosted in China and DeepSeek R1 671b hosted in your area.

This is the reasoning from DeepSeek R1 running in Ollama on my own computer, as it appeared slowly-token by token.

And lastly this is the response from DeepSeek R1 running in Ollama. The design outputs the answer with markdown format.

Alan Turing's most significant contribution to modern life, particularly as we look towards 2025, depends on his foundational work on computational theory and synthetic intelligence, which underpin nearly every aspect of modern-day innovation. Here's a structured breakdown:

1. Universal Turing Machine (1936 ):

- This conceptual model for general-purpose computing is the bedrock of all digital technology today. It developed that a single device could perform any computable job with the ideal program, making it possible for: Modern Computing Devices (smartphones, cloud infrastructure, IoT). Software Development, allowing versatile applications throughout industries.

2. In 2025, advancements in quantum computing, AI, and edge computing still rely on Turing's principles of programmable logic.

3. Artificial Intelligence & the Turing Test (1950 ):

- His structure for assessing machine intelligence stimulated years of research study into human-like AI. By 2025, this tradition appears in: - Advanced chatbots, virtual assistants (e.g., GPT-4/ 5), and self-governing systems.

  • Ethical arguments around AI decision-making in health care, finance, and law.

    4. Cryptography & Security:

    - Turing's WWII codebreaking work foreshadowed contemporary encryption techniques vital for: - Securing digital transactions, individual information, and blockchain innovations.
  • Combating cyber hazards in an increasingly connected world.

    Why the Universal Machine Stands Apart: While AI and cryptography are transformative, Turing's theoretical model of computation is the most essential. It allowed the production of programmable systems that drive today's innovations-from AI algorithms to quantum computing research. Without this foundation, the digital infrastructure of 2025 just would not exist.

    So, how long 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 almost seven hours to get a response to my question, consisting of 35 minutes to fill the model.

    While the design was thinking, the CPU, memory, and the disk (used as virtual memory) were close to 100% busy. The disk where the design file was saved was not busy throughout generation of the response.

    After some reflection, I believed possibly it's fine to wait a bit? Maybe we shouldn't ask language models about whatever all the time? Perhaps we should think for ourselves initially and be ready to wait for a response.

    This might resemble how computer systems were utilized in the 1960s when machines were large and availability was really restricted. You prepared your program on a stack of punch cards, which an operator loaded into the maker when it was your turn, and you might (if you were lucky) get the result the next day - unless there was a mistake in your program.

    Compared with the response from other LLMs with and without reasoning

    DeepSeek R1, hosted in China, thinks for 27 seconds before providing this response, which is a little much shorter than my locally hosted DeepSeek R1's reaction.

    ChatGPT answers similarly to DeepSeek but in a much shorter format, with each model supplying a little various reactions. The thinking designs from OpenAI invest less time thinking than DeepSeek.

    That's it - it's certainly possible to run various quantized variations of DeepSeek R1 locally, with all 671 billion specifications - on a three years of age computer system with 32GB of RAM - simply as long as you're not in too much of a rush!

    If you truly desire the full, non-quantized version of DeepSeek R1 you can discover it at Hugging Face. Please let me understand your tokens/s (or rather seconds/token) or you get it running!
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking