User runs an AI model on an Xbox 360 — 3-core PowerPC with 512 MB memory handles an AI model based on llama2.c

3 days ago 12

X (formerly Twitter) user Andrei David just installed and ran an AI model based on Andrej Karpathy’s llama2.c on a nearly 20-year-old Xbox 360 console. Despite its age, David used a bootloader to load the model onto the old console and run a ‘Sleep Joe said’ prompt. According to the post, EXO Lab’s successful attempt to run Llama on a Windows 98 PC inspired David to experiment.

Although the AI LLM that the Xbox 360 used is based on the same one in EXO Lab’s Windows 98 Pentium II PC, David said that he had to optimize the code for the console's PowerPC architecture and unique (at the time) memory management features. The most significant difference is that PowerPC is a big-endian company that first stores the most significant value.

At the same time, the Intel Pentium II processor used for EXO Lab’s implantation is little-endian, which prioritizes storing the smallest value first. So, to ensure that the model would work properly, he had to implement a byte-swapping system and ensure that any data created and stored had proper 128-byte memory alignment, as required by the Xbox 360’s memory subsystem.

LLM running on Xbox 360 With Xenon CPU (3.2GHz PowerPC w/ 3 cores) and 512MB unified RAM. Based on @karpathy's🩷llama2.c, ported to run on Microsoft's powerful console from 2005. Pure C implementation optimized for PowerPC architecture and Xbox memory management. Inspired by… pic.twitter.com/e9oMLaWIyiJanuary 10, 2025

Another challenge that David faced was the console’s use of unified memory. While this is common today for modern consoles and APUs, this was a new frontier when the Xbox 360 launched, forcing game developers to ensure that their titles would best use the console’s hardware. So, even though it had 512MB of RAM, Andrei had to ensure that the 60MB model would fit in the amount of space that the system would allocate to the CPU or GPU since they shared the same RAM pool.

However, with careful memory management and adjustment to how the PowerPC works, he made the ancient Xbox 360 console run the LLM. This is another step towards EXO Lab’s goal of giving the average person access to AI, not limiting it to mega corporations that spend billions of dollars on top-of-the-line equipment and consume megawatts of power.

Running a Llama 2-based AI model on a decades-old device is already a fantastic feat, but one user commented that 512MB of unified RAM should be more than enough to run Hugging Face’s SmolLM or the 4-bit 0.5B Qwen2.5 model. Andrei David replied, ‘Challenge accepted! :)’, so we’re looking forward to seeing more powerful AI models run on an Xbox 360 in the future.

Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.

Read Entire Article