AIToday
Large Language ModelsQiita 機械学習Published: Nov 26, 2026, 01:00 JST

32B model at 32k context × 4 requests needs 34.16 GiB, not 16 GiB

Send on LINE
32B model at 32k context × 4 requests needs 34.16 GiB, not 16 GiB

3 Key Points

  1. What happened

    The estimate splits weights (16.36 GiB), KV cache and runtime overhead; at 8,192 context × 1 request the total is 19.16 GiB, but 32,768 × 4 requests reaches 34.16 GiB.

  2. Why it matters

    Quantizing weights alone leaves the KV cache scaling linearly with context length and concurrency, so the shortcut estimate understates total memory as those grow.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

This is a hands-on verification piece rather than a vendor announcement. Its starting point is the shortcut many teams use when planning a local inference box: multiply parameter count by quantization bits, and a 32B model at 4-bit looks like it fits in 16 GiB, comfortably inside a 24GB card. The author argues that arithmetic holds only for short contexts and single requests.

The verification separates memory into three parts. Static weights are the part quantization directly reduces. The KV cache — computed as 2 × layers × KV heads × head dimension × context length × concurrency × bytes — grows in a straight line with both context and parallel requests, and is governed by the GQA ratio and whether the KV cache itself is quantized. Framework reservation adds a measured 1.2 to 2.5 GiB.

Applied to a 32B model with 64 layers, 8 KV heads and head dimension 128, the weight figure stays fixed at 16.36 GiB while the total swings widely. The author pairs this with a second calculation that compares on-premise cost — GPU purchase price, power draw, utilization hours and electricity rate — against metered cloud API pricing to find a break-even month. The accompanying simulator is credited to AKASHIC ZERO.

FAQ
Why does the simple parameters-times-bits estimate fail?
It only covers static model weights. The KV cache grows linearly with context length and the number of parallel requests, and framework overhead adds roughly 1.2 to 2.5 GiB on top.
Does quantizing the KV cache help?
Yes. Moving from FP16 to 8-bit KV cache halves the KV portion: the 32,768 context × 4-request case falls from 34.16 GiB to 26.16 GiB total.
Is there a tool to try these numbers?
The author publishes a free browser-based simulator that recalculates required VRAM and the cloud API break-even point as you change model size, context length, concurrency and electricity price.
Qiita 機械学習Read Original Article
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleTalorys sets up on free Cloudflare with one command