1
1
1
模型讨论区
DeepSeek-V3模型部署教程
2025-02-10 12:07:00
448

DeepSeek-V3

资源说明

运行该项目需要4x8x64GB显存,硬件配置为K100-AI。

获取项目代码

git clone http://developer.sourcefind.cn/codes/modelzoo/deepseek-v3_pytorch.git

环境准备

1、获取docker镜像

docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-ubuntu22.04-dtk24.04.3-py3.10

2、创建并运行docker容器

docker run --shm-size 500g --network=host --name=dpskv3 --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v <获取的项目代码地址>:/home/ -v /opt/hyhal:/opt/hyhal:ro -it <上一步获取的docker镜像ID> bash

注意: 可以使用    docker images  获取相应的镜像ID。

3、依赖项安装

cd /home/inference
pip install -r requirements.txt

模型准备

1、下载模型

有两种方式可下载模型分别是使用SCNet及huggingface下载,具体方式分别为

git clone http://113.200.138.88:18080/aimodels/deepseek-ai/DeepSeek-V3.git
export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download --resume-download deepseek-ai/DeepSeek-V3 --local-dir DeepSeek-V3

2、模型转换

cd inference python fp8_cast_bf16.py --input-fp8-hf-path /path/to/fp8_weights --output-bf16-hf-path /path/to/DeepSeek-V3-bf16

注意,这里的/path/to/fp8_weights就是 下载模型  部分得到的模型.

3、模型划分

python convert.py --hf-ckpt-path /path/to/DeepSeek-V3-bf16 --save-path /path/to/DeepSeek-V3-Demo --n-experts 256 --model-parallel 32

4、文件复制

cp /path/to/fp8_weights/*.json /path/to/DeepSeek-V3-Demo

运行

export NCCL_ALGO=Ring
export NCCL_PROTO=Simple

torchrun --nnodes 4 --nproc-per-node 8 --node-rank $RANK --master-addr $ADDR generate.py --ckpt-path /path/to/DeepSeek-V3-Demo --config configs/config_671B.json --interactive --temperature 0.7 --max-new-tokens 200

运行效果

attachmentId-image.png

全部评论(4)
只看楼主
S
shao
2楼
只能用pytorch:2.3.0-ubuntu22.04-dtk24.04.3-py3.10 版本的镜像吗?可以用最新的vllm:0.11吗?
2025/12/27
L
litzh
回复 @shao
可以使用新版的vllm部署,镜像下载链接:https://developer.sourcefind.cn/servicelist
2025/12/29
网
网友f2RTwE
1楼
是不支持FP8,所以将其转换为BF16来推理吗
2025/8/22
Z
zhaomy
回复 @网友f2RTwE
是的,不支持fp8,支持int8
2025/8/25
没有更多内容了
--
楼主
Level.4
0 帖子
楼主热帖
暂无数据