Show HN: I ran a language model on a PS2 (github.com)
The Emotion Engine has 32 MB of RAM total, so the trick is streaming weights from CD-ROM one matrix at a time during the forward pass — only activations, KV cache and embeddings live in RAM. This means models bigger than the RAM can still run, they just read more from disc.
Had to build a custom quantized format (PSNT), hack endianness, write a tokenizer pipeline, and most of the PS2 SDK from scratch (releasing that separately). The model itself is also custom — a 10M param Llama-style architecture I trained specifically for this.
And it works. On real hardware.
10 comments
[ 2.6 ms ] story [ 41.3 ms ] threadI doubt the VUs can help with inference given their small scratchpad sizes and instruction set though, haha.
The HDD is the fastest form of I/O one can use on the PS2. It might not even need to be modified - depending on how well it's coded, it may be possible to run this software via Open PS2 Loader, which will replace CDVDMAN with a custom version that will access USB/ETH/HDD (and as mentioned in sibling comments, USB on the PS2 is version 1.1 and is much slower than even the CDVD drive).
Both network and HDD will also greatly minimize the cost of seeking the CDVD, which may be an issue depending on how the CD is laid out. CD access is up to 24x, DVD-ROM access is at 4x. DVD is thus slightly faster, and can be further increased by pushing the used data to the edge of the disc via a dummy file (traditionally, developers and game modders used Sony's own CD/DVD Generator software to determine the order of files being added to the disc, thus allowing the boot files to come first, followed by the dummy file, then any data files that need the extra speed).