SGLang 部署 DeepSeek V3/V3.1/R1 实战指南:FP8 推理、DP Attention 优化与多节点集群配置
【免费下载链接】sglangSGLang is a high-performance serving framework for large language models and multimodal models.项目地址: https://gitcode.com/GitHub_Trending/sg/sglang
本篇指南以 benchmark/deepseek_v3/README.md 为核心,系统讲解如何使用 SGLang 从零启动 DeepSeek V3 / V3.1 / R1 系列模型的服务端,覆盖 Docker 与 pip 两种安装方式、MLA 与 DP Attention 等性能优化开关、OpenAI 兼容接口的调用(含 V3.1 的 thinking / non-thinking 逐请求切换),以及 2×H20、B200、2×H200、4×A100、多节点 int8/AWQ 量化部署等真实场景的完整命令行。读完本文,你将能够根据手头 GPU 资源与精度需求,直接复制出一套可运行的 DeepSeek 推理服务,并对底层模型实现与参数生效位置有源码级的认识。
DeepSeek 系列在 SGLang 中的支持概况
SGLang 与 DeepSeek 团队合作,在FP8 权重(NVIDIA 与 AMD GPU)上做到了发布首日即可运行DeepSeek V3。在此基础上,SGLang 还内置了两项针对 DeepSeek 模型的关键优化:
- MLA(Multi-head Latent Attention)优化:DeepSeek 系列采用 MLA 注意力机制以压缩 KV 缓存,SGLang 对其做了针对性优化(默认开启);
- DP Attention(Data Parallelism Attention):将注意力部分做数据并行、FFN 部分做张量并行,用于高 QPS 场景下提升吞吐(可选开启)。
官方 DeepSeek 团队也将 SGLang 列为推荐的推理引擎。该模型的实现与优化工作由美团搜索与推荐平台团队、Baseten 模型性能团队共同完成,DataCrunch 提供了 GPU 资源支持。
关于 DeepSeek 系列模型在 SGLang 中的详细优化清单(如 MLA、CUDA graph、DeepGEMM、EP 等),请参阅官方文档中 “DeepSeek V3/V3.1/R1 Model Optimizations in SGLang” 一节;仓库侧的实现与参数定义可对照 python/sglang/srt/models/deepseek_v2.py 等源码阅读(详见本文最后一节)。
安装与启动
在开始之前有一个重要提醒:如果在启动服务器时遇到报错,请先确认权重已经完整下载。建议提前下载权重,或在启动失败后多次重启,直到所有权重就绪。
使用 Docker(推荐)
# 拉取最新镜像 docker pull lmsysorg/sglang:latest # 启动服务 docker run --gpus all --shm-size 32g -p 30000:30000 -v ~/.cache/huggingface:/root/.cache/huggingface --ipc=host --network=host --privileged lmsysorg/sglang:latest \ python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-V3 --tp 8 --trust-remote-code --port 30000几个关键参数说明:
--gpus all:暴露全部 GPU 给容器;--shm-size 32g:DeepSeek 这类超大模型的 KV cache 与张量并行的共享内存需求较高,需要调大/dev/shm;-v ~/.cache/huggingface:/root/.cache/huggingface:挂载本机 Hugging Face 权重缓存,避免重复下载;--ipc=host --network=host --privileged:RDMA(InfiniBand/RoCE)场景必需;不使用 RDMA 时可移除--network=host与--privileged;--tp 8:8 卡张量并行(DeepSeek V3 671B 的 FP8 版本需要 8×80GB 级别显存);--port 30000:服务端口,客户端将访问http://127.0.0.1:30000/v1。
如果使用 RoCE 网络,可能还需要设置export NCCL_IB_GID_INDEX=3。
按需追加性能优化选项中的参数。
使用 pip
# 安装 pip install sglang # 启动 python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-V3 --tp 8 --trust-remote-code按需追加性能优化选项中的参数。
从源码看,python/sglang/launch_server.py 是python -m sglang.launch_server的入口:它解析sys.argv[1:]得到ServerArgs,随后根据encoder_only、gRPC/Ray 等标志分发到对应的launch_server(默认走 python/sglang/srt/entrypoints/http_server.py 的 HTTP 模式)。该文件在运行时还会提示:python -m sglang.launch_server仍然受支持,但更推荐使用sglang serve --model-path <model> [options]作为统一入口。
性能优化选项(Performance Optimization Options)
MLA 优化默认开启,无需额外参数。以下是两个可选的优化开关:
| 优化项 | 适用场景 | 参数 | 说明 |
|---|---|---|---|
| Data Parallelism Attention | 高 QPS 场景 | --enable-dp-attention | 注意力走数据并行、FFN 走张量并行,提升吞吐 |
| Torch.compile 优化 | 追求更低的 kernel 延迟 | --enable-torch-compile | 启动时编译模型,会消耗一定启动时间 |
| Torch.compile 批次上限 | 配合 torch.compile 使用 | --torch-compile-max-bs | 建议取值 1~8,例如--torch-compile-max-bs 8 |
从源码确认参数行为:
--enable-dp-attention的定义位于 python/sglang/srt/arg_groups/fields/parallel.py,其帮助文本明确指出:该开关为注意力启用数据并行、为 FFN 启用张量并行,DP 尺寸需等于 TP 尺寸(dp_size == tp_size),当前支持 DeepSeek-V2 与 Qwen 2/3 的 MoE 模型(DeepSeek V3/V3.1/R1 的 MLA 架构继承自 V2,同样适用)。--enable-torch-compile与--torch-compile-max-bs定义于 python/sglang/srt/arg_groups/fields/exec_.py,其中torch_compile_max_bs的默认值为32,文档建议在 1~8 之间取值以获得更稳定的编译行为。
用法:与 DeepSeek 对话
DeepSeek V3 / R1
服务启动后,使用 OpenAI 兼容接口即可调用(model参数可填"default"):
import openai client = openai.Client( base_url="http://127.0.0.1:30000/v1", api_key="EMPTY") # Chat completion response = client.chat.completions.create( model="default", messages=[ {"role": "system", "content": "You are a helpful AI assistant"}, {"role": "user", "content": "List 3 countries and their capitals."}, ], temperature=0, max_tokens=64, ) print(response)DeepSeek V3.1:请求级思考开关
DeepSeek V3.1 在基础用法之上,支持逐请求(request-level)切换 thinking / non-thinking 模式。通过extra_body={"chat_template_kwargs": {"thinking": True/False}}即可控制。
非思考模式(Non Thinking)
import openai client = openai.Client( base_url="http://127.0.0.1:30000/v1", api_key="EMPTY") # Chat completion response = client.chat.completions.create( model="default", messages=[ {"role": "system", "content": "You are a helpful AI assistant"}, {"role": "user", "content": "Answer the following with the second letter of the correct answer only: What is the capital of France?"}, ], temperature=0, max_tokens=1024, extra_body = {"chat_template_kwargs": {"thinking": False}} ) print(response.choices[0].message.content)输出示例:
h(说明:该问题的正确答案是 “Paris”,正确做法是输出 “Paris” 的第二个字母 “A”,但 non-thinking 模式下模型直接按字面要求给出了错误答案h,恰好演示了思考模式的必要性。)
思考模式(Thinking)
import openai client = openai.Client( base_url="http://127.0.0.1:30000/v1", api_key="EMPTY") # Chat completion response = client.chat.completions.create( model="default", messages=[ {"role": "system", "content": "You are a helpful AI assistant"}, {"role": "user", "content": "Answer the following with the second letter of the correct answer only: What is the capital of France?"}, ], temperature=0, max_tokens=1024, extra_body = {"chat_template_kwargs": {"thinking": True}} ) print(response)输出示例(截取关键部分):
First, the question is: "What is the capital of France?" I know that the capital of France is Paris. ... So, the second letter is "A". ... Finally, I need to make sure that this is the correct answer. Yes, Paris is indeed the capital of France.</think>A可见思考模式下响应中包含完整的</think>推理轨迹,模型能够据此推导出正确答案 “A”——这正是 reasoning 模型的核心价值:把推理过程显式展开后给出结果。
多节点 / 多卡部署实战
以下示例均来自仓库的 benchmark/deepseek_v3/README.md,覆盖从 4 卡到 32 卡、从 FP8/BF16 到 AWQ/int8 量化的多种部署形态。
示例:2 个 H20×8 节点
假设有两个 H20 节点,各含 8 张 GPU。节点 1 的 IP 为10.0.0.1,节点 2 的 IP 为10.0.0.2。两个节点都要使用节点 1 的 IP作为--dist-init-addr。
- 若命令执行失败,尝试设置
GLOO_SOCKET_IFNAME环境变量(参见 PyTorch 分布式常用环境变量说明); - 若多节点使用 NVIDIA InfiniBand 且启动时挂起,可考虑增加
export NCCL_IB_GID_INDEX=3。
# node 1 python3 -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V3 --tp 16 --dist-init-addr 10.0.0.1:5000 --nnodes 2 --node-rank 0 --trust-remote-code # node 2 python3 -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V3 --tp 16 --dist-init-addr 10.0.0.1:5000 --nnodes 2 --node-rank 1 --trust-remote-code参数速查:--tp 16为跨 2 节点的 16 路张量并行;--dist-init-addr <IP>:<PORT>指定分布式初始化的主节点地址;--nnodes 2与--node-rank 0/1分别声明节点总数与当前节点序号。
两个 H100 节点的用法与上述 H20 一致。
注意:上面的启动命令没有开启 DP Attention 与 torch.compile 优化。追求最优性能时,请参考性能优化选项中的参数组合。
示例:1 个 B200 节点(FP4 / FP8)
单个 B200 节点可以配置 4 张(仅 FP4)或 8 张(FP4/FP8 均可)GPU。DeepSeek R1 同时支持 FP4 与 FP8 模型,两者的最优参数略有差异。
FP4
4 卡配置:
python3 -m sglang.launch_server --model-path nvidia/DeepSeek-R1-0528-FP4-V2 --host 0.0.0.0 --port 8000 --tensor-parallel-size=4 --cuda-graph-max-bs-decode 256 --max-running-requests 256 --mem-fraction-static 0.85 --ep-size 4 --scheduler-recv-interval 30 --enable-symm-mem --stream-interval 108 卡配置:
python3 -m sglang.launch_server --model-path nvidia/DeepSeek-R1-0528-FP4-V2 --host 0.0.0.0 --port 8000 --tensor-parallel-size=8 --cuda-graph-max-bs-decode 256 --max-running-requests 256 --mem-fraction-static 0.85 --ep-size 8 --scheduler-recv-interval 30 --enable-symm-mem --stream-interval 10FP8
SGLANG_ENABLE_JIT_DEEPGEMM=false python3 -m sglang.launch_server --model-path=deepseek-ai/DeepSeek-R1-0528 --host=0.0.0.0 --port=8000 --tensor-parallel-size=8 --cuda-graph-max-bs-decode 128 --max-running-requests 128 --mem-fraction-static 0.82 --kv-cache-dtype fp8_e4m3 --chunked-prefill-size 32768 --max-prefill-tokens 32768 --scheduler-recv-interval 30 --stream-interval 30 --fp8-gemm-backend flashinfer_trtllm关键参数解读(对应源码中的参数定义,见 python/sglang/srt/arg_groups/fields/exec_.py 与模型/调度参数组):
--cuda-graph-max-bs-decode:decode 阶段 CUDA graph 捕获的最大 batch 大小,需与--max-running-requests匹配,避免频繁回退到 eager 模式;--max-running-requests:并发运行请求数上限(含等待中的请求);--mem-fraction-static:为模型权重与 KV cache 预留的静态显存比例(0.82~0.85 表示预留 82%~85%);--ep-size:MoE 专家并行(Expert Parallelism)的专家分组大小,FP4 下与 TP 一致;--kv-cache-dtype fp8_e4m3:KV cache 使用 FP8(e4m3)存储,显著降低显存占用;--chunked-prefill-size/--max-prefill-tokens:chunked prefill 的块大小与单次 prefill token 上限;--scheduler-recv-interval/--stream-interval:调度器接收间隔与流式输出间隔(毫秒级控制);--enable-symm-mem:启用对称内存分配(面向 B200 这类设备的内存特性);--fp8-gemm-backend flashinfer_trtllm:指定 FP8 GEMM 后端实现;SGLANG_ENABLE_JIT_DEEPGEMM=false:关闭 DeepGEMM 的 JIT 编译路径,改用上述显式指定的 GEMM 后端。
示例:2 个 H200×8 节点 + Docker
两个 H200 节点各含 8 张 GPU,IP 分别为192.168.114.10与192.168.114.11。使用--host 0.0.0.0与--port 40000将服务暴露给其他容器,并用--dist-init-addr 192.168.114.10:20000建立节点间通信。单个 H200 的 8 卡即可运行 DeepSeek V3,双 H200 配置只是为了演示多节点用法。
# node 1 docker run --gpus all \ --shm-size 32g \ --network=host \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --name sglang_multinode1 \ -it \ --rm \ --env "HF_TOKEN=$HF_TOKEN" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V3 --tp 16 --dist-init-addr 192.168.114.10:20000 --nnodes 2 --node-rank 0 --trust-remote-code --host 0.0.0.0 --port 40000# node 2 docker run --gpus all \ --shm-size 32g \ --network=host \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --name sglang_multinode2 \ -it \ --rm \ --env "HF_TOKEN=$HF_TOKEN" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V3 --tp 16 --dist-init-addr 192.168.114.10:20000 --nnodes 2 --node-rank 1 --trust-remote-code --host 0.0.0.0 --port 40000为验证服务可用,从第三个客户端容器发起一次基准请求(调用仓库自带的sglang.bench_serving,构造 1 个 prompt、输入 1 token、输出 512 token):
docker run --gpus all \ --shm-size 32g \ --network=host \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --name sglang_multinode_client \ -it \ --rm \ --env "HF_TOKEN=$HF_TOKEN" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.bench_serving --backend sglang --dataset-name random --random-input 1 --random-output 512 --random-range-ratio 1 --num-prompts 1 --host 0.0.0.0 --port 40000 --output-file "deepseekv3_multinode.jsonl"注意:上面的启动命令没有开启 DP Attention 与 torch.compile 优化。追求最优性能时,请参考性能优化选项中的参数组合。
示例:4 个 A100×8 节点(BF16)
A100 不支持原生 FP8 计算,因此需要先将 FP8 权重转换为 BF16。原文档推荐使用 DeepSeek 官方仓库提供的fp8_cast_bf16.py脚本完成转换。
由于 BF16 模型体积超过 1.3 TB,需要准备 4 个节点、每个节点 8 张 80GB A100。假设节点 1 的 IP 为10.0.0.1,转换后的模型路径为/path/to/DeepSeek-V3-BF16:
# node 1 python3 -m sglang.launch_server --model-path /path/to/DeepSeek-V3-BF16 --tp 32 --dist-init-addr 10.0.0.1:5000 --nnodes 4 --node-rank 0 --trust-remote-code --host 0.0.0.0 --port 30000 # node 2 python3 -m sglang.launch_server --model-path /path/to/DeepSeek-V3-BF16 --tp 32 --dist-init-addr 10.0.0.1:5000 --nnodes 4 --node-rank 1 --trust-remote-code # node 3 python3 -m sglang.launch_server --model-path /path/to/DeepSeek-V3-BF16 --tp 32 --dist-init-addr 10.0.0.1:5000 --nnodes 4 --node-rank 2 --trust-remote-code # node 4 python3 -m sglang.launch_server --model-path /path/to/DeepSeek-V3-BF16 --tp 32 --dist-init-addr 10.0.0.1:5000 --nnodes 4 --node-rank 3 --trust-remote-code注意:上面的启动命令没有开启 DP Attention 与 torch.compile 优化。追求最优性能时,请参考性能优化选项中的参数组合。
随后访问节点 1 暴露的端口,对精度与延迟进行基准测试:
# 精度基准(GSM8K,1319 题) python3 benchmark/gsm8k/bench_sglang.py --num-questions 1319 --host 10.0.0.1 --port 30000 # 延迟基准(单请求,输入输出各 128 token) python3 -m sglang.bench_one_batch_server --model None --base-url http://10.0.0.1:30000 --batch-size 1 --input-len 128 --output-len 128上述两个基准脚本都位于仓库内:GSM8K 精度测试见 benchmark/gsm8k/bench_sglang.py,单 batch 延迟测试对应sglang.bench_one_batch_server模块(python/sglang/bench_one_batch_server.py)。
示例:8/16 卡 A100/A800 的 AWQ 量化部署
推荐用法:添加--quantization moe_wna16启用 MoE WNA16 kernel,可获得更好的性能:
python3 -m sglang.launch_server --model cognitivecomputations/DeepSeek-R1-AWQ --tp 8 --trust-remote-code --quantization moe_wna16备选用法:使用awq_marlin后端:
python3 -m sglang.launch_server --model cognitivecomputations/DeepSeek-R1-AWQ --tp 8 --trust-remote-code --quantization awq_marlin --dtype float16注意:awq_marlin目前仅支持float16,可能带来一定精度损失。
示例:16 卡 A100/A800 的 int8 量化部署
int8 量化分为block-wise(块级)与per-channel(逐通道)两种方法,量化参数已上传至 Hugging Face(例如meituan/DeepSeek-R1-Block-INT8与meituan/DeepSeek-R1-Channel-INT8等社区模型仓库)。
假设主节点 IP 为MASTER_IP,权重路径为/path/to/DeepSeek-R1-INT8,端口为 5000:
# master python3 -m sglang.launch_server \ --model meituan/DeepSeek-R1-Block-INT8 --tp 16 --dist-init-addr \ MASTER_IP:5000 --nnodes 2 --node-rank 0 --trust-remote-code --enable-torch-compile --torch-compile-max-bs 8 # cluster python3 -m sglang.launch_server \ --model meituan/DeepSeek-R1-Block-INT8 --tp 16 --dist-init-addr \ MASTER_IP:5000 --nnodes 2 --node-rank 1 --trust-remote-code --enable-torch-compile --torch-compile-max-bs 8注意:上面的启动命令开启了 torch.compile 优化。追求最优性能时,请参考性能优化选项中的参数组合。
然后在master 节点上(假设 ShareGPT 数据集位于/path/to/ShareGPT_V3_unfiltered_cleaned_split.json)执行基准:
# 精度基准(GSM8K,1319 题) python3 benchmark/gsm8k/bench_sglang.py --num-questions 1319 # 服务吞吐基准(1000 个 prompt,请求速率 128 QPS) python3 -m sglang.bench_serving --dataset-path /path/to/ShareGPT_V3_unfiltered_cleaned_split.json --dataset-name random --random-input 128 --random-output 128 --num-prompts 1000 --request-rate 128 --random-range-ratio 1.0提示:在精度基准命令中增加
--parallel 200可显著加速评测过程。
示例:32 卡 L40S 的 int8 量化部署
使用 per-channel 量化模型(例如meituan/DeepSeek-R1-Channel-INT8等社区模型仓库),主节点 IP 为MASTER_IP,端口为 5000:
# master python3 -m sglang.launch_server --model meituan/DeepSeek-R1-Channel-INT8 --tp 32 --quantization w8a8_int8 \ --dist-init-addr MASTER_IP:5000 --nnodes 4 --node-rank 0 --trust-remote \ --enable-torch-compile --torch-compile-max-bs 32 # cluster python3 -m sglang.launch_server --model meituan/DeepSeek-R1-Channel-INT8 --tp 32 --quantization w8a8_int8 \ --dist-init-addr MASTER_IP:5000 --nnodes 4 --node-rank 1 --trust-remote \ --enable-torch-compile --torch-compile-max-bs 32 python3 -m sglang.launch_server --model meituan/DeepSeek-R1-Channel-INT8 --tp 32 --quantization w8a8_int8 \ --dist-init-addr MASTER_IP:5000 --nnodes 4 --node-rank 2 --trust-remote \ --enable-torch-compile --torch-compile-max-bs 32 python3 -m sglang.launch_server --model meituan/DeepSeek-R1-Channel-INT8 --tp 32 --quantization w8a8_int8 \ --dist-init-addr MASTER_IP:5000 --nnodes 4 --node-rank 3 --trust-remote \ --enable-torch-compile --torch-compile-max-bs 32基准测试方法与上文“16 卡 A100/A800 int8”一节完全相同(--quantization w8a8_int8表示 8-bit 权重 × 8-bit 激活)。
示例:任意云 / Kubernetes 上的 SkyPilot 部署
SkyPilot 可以在任意云厂商或现有 Kubernetes 集群中寻找性价比最高的 GPU,并用单条命令拉起分布式推理服务:
git clone <skypilot 仓库> # 2 个 H100/H200×8 节点 sky launch -c r1 llm/deepseek-r1/deepseek-r1-671B.yaml --retry-until-up # 4 个 A100×8 节点 sky launch -c r1 llm/deepseek-r1/deepseek-r1-671B-A100.yaml --retry-until-up(上述 YAML 位于 SkyPilot 仓库的llm/deepseek-r1/目录下,可自行查阅。)
示例:4 卡 H200 的 W4A-FP8 混合精度部署
W4A-FP8 是一种混合精度量化方案:MoE 层使用 W4(int)A(FP)8 计算,dense 层保持 FP8 精度。预量化权重已在社区模型仓库中发布(例如novita/Deepseek-V3-0324-W4AFP8),4×H200(或潜在的 8×H100)即可高效运行:
python -m sglang.launch_server --model novita/Deepseek-V3-0324-W4AFP8 --mem-fraction-static 0.85 --disable-shared-experts-fusion --tp-size 4其中--disable-shared-experts-fusion用于关闭共享专家(shared experts)的融合优化——在 W4A-FP8 这类混合精度量化下,关闭融合往往能获得更稳定的行为。
其他可用的预量化变体还包括(社区模型仓库名):novita/Deepseek-V3.1-W4AFP8、novita/Deepseek-R1-0528-W4AFP8、novita/Deepseek-R1-W4AFP8、novita/Deepseek-V3-0324-W4AFP8。
常见问题排查(Troubleshooting)
如果在 fp16/bf16 checkpoint 上遇到如下报错:
ValueError: Weight output_partition_size = 576 is not divisible by weight quantization block_n = 128.请编辑模型的config.json,删除其中的quantization_config块,例如移除如下内容:
"quantization_config": { "activation_scheme": "dynamic", "fmt": "e4m3", "quant_method": "fp8", "weight_block_size": [128, 128] },删除该块通常即可解决报错。其原因是:当 checkpoint 实际为 fp16/bf16 权重、但config.json中残留 FP8 量化描述时,张量并行切分(output_partition_size)与量化块大小(block_n=128)无法整除,导致权重加载阶段校验失败。
附:源码速览与 DeepSeek V3 优化计划
为了便于深入阅读,这里汇总本文涉及的关键源码位置:
- 服务入口:python/sglang/launch_server.py ——
python -m sglang.launch_server的参数解析与分发逻辑,官方推荐sglang serve作为统一命令; - 并行参数组(DP Attention / EP):python/sglang/srt/arg_groups/fields/parallel.py ——
--enable-dp-attention、--ep-size、--dp-size等定义,其中 DP Attention 要求dp_size == tp_size; - 执行与编译参数组(CUDA graph / torch.compile):python/sglang/srt/arg_groups/fields/exec_.py ——
--cuda-graph-max-bs-decode、--enable-torch-compile、--torch-compile-max-bs(默认 32)等; - 模型实现:python/sglang/srt/models/deepseek_v2.py —— 包含
DeepseekV2MoE(第 543 行附近)、DeepseekV2AttentionMLA(第 1707 行附近)、DeepseekV2Model(第 2575 行附近)与DeepseekV2ForCausalLM(第 2883 行附近)等核心类;仓库中另有 python/sglang/srt/models/deepseek.py、deepseek_v4.py、deepseek_nextn.py等模型文件; - 基准脚本:benchmark/gsm8k/bench_sglang.py、python/sglang/bench_one_batch_server.py、python/sglang/bench_serving.py;
- 优化路线图:DeepSeek V3 在 SGLang 中的优化计划以公开 issue(编号 2591)形式持续跟踪,涵盖上述 MLA、DP Attention、CUDA graph、量化等方向的落地进展,感兴趣的读者可在仓库历史与讨论中查看。
结语
从单机 Docker 到 4 节点 32 卡,从 FP8 到 AWQ/int8/W4A-FP8 混合精度,SGLang 为 DeepSeek V3 / V3.1 / R1 提供了覆盖绝大多数生产形态的部署路径。结合 benchmark/deepseek_v3/README.md 中的现成命令与仓库源码中的参数定义,你可以按“先跑通 → 再加优化开关 → 再按显存与精度预算选量化方案”的顺序,快速搭建出满足自身吞吐与精度要求的 DeepSeek 推理服务。
【免费下载链接】sglangSGLang is a high-performance serving framework for large language models and multimodal models.项目地址: https://gitcode.com/GitHub_Trending/sg/sglang
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考