IBM
Granite Code 20B (20B parameters) requires approximately 17.2 GB of VRAM with Q4_K_M quantization. For the best balance of quality and speed, we recommend hardware with at least 20 GB of VRAM.
Get started
— copy & paste to run locallyCopy-paste commands to run Granite Code 20B on your machine.
Run
ollama run granite-code:20bQuick specs
About this model
Related models
Inference speed
Estimated decode speed (tokens/sec) for Granite Code 20B at Q4_K_M across popular GPUs and Apple Silicon, using the fastest local runtime per device. Fastest is RTX 5090 32GB at ~106 tok/s. Speed is memory-bandwidth bound, so cards that fit the whole model in VRAM run far faster than ones that offload to system RAM.
| GPU / Mac | Memory | Quant | Speed (tok/s) | Fits? |
|---|---|---|---|---|
| 32 GB | Q4_K_M | 106.3 | Fits | |
| 24 GB | Q4_K_M | 67.8 | Fits | |
RX 7900 XTX 24GB | 24 GB | Q4_K_M | 61.2 | Fits |
| 24 GB | Q4_K_M | 58.0 | Fits | |
Mac Studio M3 Ultra 256GB | 256 GB | Q4_K_M | 49.3 | Fits |
Mac Studio M2 Ultra 128GB | 128 GB | Q4_K_M | 41.1 | Fits |
Mac Studio M1 Ultra 128GB | 128 GB | Q4_K_M | 39.0 | Fits |
MacBook Pro M4 Max 128GB | 128 GB | Q4_K_M | 38.4 | Fits |
MacBook Pro M4 Max 64GB | 64 GB | Q4_K_M | 38.4 | Fits |
| 16 GB | Q4_K_M | 31.0 | Heavy offload | |
MacBook Pro M4 Pro 48GB | 48 GB | Q4_K_M | 24.2 | Fits |
MacBook Pro M3 Max 64GB | 64 GB | Q4_K_M | 21.2 | Fits |
MacBook Pro M1 Max 64GB | 64 GB | Q4_K_M | 19.5 | Fits |
| 12 GB | Q4_K_M | 11.0 | Too big | |
| 12 GB | Q4_K_M | 6.9 | Too big | |
| 8 GB | Q4_K_M | 2.6 | Too big |
Estimates for single-stream decoding at Q4_K_M; real tokens/sec varies with prompt length, context, batch size, and runtime build. Prompt processing (prefill) is faster than the decode figures shown here.
Quick picks
Best hardware
Run this model
Quantization
How much VRAM Granite Code 20B (20B) needs at each GGUF quant, and whether it fits a 24 GB card (RTX 4090 / 3090). The recommended Q4_K_M uses ~12.2 GB — about 43% less VRAM than Q8_0, at a small quality cost.
| Quant | Bits | VRAM (weights) | Quality | Fits 24 GB? |
|---|---|---|---|---|
| Q2_K | 2 | 7.8 GB | Low | Fits |
| Q3_K_S | 3 | 9.8 GB | Low | Fits |
| NVFP4 | 4 | 11.2 GB | Medium | Fits |
| Q4_K_Mrecommended | 4 | 12.2 GB | Medium | Fits |
| Q5_K_M | 5 | 14.4 GB | High | Tight |
| Q6_K | 6 | 16.4 GB | High | Offloads |
| Q8_0 | 8 | 21.4 GB | Very High | Heavy offload |
| F16 | 16 | 41 GB | Maximum | Too big |
VRAM shown is quantized weights only; add ~1–3 GB runtime overhead plus KV cache for your context length. Lower quants trade quality for memory — Q4_K_M is the usual sweet spot; Q2/Q3 only when you must fit a bigger model.
Quality benchmarks
Coding
Source: official · 2024-05-07
Hardware compatibility
Computing compatibility...
Memory breakdown
Frequently asked questions
Granite Code 20B (20B parameters) requires approximately 17.2 GB of VRAM with Q4_K_M quantization. Lower quantizations like Q4_K_M use less memory but may reduce quality.
Yes, Intel Arc Pro B60 24GB can run Granite Code 20B with a compatibility score of 82/100. It provides 24 GB of memory and achieves approximately 21.8 tokens per second.
The recommended quantization for Granite Code 20B is Q4_K_M, which offers the best balance between model quality and memory efficiency. Higher quantizations preserve more quality but require more VRAM.
The top recommended hardware for Granite Code 20B: RTX 4090 24GB (score: 86/100), RTX 5090 Laptop 24GB (score: 85/100), NVIDIA A30 24GB (score: 85/100). These provide the best combination of memory, bandwidth, and compute for running this model locally.
Yes, Granite Code 20B is well-suited for code. It was designed with these use cases in mind.
See also