CodeGen2 16B
Salesforce · dense · 16B parameters · 2,048 context
Parameters
16B
Context Window
2K tokens
Architecture
Dense
Best GPU
H100 SXM
Intelligence Brief
CodeGen2 16B is a 16B parameter DENSE model from Salesforce, featuring Multi-Head Attention (MHA) with 34 layers and 6,144 hidden dimensions. With a 2,048 token context window, it supports code. For self-hosted inference, H100 SXM delivers optimal throughput at $1794/month.
Architecture Details
Memory Requirements
BF16 Weights
32.0 GB
FP8 Weights
16.0 GB
INT4 Weights
8.0 GB
GPU Compatibility Matrix
CodeGen2 16B is compatible with 76% of GPU configurations across 41 GPUs at 3 precision levels.
GPU Recommendations
FP8 · 1 GPU · tensorrt-llm
100/100
score
Throughput
1.1K tok/s
Latency (ITL)
1.0ms
Est. TTFT
0ms
Cost/Month
$1794
Cost/M Tokens
$0.65
FP8 · 1 GPU · tensorrt-llm
95/100
score
Throughput
1.0K tok/s
Latency (ITL)
1.0ms
Est. TTFT
0ms
Cost/Month
$1794
Cost/M Tokens
$0.65
BF16 · 1 GPU · vllm
95/100
score
Throughput
129.6 tok/s
Latency (ITL)
7.7ms
Est. TTFT
1ms
Cost/Month
$465
Cost/M Tokens
$1.37
Deployment Options
API Deployment
No API pricing available
Single GPU
H100 SXM
$1794/mo
Min VRAM: 16 GB
Multi-GPU
A10G x2
169.4 tok/s
TP· $569/mo
API Pricing Comparison
No API pricing data available for this model.
Performance Estimates
Throughput by GPU
VRAM Breakdown (H100 SXM, FP8)
Precision Impact
bf16
32.0 GB
weights/GPU
fp8
16.0 GB
weights/GPU
~1.1K tok/s
int4
8.0 GB
weights/GPU
Capabilities
Features
Supported Frameworks
Supported Precisions
Where to Deploy CodeGen2 16B
Self-Hosted Infrastructure
Similar Models
DeepSeek V2 Lite
15.7B params · moe
Quality: 50
DeepSeek MoE 16B
16.4B params · moe
Quality: 50
OctoCoder 15B
15.5B params · dense
Quality: 50
StarCoder2 15B
15.5B params · dense
Quality: 42
from $0.30/M
Nemotron 15B
15B params · dense
Quality: 72
from $0.30/M
Frequently Asked Questions
How much VRAM does CodeGen2 16B need for inference?
CodeGen2 16B requires approximately 32.0 GB of VRAM at BF16 precision, 16.0 GB at FP8, or 8.0 GB at INT4 quantization. Additional VRAM is needed for KV-cache (417792 bytes per token) and activations (~1.20 GB).
What is the best GPU for CodeGen2 16B?
The top recommended GPU for CodeGen2 16B is the H100 SXM using FP8 precision. It achieves approximately 1.1K tokens/sec at an estimated cost of $1794/month ($0.65/M tokens). Score: 100/100.
How much does CodeGen2 16B inference cost?
CodeGen2 16B inference costs vary by provider and GPU setup. Use our calculator for detailed cost estimates across all providers.