Ligeng Zhu commited on
Commit ·
4fdb2fb
1
Parent(s): 10fb783
Add GB300 NVL72 serving cost estimate
Browse files- deepseek_cost.md +94 -13
deepseek_cost.md
CHANGED
|
@@ -10,13 +10,23 @@
|
|
| 10 |
| deepseek-v4-flash | MoE all-to-all network | 13,518 tok/s | $0.123 / M output tok |
|
| 11 |
| deepseek-r1 | MoE all-to-all network, compute close | 4,235-4,454 tok/s | $0.374-$0.394 / M output tok |
|
| 12 |
|
| 13 |
-
如果 50 GB/s 是理论带宽、实际只到
|
| 14 |
|
| 15 |
-
| Model |
|
| 16 |
| --- | ---: |
|
| 17 |
-
| deepseek-v4-pro | $0.
|
| 18 |
-
| deepseek-v4-flash | $0.
|
| 19 |
-
| deepseek-r1 | $0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
如果是 1M context decode,V4 的 CSA/HCA attention 仍然可控,但 R1/MLA 会被 attention FLOPs 打穿:
|
| 22 |
|
|
@@ -36,6 +46,7 @@
|
|
| 36 |
- [articles/05-29841050824-DeepSeek-V3-R1-推理效率分析(2)-DeepSeek-满血版逆向工程分析.md](articles/05-29841050824-DeepSeek-V3-R1-推理效率分析(2)-DeepSeek-满血版逆向工程分析.md): H800 decode timeline 与 peak throughput 逆向。
|
| 37 |
- [articles/06-29540042383-DeepSeek-V3-R1-推理效率分析(3):Decode-配置泛化讨论.md](articles/06-29540042383-DeepSeek-V3-R1-推理效率分析(3):Decode-配置泛化讨论.md): decode 配置泛化公式。
|
| 38 |
- NVIDIA B200 规格按官方公开口径:单卡约 180 GB HBM3e、7.7-8.0 TB/s HBM、FP8 sparse 9 PFLOP/s、BF16 sparse 4.5 PFLOP/s。本文按 dense 有效峰值取一半,即 FP8 4.5 PFLOP/s、BF16 2.25 PFLOP/s、FP4 9 PFLOP/s。
|
|
|
|
| 39 |
|
| 40 |
## 1. Scope and assumptions
|
| 41 |
|
|
@@ -55,6 +66,18 @@ B200 price = $6 / GPU-hour
|
|
| 55 |
IB bandwidth = 50 GB/s per GPU
|
| 56 |
```
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
成本换算:
|
| 59 |
|
| 60 |
```text
|
|
@@ -250,12 +273,12 @@ deepseek-r1 decode cost ~= $0.37-$0.39 / M output tok
|
|
| 250 |
|
| 251 |
### 3.4 Bandwidth sensitivity
|
| 252 |
|
| 253 |
-
| Model | 50 GB/s
|
| 254 |
-
| --- | ---: | ---: | ---: | ---: |
|
| 255 |
-
| V4-Pro |
|
| 256 |
-
| V4-Flash |
|
| 257 |
-
| R1, 58 MoE layers |
|
| 258 |
-
| R1, 61 conservative layers |
|
| 259 |
|
| 260 |
这张表也是最重要的 sanity check:如果 IB 带宽不变,B200 的更高��力不会线性转化成 decode 降本,因为 MoE all-to-all 已经是主要瓶颈。
|
| 261 |
|
|
@@ -490,7 +513,65 @@ cost = 1666.667 / 11818
|
|
| 490 |
| V4-Pro | $0.568/M | $0.379/M | $0.306/M, network capped |
|
| 491 |
| V4-Flash | $0.212/M | $0.141/M | $0.123/M, network capped |
|
| 492 |
|
| 493 |
-
## 6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 494 |
|
| 495 |
几个直观结论:
|
| 496 |
|
|
@@ -499,4 +580,4 @@ cost = 1666.667 / 11818
|
|
| 499 |
3. V4-Flash 由于 hidden size、层数、active params 都明显更小,decode 成本约为 V4-Pro 的 40%,约为 R1 的三分之一。
|
| 500 |
4. 1M context 是 V4 架构优势最明显的地方。V4-Pro/Flash 的 CSA/HCA 把 long-context attention 控制住,而 R1/MLA 的 attention FLOPs 随 context 线性增长,成本会到几十美元每百万 output tokens 的量级。
|
| 501 |
5. 如果要让 B200 在常规 decode 上继续降本,关键不是再加 GPU peak FLOPs,而是降低 MoE 通信量、提高 effective IB bandwidth、做更好的 expert locality、用更 aggressive 的 quantization/combine 压缩,或者靠 MTP/speculative decoding 提高每次 forward 产出的有效 tokens。
|
| 502 |
-
|
|
|
|
| 10 |
| deepseek-v4-flash | MoE all-to-all network | 13,518 tok/s | $0.123 / M output tok |
|
| 11 |
| deepseek-r1 | MoE all-to-all network, compute close | 4,235-4,454 tok/s | $0.374-$0.394 / M output tok |
|
| 12 |
|
| 13 |
+
如果 50 GB/s 是理论带宽、实际只到 30 GB/s,那么上面的 network-bound 成本约乘以 `50 / 30 = 1.667`:
|
| 14 |
|
| 15 |
+
| Model | 30 GB/s 实效带宽成本 |
|
| 16 |
| --- | ---: |
|
| 17 |
+
| deepseek-v4-pro | $0.510 / M output tok |
|
| 18 |
+
| deepseek-v4-flash | $0.206 / M output tok |
|
| 19 |
+
| deepseek-r1 | $0.624-$0.656 / M output tok |
|
| 20 |
+
|
| 21 |
+
如果换成 **GB300 NVL72**,关键不是单卡算力,而是 MoE all-to-all 能否留在单个 72-GPU NVLink domain 里。若可以留在 rack 内,并先按同样 `$6 / GPU-hour` 归一化:
|
| 22 |
+
|
| 23 |
+
| Model, 5k KV on GB300 NVL72 | 主要瓶颈 | 吞吐, 每张 GB300 | Decode cost |
|
| 24 |
+
| --- | ---: | ---: | ---: |
|
| 25 |
+
| deepseek-v4-pro | compute | 12,605 tok/s | $0.132 / M output tok |
|
| 26 |
+
| deepseek-v4-flash | compute | 49,014 tok/s | $0.034 / M output tok |
|
| 27 |
+
| deepseek-r1 | compute | 6,158 tok/s | $0.271 / M output tok |
|
| 28 |
+
|
| 29 |
+
如果实际 GB300 租金是 `P` 美元/GPU-hour,上表成本需要再乘以 `P / 6`。如果 MoE all-to-all 仍然跨 rack 走外部网络,成本会重新退回对应 effective network bandwidth 的 network-bound 结果。
|
| 30 |
|
| 31 |
如果是 1M context decode,V4 的 CSA/HCA attention 仍然可控,但 R1/MLA 会被 attention FLOPs 打穿:
|
| 32 |
|
|
|
|
| 46 |
- [articles/05-29841050824-DeepSeek-V3-R1-推理效率分析(2)-DeepSeek-满血版逆向工程分析.md](articles/05-29841050824-DeepSeek-V3-R1-推理效率分析(2)-DeepSeek-满血版逆向工程分析.md): H800 decode timeline 与 peak throughput 逆向。
|
| 47 |
- [articles/06-29540042383-DeepSeek-V3-R1-推理效率分析(3):Decode-配置泛化讨论.md](articles/06-29540042383-DeepSeek-V3-R1-推理效率分析(3):Decode-配置泛化讨论.md): decode 配置泛化公式。
|
| 48 |
- NVIDIA B200 规格按官方公开口径:单卡约 180 GB HBM3e、7.7-8.0 TB/s HBM、FP8 sparse 9 PFLOP/s、BF16 sparse 4.5 PFLOP/s。本文按 dense 有效峰值取一半,即 FP8 4.5 PFLOP/s、BF16 2.25 PFLOP/s、FP4 9 PFLOP/s。
|
| 49 |
+
- NVIDIA GB300 NVL72 规格按官方公开口径:单 rack 72 张 Blackwell Ultra GPU、130 TB/s NVLink、20 TB GPU memory、FP8/FP6 sparse 720 PFLOP/s、BF16 sparse 360 PFLOP/s、FP4 dense 1080 PFLOP/s。NVLink 5 按每 GPU 1,800 GB/s,72-GPU NVLink domain。参考 [NVIDIA GB300 NVL72](https://www.nvidia.com/en-us/data-center/gb300-nvl72/)、[NVIDIA NVL72 AI Factory hardware components](https://docs.nvidia.com/enterprise-reference-architectures/nvl72-ai-factory/latest/components.html) 与 [NVIDIA NVLink specifications](https://www.nvidia.com/en-us/data-center/nvlink/)。
|
| 50 |
|
| 51 |
## 1. Scope and assumptions
|
| 52 |
|
|
|
|
| 66 |
IB bandwidth = 50 GB/s per GPU
|
| 67 |
```
|
| 68 |
|
| 69 |
+
这里的 `50 GB/s` 是 NDR 400 Gb/s InfiniBand 的理论线速口径。实际 serving 里能吃到多少,取决于消息大小、GPU Direct RDMA/NCCL/DeepEP 实现、PCIe/NUMA/NIC 绑定、交换机拓扑、拥塞和多租户干扰。一个实用的经验口径是:
|
| 70 |
+
|
| 71 |
+
| Scenario | Effective bandwidth | Multiplier vs 50 GB/s |
|
| 72 |
+
| --- | ---: | ---: |
|
| 73 |
+
| 理想大包 RDMA microbench | 45-49 GB/s | 1.02-1.11x |
|
| 74 |
+
| 调好的 GPU Direct / NCCL 大包通信 | 40-47 GB/s | 1.06-1.25x |
|
| 75 |
+
| 非拥塞、拓扑较好的真实训练或 serving 通信 | 35-43 GB/s | 1.16-1.43x |
|
| 76 |
+
| MoE all-to-all / dispatch-combine serving 路径 | 30-40 GB/s | 1.25-1.67x |
|
| 77 |
+
| 多租户、拥塞或拓扑/绑定未调好 | 20-30 GB/s | 1.67-2.50x |
|
| 78 |
+
|
| 79 |
+
因此本文主表仍保留 `50 GB/s` 理论上限,同时用 `30 GB/s` 作为 conservative serving estimate;如果是专用且调优较好的集群,可以把 `40 GB/s` 作为 optimistic serving estimate。
|
| 80 |
+
|
| 81 |
成本换算:
|
| 82 |
|
| 83 |
```text
|
|
|
|
| 273 |
|
| 274 |
### 3.4 Bandwidth sensitivity
|
| 275 |
|
| 276 |
+
| Model | 50 GB/s cost | 40 GB/s cost | 35 GB/s cost | 30 GB/s cost |
|
| 277 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 278 |
+
| V4-Pro | $0.306/M | $0.383/M | $0.437/M | $0.510/M |
|
| 279 |
+
| V4-Flash | $0.123/M | $0.154/M | $0.176/M | $0.206/M |
|
| 280 |
+
| R1, 58 MoE layers | $0.374/M | $0.468/M | $0.535/M | $0.624/M |
|
| 281 |
+
| R1, 61 conservative layers | $0.394/M | $0.492/M | $0.562/M | $0.656/M |
|
| 282 |
|
| 283 |
这张表也是最重要的 sanity check:如果 IB 带宽不变,B200 的更高��力不会线性转化成 decode 降本,因为 MoE all-to-all 已经是主要瓶颈。
|
| 284 |
|
|
|
|
| 513 |
| V4-Pro | $0.568/M | $0.379/M | $0.306/M, network capped |
|
| 514 |
| V4-Flash | $0.212/M | $0.141/M | $0.123/M, network capped |
|
| 515 |
|
| 516 |
+
## 6. GB300 NVL72 estimate
|
| 517 |
+
|
| 518 |
+
GB300 NVL72 和前面的 B200 + IB 估计不是简单换一张更快的 GPU。它的核心变化是一个 rack 内有 72 张 Blackwell Ultra GPU,形成 72-GPU NVLink domain;如果 MoE all-to-all 可以留在 rack 内,通信带宽从外部 IB 的几十 GB/s 级别变成 NVLink 的 TB/s 级别。
|
| 519 |
+
|
| 520 |
+
这里先按 `$6 / GPU-hour` 做归一化,方便和 B200 表直接比较。实际 GB300 租金若为 `P` 美元/GPU-hour,则所有 GB300 成本乘以 `P / 6`。
|
| 521 |
+
|
| 522 |
+
官方 rack 级算力换算成每 GPU dense peak:
|
| 523 |
+
|
| 524 |
+
```text
|
| 525 |
+
GB300 NVL72 rack = 72 GPUs
|
| 526 |
+
|
| 527 |
+
FP8 sparse rack peak = 720 PFLOP/s -> dense ~= 360 PFLOP/s rack ~= 5.0 PFLOP/s/GPU
|
| 528 |
+
BF16 sparse rack peak = 360 PFLOP/s -> dense ~= 180 PFLOP/s rack ~= 2.5 PFLOP/s/GPU
|
| 529 |
+
FP4 dense rack peak = 1080 PFLOP/s -> dense ~= 15.0 PFLOP/s/GPU
|
| 530 |
+
|
| 531 |
+
MFU = 30%
|
| 532 |
+
|
| 533 |
+
effective FP8 = 1.50 PFLOP/s/GPU
|
| 534 |
+
effective BF16 = 0.75 PFLOP/s/GPU
|
| 535 |
+
effective FP4 = 4.50 PFLOP/s/GPU
|
| 536 |
+
```
|
| 537 |
+
|
| 538 |
+
NVLink 5 的 per-GPU bandwidth 按 1,800 GB/s 估算:
|
| 539 |
+
|
| 540 |
+
```text
|
| 541 |
+
T_net_NVL = T_net_50GB * (1800 / 50)
|
| 542 |
+
```
|
| 543 |
+
|
| 544 |
+
所以 5k KV 常规 decode 下的 NVLink network upper bound 已经远高于 compute bound:
|
| 545 |
+
|
| 546 |
+
| Model | T_compute on GB300 | T_net over NVLink | Final T | Cost at $6/GPU-hour |
|
| 547 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 548 |
+
| V4-Pro | 12,605 | 196,020 | 12,605 | $0.132/M |
|
| 549 |
+
| V4-Flash | 49,014 | 486,648 | 49,014 | $0.034/M |
|
| 550 |
+
| R1 | 6,158 | 152,460-160,344 | 6,158 | $0.271/M |
|
| 551 |
+
|
| 552 |
+
这意味着:如果 all-to-all 真的留在单个 NVL72 rack 内,GB300 会把常规 5k decode 从 network-bound 推到 compute-bound。
|
| 553 |
+
|
| 554 |
+
但这是一个很强的拓扑假设。DeepSeek V3/R1 官方 decode 配置是 EP144,而单个 NVL72 只有 72 张 GPU;R1 如果照搬 EP144 就会跨两个 rack,重新吃外部网络。要拿到上表结果,需要把专家并行、专家复制、路由 locality 或冗余方案改到单 rack 内可用。V4-Pro/Flash 的 72-GPU rack 内部署也需要保证 routed experts 和 shared expert 的通信不溢出到 rack 外。
|
| 555 |
+
|
| 556 |
+
如果 MoE all-to-all 仍然走外部网络,那么 GB300 的更高算力不会改变 network-bound 成本。比如 effective network bandwidth 只有 30 GB/s 时,5k KV 成本仍然是:
|
| 557 |
+
|
| 558 |
+
| Model | 30 GB/s external network cost at $6/GPU-hour |
|
| 559 |
+
| --- | ---: |
|
| 560 |
+
| V4-Pro | $0.510/M |
|
| 561 |
+
| V4-Flash | $0.206/M |
|
| 562 |
+
| R1 | $0.624-$0.656/M |
|
| 563 |
+
|
| 564 |
+
1M context 下,如果 all-to-all 仍在 NVLink rack 内,V4 和 R1 仍然是 compute-bound:
|
| 565 |
+
|
| 566 |
+
| Model, 1M context on GB300 NVL72 | Final T | Cost at $6/GPU-hour |
|
| 567 |
+
| --- | ---: | ---: |
|
| 568 |
+
| V4-Pro | 5,242 tok/s | $0.318/M |
|
| 569 |
+
| V4-Flash | 15,020 tok/s | $0.111/M |
|
| 570 |
+
| R1 | 44.0 tok/s | $37.8/M |
|
| 571 |
+
|
| 572 |
+
因此 GB300 NVL72 的主要价值不是把跨 rack MoE 网络瓶颈变快一点,而是尽量把 MoE serving 的通信问题变成 rack 内 NVLink 问题。一旦 workload spill 到外部网络,成本模型要优先看 external effective bandwidth,而不是 GB300 的 tensor core 峰值。
|
| 573 |
+
|
| 574 |
+
## 7. Interpretation
|
| 575 |
|
| 576 |
几个直观结论:
|
| 577 |
|
|
|
|
| 580 |
3. V4-Flash 由于 hidden size、层数、active params 都明显更小,decode 成本约为 V4-Pro 的 40%,约为 R1 的三分之一。
|
| 581 |
4. 1M context 是 V4 架构优势最明显的地方。V4-Pro/Flash 的 CSA/HCA 把 long-context attention 控制住,而 R1/MLA 的 attention FLOPs 随 context 线性增长,成本会到几十美元每百万 output tokens 的量级。
|
| 582 |
5. 如果要让 B200 在常规 decode 上继续降本,关键不是再加 GPU peak FLOPs,而是降低 MoE 通信量、提高 effective IB bandwidth、做更好的 expert locality、用更 aggressive 的 quantization/combine 压缩,或者靠 MTP/speculative decoding 提高每次 forward 产出的有效 tokens。
|
| 583 |
+
6. GB300 NVL72 的关键分界线是 MoE all-to-all 是否在 72-GPU NVLink domain 内完成;留在 rack 内时 5k KV decode 变成 compute-bound,跨 rack 时仍然是 external network-bound。
|