4*A100 部署 deepseek-r1-671B

news/2025/2/26 17:10:33

671B_0">部署deepseek-r1-671B

使用 4*A100 部署 deepseek-r1-671b-1.58bit 大模型。

环境

  • ubuntu22.04LTS
  • cuda 12.2.0

要求

  • 内存: 256GB及以上
  • 显存: 256GB及以上(160G可以跑起来,但对于长上下文容易oom),这里是A100 80G * 4

vllm

CUDA_VISIBLE_DEVICES=0,1,2,3 /data/miniconda3/envs/llm_py311-8/bin/python -m vllm.entrypoints.openai.api_server \
--port 8001 --served-model-name Qwen2-7B-Instruct \
--model /your/671B/model/path.gguf

失败,提示错误:

python3.11/site-packages/transformers/modeling_gguf_pytorch_utils.py", line 399, in load_gguf_checkpoint
    raise ValueError(f"GGUF model with architecture {architecture} is not supported yet.")
ValueError: GGUF model with architecture deepseek2 is not supported yet.

github上面看到vllm暂不支持deepseek-r1-671B,有各种问题,暂时放弃

llama.cpp

准备阶段

cuda需要12.0及以上,我的cuda版本是12.2.0(用docker了),我在11.5上面编译失败(可能和GPU的驱动编译方式有关,没细研究),GPU 是 A100 * 4

模型下载参考:https://www.ollama.com/SIGJNF/deepseek-r1-671b-1.58bit
或者下载:https://hf-mirror.com/unsloth/DeepSeek-R1-GGUF/tree/main/DeepSeek-R1-UD-IQ1_M

  • 拉取容器
    docker pull nvcr.io/nvidia/cuda:12.2.0-cudnn8-devel-ubuntu22.04 # 可能网络会有点问题

  • 运行容器

    docker run -it -d --name  llama_cpp --gpus all \
       -v /data/work/Star/.ollama/:/work/ollama/ \
       -v /data/work/Star/llama.cpp:/work/llama.cpp/ \
       -p 28000:8000 \
       -p 27860:7860 \
       -e TZ='Asia/Shanghai' \
       nvcr.io/nvidia/cuda:12.2.0-cudnn8-devel-ubuntu22.04
    
  • 进入容器
    docker exec -it llama_cpp env LANG=C.UTF-8 /bin/bash

##拉取代码
git clone https://github.com/ggml-org/llama.cpp

编译GPU版本

cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j16

运行服务

cd build/bin/
CUDA_VISIBLE_DEVICES=0,1,2,3  ./llama-server \
-m /path_to_model.gguf \
--port 7860 \
--cache-type-k q4_0  --threads 64  --prio 2  --temp 0.6 \
--ctx-size 8192 \
--seed 3407 \
--n-gpu-layers 1600

或者:

CUDA_VISIBLE_DEVICES=0,1,2,3 ./llama-server \
-m /path_to_model.gguf \
--port 7860 \
--host 0.0.0.0 \
-c 16384 \
-np 4 \
--n-gpu-layers 15000

更多参数配置参考:
https://github.com/ggml-org/llama.cpp/blob/master/examples/server/README.md

并发测试

5个并发:

curl --request POST     --url http://localhost:17861/completion     --header "Content-Type: application/json"     --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 12}' &
curl --request POST     --url http://localhost:17861/completion     --header "Content-Type: application/json"     --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 102}' &
curl --request POST     --url http://localhost:17861/completion     --header "Content-Type: application/json"     --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 112}' &
curl --request POST     --url http://localhost:17861/completion     --header "Content-Type: application/json"     --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 42}' &
curl --request POST     --url http://localhost:17861/completion     --header "Content-Type: application/json"     --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 32}' &

这里测试了不同输入长度及上下文长度。

参考

  1. https://github.com/ggml-org/llama.cpp
  2. https://github.com/ggml-org/llama.cpp/blob/master/examples/server/README.md
  3. https://hf-mirror.com/unsloth/DeepSeek-R1-GGUF
  4. https://www.ollama.com/SIGJNF/deepseek-r1-671b-1.58bit

http://www.niftyadmin.cn/n/5868970.html

相关文章

在 compare-form.vue 中添加 compareDate 隐藏字段,并在提交时自动填入当前时间

在 compare-form.vue 中添加 compareDate 隐藏字段,并在提交时自动填入当前时间。 提交表单时存入的对象是FakeRegistration,这个对象里面有compareDate字段,刚好表格查询的对象也是FakeRegistration,所以表格展示的时间就是刚才…

Cramér-Rao界:参数估计精度的“理论底线”

Cramr-Rao界:参数估计精度的“理论底线” 在统计学中,当我们用数据估计一个模型的参数时,总希望估计结果尽可能精确。但精度有没有一个理论上的“底线”呢?答案是有的,这就是Cramr-Rao界(Cramr-Rao Lower …

探秘分布式 IO 耦合器之高速背板总线

在工业自动化的复杂网络中,分布式 IO 耦合器扮演着关键角色,而其中的高速背板总线特性更是核心中的核心,如同一条信息高速公路,让数据传输高效又稳定。 传统的 IO 系统在数据交互时,常常面临数据拥堵、传输延迟等问题&…

Spring源码分析の循环依赖

文章目录 前言一、循环依赖问题二、循环依赖的解决三、整体流程分析 前言 常见的可能存在循环依赖的情况如下: 两个bean中互相持有对方作为自己的属性。   类似于: 两个bean中互相持有对方作为自己的属性,且在构造时就需要传入&#xff1a…

从两地三中心到多地多中心,OceanBase如何实现金融级高可用

“两地三中心”已成为金融领域基准的容灾部署模式。本文将简要阐述金融行业容灾架构中“两地三中心”的具体要求和部署,并进一步探讨OceanBase在实现“两地三中心”标准后,再至“多地多中心”部署中所展现的独特优势与特点。 商业银行的容灾要求 《商业…

智能语音机器人为电销行业带来一场革命性的变化

我们知道一个企业的发展离不开销售,因为它能直接带来盈利,所以很多企业极其重视电话销售这一模式。但随着人工智能技术的发展,许多企业都采用了智能语音机器人来替代人工,甚至替代了传统呼叫中心运/营模式,在极大提升企…

SQL SERVER日常运维巡检系列之-性能

前言 做好日常巡检是数据库管理和维护的重要步骤,而且需要对每次巡检日期、结果进行登记,同时可能需要出一份巡检报告。 本系列旨在解决一些常见的困扰: 不知道巡检哪些东西不知道怎么样便捷体检机器太多体检麻烦生成报告困难,无…

【Ambari】Ranger KMS

目录 一、Ranger KMS介绍 二、KMS基于Ranger插件安装 一、Ranger KMS介绍 Ranger KMS是把数据存储入后台数据库中。通过Ranger Admin可以集中化管理KMS服务。 Ranger KMS有三个优点 l Key management Ranger admin 提供了创建,更新,删除密钥的Web UI…