{"slug": "apple-silicon-llm-memory-bandwidth-sizing-dataset", "title": "Apple Silicon LLM Memory Bandwidth & Sizing Dataset", "summary": "An engineer published a free open dataset and Python CLI kit for sizing local LLM inference on Apple Silicon, covering 17 verified Mac SKUs and 14 open-weight model profiles. The work documents four common sizing traps, including that binned M3 Pro and M4 Max chips have narrower memory buses than their full-die counterparts, that Q4_K_M GGUF weights actually run about 4.85 bits per weight rather than 4.0, and that Metal's wired-memory limit caps usable GPU RAM at roughly 67% on machines with 24 GB or less and 75% on 32 GB and above. It also provides a roofline function that estimates token throughput from memory bandwidth, weights and KV-cache size, with typical realized performance at 65%–80% of the theoretical ceiling.", "body_md": "Engineers buying a MacBook Pro, Mac mini, or Mac Studio for local LLM inference routinely get burned by misleading rules of thumb. \"Just divide parameters by two for 4-bit\" or \"an M3 Pro is always faster than an M2 Pro\" sounds convenient—until a 32B model swaps to SSD or decodes 35% slower than expected. Four hardware and math traps explain almost every sizing surprise on Apple Silicon:\n\n`150 GB/s`), making single-stream token decode slower than the older M2 Pro (`200 GB/s`). Similarly, binned `M3 Max (14c/30c GPU)` runs at `300 GB/s` (384-bit) while the full `M3 Max (16c/40c GPU)` runs at `400 GB/s` (512-bit), and binned `M4 Max (14c/32c GPU)` runs at `410 GB/s` vs `546 GB/s` on the full 16c/40c die.`4.0 bpw` underestimates real GGUF weights by ~20%`llama.cpp` / MLX GGUF quantizations, embedding layers, output projection heads, and quantization block scales push effective `Q4_K_M` storage closer to `4.85 bpw` (not `Qwen2.5-32B`, that difference is `3.4 GB` of unexpected RAM.`64 GB` Mac does not give Metal `67%` on `<= 24 GB` machines and `75%` on `>= 32 GB` machines (`48 GB` usable on a `sysctl iogpu.wired_limit_mb`.` Qwen2.5-7B` uses `4` KV heads, `Phi-4-14B` uses `10` KV heads, and `Gemma-2-9B` uses `head_dim=256` with alternating 50% global / 50% sliding-window-4096 attention layers. Ignoring hybrid sliding-window attention overstates Gemma-2 KV memory by up to 2× at long context.\nAutoregressive token generation (batch size 1) is strictly **memory-bandwidth bound**: for every single token emitted, the GPU streams all active model weights plus the active KV cache across unified memory. You can compute an exact, zero-guesswork roofline in pure Python:\n\n```\nQUANT_BPW = {\"Q4_K_M\": 4.85, \"Q5_K_M\": 5.70, \"Q6_K\": 6.56, \"Q8_0\": 8.50, \"FP16\": 16.0}\n\ndef roofline_estimate(bandwidth_gbs: float, params_b: float, layers: int,\n                      kv_heads: int, head_dim: int, ctx: int,\n                      quant: str = \"Q4_K_M\", kv_bytes: float = 2.0,\n                      hybrid_swa_4096: bool = False) -> dict:\n    weights_gb = params_b * (QUANT_BPW[quant] / 8.0)\n    if hybrid_swa_4096:\n        g_layers = layers // 2\n        s_layers = layers - g_layers\n        kv_gb = (2 * kv_heads * head_dim * kv_bytes * (g_layers * ctx + s_layers * min(ctx, 4096))) / 1e9\n    else:\n        kv_gb = (2 * layers * kv_heads * head_dim * kv_bytes * ctx) / 1e9\n    active_gb = weights_gb + kv_gb\n    ceiling = bandwidth_gbs / active_gb\n    return {\n        \"weights_gb\": round(weights_gb, 2),\n        \"kv_cache_gb\": round(kv_gb, 2),\n        \"roofline_tok_s\": round(ceiling, 1),\n        \"typical_range_tok_s\": (round(ceiling * 0.65, 1), round(ceiling * 0.80, 1)),\n    }\n```\n\nBefore downloading a 40 GB GGUF file, verify both OS headroom and the Metal wired-memory ceiling:\n\n``` php\ndef usable_gpu_gb(ram_gb: int, os_reserve_gb: float = 4.0) -> float:\n    wired_ratio = 0.67 if ram_gb <= 24 else 0.75\n    return max(0.0, min(ram_gb - os_reserve_gb, ram_gb * wired_ratio))\n```\n\n`GB/s` (`10^9 B/s`). Computing `weights_gb` and `kv_cache_gb` in matching decimal GB (`10^9 B`) keeps the dimensional ratio `GB/s / GB = tok/s` exact.`65%–80%` of theoretical memory bandwidth during single-stream decode due to dequantization compute, attention overhead, and cache misses. Always plan around the realized band, not the 100% ceiling.`M4 Max 14c/32c` is `36 GB` only; `M3 Ultra` ships in `96 / 256 / 512 GB`; there is no `M4 Ultra`).\nUse the **Interactive Apple Silicon LLM Sizing Calculator** to explore all **17 verified Apple Silicon SKUs** and **14 published open-weight LLM profiles**, toggle `FP16` vs `Q8_0` KV-cache precision, and inspect `FITS` / `TIGHT` / `OOM` status instantly in your browser.\n\nYou can download the complete **$0.00 Free Open Dataset & Python CLI Kit** (Gumroad, GitHub Release, and Kaggle Datasets), including identical canonical `apple_silicon_specs.csv`/`.json` and `llm_arch_profiles.csv`/`.json` files, `llm_sizing_cli.py` (`estimate`, `matrix --format md|csv|json`, `validate`), `METHODOLOGY.md`, and `test_llm_sizing.py`.", "url": "https://wpnews.pro/news/apple-silicon-llm-memory-bandwidth-sizing-dataset", "canonical_source": "https://dev.to/luan_nguyen/apple-silicon-llm-memory-bandwidth-sizing-dataset-3oem", "published_at": "2026-12-05 05:03:57+00:00", "updated_at": "2026-12-05 05:14:03.697373+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "ai-tools", "mlops"], "entities": ["Apple", "MacBook Pro", "Mac Studio", "Mac mini", "M3 Pro", "M4 Max", "M3 Ultra", "llama.cpp"], "also_reported_by": [], "takeaway": "Q4_K_M GGUF weights actually occupy about 4.85 bits per parameter, not 4.0, so a 32B model needs roughly 3.4 GB more RAM than the naive estimate, and single-stream decode should be planned at 65%–80% of theoretical memory bandwidth.", "recommendation": {"advice": "Size local Mac LLM deployments with the 4.85 bpw Q4_K_M figure and the 67%/75% Metal wired-memory cap, and budget throughput at 65%–80% of the chip's memory bandwidth.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/apple-silicon-llm-memory-bandwidth-sizing-dataset", "markdown": "https://wpnews.pro/news/apple-silicon-llm-memory-bandwidth-sizing-dataset.md", "text": "https://wpnews.pro/news/apple-silicon-llm-memory-bandwidth-sizing-dataset.txt", "jsonld": "https://wpnews.pro/news/apple-silicon-llm-memory-bandwidth-sizing-dataset.jsonld"}}