GP

Gpt2 Xl

GptGGUF by mradermacherUpdated 2024-09-08
Download on Hugging Face
Parameters1.64B
Context1K
Layers48
Architecturegpt2
Smallest quant0.9 GB
Quick answer

Gpt2 Xl needs about 4.2 GB of memory at Q4_K_M (a 1.2 GB file) with an 8K context window, so it fits on a 6 GB GPU. This repository has 15 quants, from 0.9 GB (IQ3_S) to 3.3 GB (F16).

GPT‑2 XL 1.64B parameter language model in GGUF format

GPT‑2 XL is a 1.64‑billion‑parameter transformer model released by OpenAI. The GGUF version is available in multiple quantizations for use with llama.cpp. It is licensed under MIT.

Good at

  • Text generation
  • Language modeling
  • Creative writing

Limits

  • Context limited to 1024 tokens
  • No vision support
  • Requires 8‑k context for memory estimates

Best for

  • Chatbot prototypes
  • Script generation
  • Proofreading assistance

Who it’s for. Researchers and developers who need a large‑scale language model for experimentation or downstream applications. The model is suitable for those who can manage the memory requirements of the chosen quantization.

Quants & memory

QuantFileEst. memoryvs VRAMResultDownload
IQ3_S0.9 GB 1.7 GB
Fits Get file →
IQ3_XS0.9 GB 1.7 GB
Fits Get file →
Q2_K0.9 GB 1.7 GB
Fits Get file →
Q3_K_S0.9 GB 1.7 GB
Fits Get file →
IQ4_XS1.0 GB 1.8 GB
Fits Get file →
IQ3_M1.0 GB 1.8 GB
Fits Get file →
Q3_K_M1.0 GB 1.9 GB
Fits Get file →
Q3_K_L1.1 GB 1.9 GB
Fits Get file →
Q4_K_S1.1 GB 1.9 GB
Fits Get file →
Q4_K_M1.2 GB 2.0 GB
Fits Get file →
Q5_K_S1.2 GB 2.0 GB
Fits Get file →
Q5_K_M1.4 GB 2.2 GB
Fits Get file →
Q6_K1.6 GB 2.4 GB
Fits Get file →
Q8_01.7 GB 2.6 GB
Fits Get file →
F163.3 GB 4.1 GB
Fits Get file →

For 8‑GB VRAM, use Q4_K_S (file size 1.11 GB, estimated 4.1 GB memory). For 4‑GB VRAM, use IQ3_S or IQ3_XS (0.91 GB, 3.9 GB memory). For higher precision, choose Q8_0 (1.75 GB, 4.8 GB memory).

What GPU do you need for Gpt2 Xl?

These figures add the file size, an fp16 KV cache at an 8K context window (worked out from this model’s own header) and about 0.5 GB for the runtime. They are estimates, so leave a little headroom, and expect to use less context or a smaller quant if you are right at the limit.

  • 4 GB VRAM: the best quant that fits is IQ3_M (1.0 GB file, about 4.0 GB in use).
  • 6 GB VRAM: the best quant that fits is Q8_0 (1.7 GB file, about 4.8 GB in use).
  • 8 GB VRAM: the best quant that fits is F16 (3.3 GB file, about 6.3 GB in use).

Which Gpt2 Xl quant should you choose?

Q4_K_M is the usual starting point for Gpt2 Xl: it balances file size and quality well. Here it is a 1.2 GB file.

The Q8_0 file is 1.7 GB, about 1.5 times the size of Q4_K_M. It keeps the weights closer to the original, which only matters if you have the memory to spare.

If memory is tight, the smallest file is IQ3_S at 0.9 GB, with the quality trade-offs that come with fewer bits. A reasonable choice when a 4-bit file will not fit, mostly on larger models. Quality loss is noticeable but often acceptable.

New to quant names? Read GGUF quantization explained.

Specifications

Architecture from the GGUF header

Architecturegpt2
Parameters1.64B
Layers48
Trained context1,024 tokens
KV cache (fp16)300 KB per token

Source

Quantized bymradermacher
FamilyGpt
Licensemit
Downloads (HF)2,162
Last updated2024-09-08

Frequently asked questions about Gpt2 Xl

How much VRAM does Gpt2 Xl need?

About 4.2 GB at Q4_K_M with an 8K context window. That is the 1.2 GB file, plus the KV cache and roughly 0.5 GB of runtime overhead. Smaller quants need less and longer context needs more.

Can I run Gpt2 Xl on an 8 GB GPU?

Yes, with F16: the 3.3 GB file needs about 6.3 GB at 8K context. Larger quants in this repository do not fit in 8 GB.

What is the file size of Gpt2 Xl GGUF?

It depends on the quant: IQ3_S is 0.9 GB, IQ3_XS is 0.9 GB, Q2_K is 0.9 GB, Q3_K_S is 0.9 GB, IQ4_XS is 1.0 GB, IQ3_M is 1.0 GB and 9 more.

What context length does Gpt2 Xl support?

The GGUF header lists a trained context length of 1,024 tokens (1K). The KV cache grows with the context you use: about 2.5 GB at 8K and 0.3 GB at 1K.

Where can I download Gpt2 Xl GGUF?

The files are on Hugging Face in the mradermacher/gpt2-xl-GGUF repository. The download buttons on this page open the file on Hugging Face. ggufmodels.com does not host any model files.

What license does Gpt2 Xl use?

Hugging Face lists the license as mit. Licenses can differ between the quantized files and the original model, so check the repository and the base model before commercial use.

Can I run GPT‑2 XL on 8 GB VRAM?

Yes, with the Q4_K_S quantization it requires about 4.1 GB of VRAM at 8‑k context.

What is the maximum context length?

The model supports up to 1024 tokens of context.

Is the model licensed for commercial use?

It is released under the MIT license, which allows commercial use.

Other GGUFs of gpt2-xl

Similar models

Browse all →

More from mradermacher

All by mradermacher →

More Gpt models

All Gpt →

Other tiny models

All tiny models →