Skip to content

microsoft/Phi-4 跑在 L40S

microsoft/Phi-4 在 L40S 上需要多少 GPU。

架构

Field Value
model_type phi3
attention GQA (heads=40, kv_heads=10, hd=128)

权重

Field Value Label
safetensors 字节 27.31 GB [已验证]
参数量 14.7B [估算]
量化方案 BF16 [已验证]

量化反演

Scheme Predicted Δ Error
FP16 27.31 GB 37.92 KB 偏多 0.0%
BF16 ✓ 27.31 GB 37.92 KB 偏多 0.0%
FP8 13.65 GB 13.65 GB 偏多 100.0%
INT8 13.65 GB 13.65 GB 偏多 100.0%
FP4_FP8_MIXED 7.51 GB 19.80 GB 偏多 263.6%

Best: BF16 — safetensors header: all 42 weight tensors are BF16 (predicts 29,319,004,160 bytes, 0.0% error)

KV 缓存(每请求)

Context tokens KV bytes
4,096 800.00 MB

推荐集群

Tier GPUs Weight/GPU Headroom/GPU Concurrent @ 128K
min 2 13.65 GB 26.58 GB 2
dev ★ 8 3.41 GB 36.82 GB 11
prod 8 3.41 GB 36.82 GB 11

性能

  • Prefill latency 51 ms @ 2000 input tokens [估算]
  • Cluster decode throughput 679 tok/s [估算]
  • Max concurrent users 22
  • Bottleneck memory_bandwidth

生成命令

vllm serve microsoft/Phi-4 \
  --tensor-parallel-size 8 \
  --max-model-len 16384 \
  --gpu-memory-utilization 0.9

生成方式:

llm-cal microsoft/Phi-4 --gpu L40S --engine vllm --lang zh