跳到正文
DEV Community· Hydenring·· 31 分鐘前AI 評分51

如何避免猜測 GPU 節點規格:配置前檢查 VRAM 與記憶體頻寬

How to Stop Guessing GPU Size: Checking VRAM & Memory Bandwidth Before Provisioning

AI 導讀

Hydenring 提供一套配置裸金屬 GPU 節點前估算資源的方法,按模型權重、KV cache 和執行時開銷計算 VRAM,並以記憶體頻寬估算解碼速度上限。

正文

Most teams size bare metal GPU nodes by looking at parameter count (7B, 70B, 405B) and guessing a GPU SKU. That shortcut breaks in two predictable ways:

  1. You rent an H100 / H200 cluster when a single AMD Instinct MI300X (192 GB HBM3, 5.3 TB/s) or FP8-quantized node would avoid multi-GPU tensor-parallel overhead.
  2. You rent a GPU for a sparse CFD/FEA workload like OpenFOAM that is actually memory-bandwidth bound and PCIe transfer bound, where a high-RAM EPYC or Xeon CPU node starting at ₹1,499/mo (~$16/mo) delivers better cost per run.

This guide gives you the exact back-of-the-envelope formulas we use at Hydenring before provisioning any node—and links to our live INR & USD calculator at hydenring.com/compare.


1. The 3-Part VRAM Formula (Weights + KV Cache + Overhead)

Before choosing between bare metal GPU servers (MI300X, H200, H100, B200) or multi-GPU pods, compute total required VRAM:

Total VRAM ≈ Model Weights + KV Cache + Runtime Overhead

A. Model Weights

Weights (GB) ≈ Parameters (B) × Bytes per Parameter
Precision Bytes / Param 70B Dense Model
FP16 / BF16 2.0 140 GB
FP8 / INT8 1.0 70 GB
INT4 (AWQ/GPTQ) 0.5 35 GB

B. KV Cache (With Grouped-Query Attention)

KV Cache per Token (bytes) = 2 × Layers × KV_Heads × Head_Dim × Bytes_per_Element

Take a 70B GQA model (80 layers, 8 KV heads, 128 head dim, BF16 = 2 bytes):

  • 2 × 80 × 8 × 128 × 2 = 327,680 bytes/token (320 KiB/token)
  • At 32,768 (32K) context for 1 concurrent sequence: 32,768 × 327,680 bytes = 10.0 GiB (~10.7 GB)
  • At 16 concurrent 32K sequences: ~160 GiB of KV cache alone

C. Why 141 GB vs 192 GB Changes Node Count (MI300X vs H200)

Add 140 GB (70B BF16 weights) + ~10.7 GB (single 32K KV sequence) + ~8–12 GB (CUDA/HIP workspace & activation buffers) = ~159–163 GB:

  • NVIDIA H200 (141 GB HBM3e, 4.8 TB/s): Too tight for unquantized 70B BF16 at 32K context on 1 GPU—you must either quantize to FP8 (~70 GB weights) or step up to TP=2.
  • AMD Instinct MI300X (192 GB HBM3, 5.3 TB/s): Fits 70B BF16 + 32K KV cache + runtime overhead on 1 GPU (TP=1) with ~30 GB left for batching.

(Note: If your stack already depends on TensorRT-LLM or custom CUDA kernels, staying on NVIDIA H100/H200 often beats ROCm on engineering time. We cover those exact boundaries in our Workload-First Silicon Selection post.)


2. Checking the Decode Memory-Bandwidth Ceiling

Single-stream LLM token generation (decode) is memory-bandwidth bound, not FLOP bound. Every generated token must stream the active model weights from HBM into compute units:

Theoretical Max Decode Speed (tok/s) ≈ HBM Bandwidth (GB/s) / Active Weights (GB)

For a 140 GB BF16 70B model (batch = 1):

  • AMD Instinct MI300X (5,300 GB/s): 5,300 / 140 ≈ 37.9 tok/s hardware ceiling (~26.5 tok/s at 70% bus efficiency)
  • NVIDIA H200 (4,800 GB/s, if FP8 70 GB): 4,800 / 70 ≈ 68.6 tok/s hardware ceiling (halving active bytes doubles decode ceiling)

If your cloud GPU pricing quote compares GPUs purely on TFLOPs for a decode-heavy serving API, you are sizing the wrong bottleneck.


3. When to Skip GPUs Entirely (OpenFOAM & Sparse FEA)

The fastest way to waste compute budget is putting a sparse, memory-bound physics solver on an H100:

  • Steady-state OpenFOAM (simpleFoam, icoFoam under 10M cells, or cases with Arbitrary Mesh Interfaces / cyclic boundaries and custom C++/Fortran UDFs) saturates lduMatrix sparse-matrix memory bandwidth and hits PCIe host-to-device transfer bottlenecks when partially offloaded.
  • Implicit FEA (MOOSE, CalculiX) is similarly limited by sparse linear-solver memory latency and MPI synchronization.

For these workloads, a high-memory EPYC or Xeon node starting at ₹1,499/mo (~$16/mo) avoids idle GPU SMs and cuts total cost per simulation.


4. Two Pre-Provisioning Sanity Checks

Before running multi-GPU workloads on bare metal, verify interconnect topology and pin immutable Apptainer container digests:

# AMD Instinct: inspect XGMI / PCIe link topology before setting TP
rocm-smi --showtopo

# NVIDIA: inspect NVLink / PCIe topology matrix
nvidia-smi topo -m

# Pin an immutable @sha256:<digest> instead of mutable :latest tags
apptainer exec --rocm docker://rocm/vllm@sha256:<pinned-digest> python3 -m vllm.entrypoints.openai.api_server --help

Compare Live TCO in INR & USD

來源:DEV Community · dev.to