Skip to content

Can I run Llama 3.1 8B on NVIDIA RTX 4090 24GB?

Yes: Llama 3.1 8B runs on NVIDIA RTX 4090 24GB with F16 at roughly 38 tokens/s. Estimated memory 16.8 GiB at 8,192 tokens of context.

With F16 you can push the context to about 32,768 tokens before memory runs out (F16 KV cache).

Memory by quantisation (8,192-token context)

QuantisationMemoryVerdictEst. speed
F16Unquantized reference16.8 GiBFits~38 tok/s
Q8_0Near-lossless9.8 GiBFits~68 tok/s
Q6_KVery close to F168.0 GiBFits~86 tok/s
Q5_K_MGreat quality/size7.1 GiBFits~97 tok/s
Q4_K_MBest default for most6.4 GiBFits~110 tok/s
IQ4_XSSmaller 4-bit (imatrix)5.8 GiBFits~123 tok/s
Q3_K_MNoticeable loss5.5 GiBFits~131 tok/s
Q2_KLast resort; big loss5.0 GiBFits~148 tok/s

NVIDIA RTX 4090 24GB offers about 24 GiB of memory (94% usable for a model) at 1008 GB/s. Speed is a bandwidth-bound estimate of single-stream generation at 65% efficiency; real results vary by runtime, drivers and settings, so measure on your machine.

How this is calculated

Weights โ‰ˆ parameters ร— bits per weight รท 8. KV cache โ‰ˆ 2 ร— 32 layers ร— 8 KV heads ร— 128 head dim ร— 2 bytes per token. Decode speed โ‰ˆ efficiency ร— memory bandwidth รท bytes read per token. Learn the maths in VRAM math and memory bandwidth, or try the VRAM calculator.

Running slowly or out of memory? See CUDA out of memory and the quantisation lesson.