Open-LLaMA LLM: Versions, Prompt Templates & Hardware Requirements

Updated: 2023-08-31 |
Base model
|
instruct

Explore all versions of the model, their file formats like GGML, GPTQ, and HF, and understand the hardware requirements for local inference.

OpenLLaMA is an open-source endeavor to replicate the LLaMA language model. It's trained on the expansive RedPajama dataset, a project by Together that mirrors the original LLaMA training dataset with over 1.2 trillion tokens. While its preprocessing and training methodology align with the original LLaMA's framework, the primary distinction lies in the dataset source.

OpenLLaMA's v1 models utilize the RedPajama dataset, while v2 models blend inputs from Falcon refined-web, StarCoder, and select segments of the RedPajama dataset like Wikipedia, arxiv, books, and StackExchange.

Additional information about OpenLLaMA 

The OpenLLaMA model was specially fine-tuned to be better at following instructions. The training was done by VMware and used the Alpaca prompt format and pulled together a bunch of different datasets to improve its understanding and response skills.

Two big ones were the Open-instruct and Open-instruct-v1 datasets. It also used data from Mosaic/Dolly-HHRLHF and a filtered part of OASST1 under the 'cc by 3.0' license. Some examples from the COT SUBMIX in FLAN V2 were thrown in too, aimed at zero-shot learning. Plus datasets like ESNLI, ECQA, Strategy, CREAK, gsmk8, aqua, and qasc to cover different instruction-based situations.

In simpler terms, VMware took the original OpenLLaMA model and customized it by training on a mix of instruction-focused datasets. 

Hardware requirements

The performance of an Open-LLaMA model depends heavily on the hardware it's running on. For recommendations on the best computer hardware configurations to handle Open-LLaMA models smoothly, check out this guide: Best Computer for Running LLaMA and LLama-2 Models.

Below are the Open-LLaMA hardware requirements for 4-bit quantization:

For 7B Parameter Models

If the 7B open-llama-13b-open-instruct-GGML model is what you're after, you gotta think about hardware in two ways. First, for the GPTQ version, you'll want a decent GPU with at least 6GB VRAM. The GTX 1660 or 2060, AMD 5700 XT, or RTX 3050 or 3060 would all work nicely. But for the GGML / GGUF format, it's more about having enough RAM. You'll need around 4 gigs free to run that one smoothly.

Format RAM Requirements VRAM Requirements
GPTQ (GPU inference) 6GB (Swap to Load*) 6GB
GGML / GGUF (CPU inference) 4GB 300MB
Combination of GPTQ and GGML / GGUF (offloading) 2GB 2GB

*RAM needed to load the model initially. Not required for inference. If your system doesn't have quite enough RAM to fully load the model at startup, you can create a swap file to help with the loading.

For 13B Parameter Models

For beefier models like the open-llama-13b-open-instruct-GGML, you'll need more powerful hardware. If you're using the GPTQ version, you'll want a strong GPU with at least 10 gigs of VRAM. AMD 6900 XT, RTX 2060 12GB, RTX 3060 12GB, or RTX 3080 would do the trick. For the CPU infgerence (GGML / GGUF) format, having enough RAM is key. You'll want your system to have around 8 gigs available to run it smoothly.

Format RAM Requirements VRAM Requirements
GPTQ (GPU inference) 12GB (Swap to Load*) 10GB
GGML / GGUF (CPU inference) 8GB 500MB
Combination of GPTQ and GGML / GGUF (offloading) 10GB 10GB

*RAM needed to load the model initially. Not required for inference. If your system doesn't have quite enough RAM to fully load the model at startup, you can create a swap file to help with the loading.

Memory speed

When running Open-LLaMA AI models, you gotta pay attention to how RAM bandwidth and mdodel size impact inference speed. These large language models need to load completely into RAM or VRAM each time they generate a new token (piece of text). For example, a 4-bit 7B billion parameter Open-LLaMA model takes up around 4.0GB of RAM.

Suppose your have Ryzen 5 5600X processor and DDR4-3200 RAM with theoretical max bandwidth of 50 GBps. In this scenario, you can expect to generate approximately 9 tokens per second. Typically, this performance is about 70% of your theoretical maximum speed due to several limiting factors such as inference sofware, latency, system overhead, and workload characteristics, which prevent reaching the peak speed. To achieve a higher inference speed, say 16 tokens per second, you would need more bandwidth. For example, a system with DDR5-5600 offering around 90 GBps could be enough.

For comparison, high-end GPUs like the Nvidia RTX 3090 boast nearly 930 GBps of bandwidth for their VRAM. The DDR5-6400 RAM can provide up to 100 GB/s. Therefore, understanding and optimizing bandwidth is crucial for running models like Open-LLaMA efficiently

Recommendations:

  1. For Best Performance: Opt for a machine with a high-end GPU (like NVIDIA's latest RTX 3090 or RTX 4090) or dual GPU setup to accommodate the largest models (65B and 70B). A system with adequate RAM (minimum 16 GB, but 64 GB best) would be optimal.
  2. For Budget Constraints: If you're limited by budget, focus on Open-LLaMA GGML/GGUF models that fit within the sytem RAM. Remember, while you can offload some weights to the system RAM, it will come at a performance cost.

Remember, these are recommendations, and the actual performance will depend on several factors, including the specific task, model implementation, and other system processes.

CPU requirements

For best performance, a modern multi-core CPU is recommended. An Intel Core i7 from 8th gen onward or AMD Ryzen 5 from 3rd gen onward will work well. CPU with 6-core or 8-core is ideal. Higher clock speeds also improve prompt processing, so aim for 3.6GHz or more.

Having CPU instruction sets like AVX, AVX2, AVX-512 can further improve performance if available. The key is to have a reasonably modern consumer-level CPU with decent core count and clocks, along with baseline vector processing (required for CPU inference with llama.cpp) through AVX2. With those specs, the CPU should handle Open-LLaMA model size.