AltiVec vmsummbm accelerates llama2.c on Power Mac G5

pub.towardsai.net16 min read

An author ports a language model inference engine to a 2004 PowerPC Macintosh running MorphOS and Mac OS X Leopard, leveraging the historical AltiVec instruction vmsummbm to accelerate 8-bit integer matrix multiplication. The implementation achieves 13.7 tokens per second on a single core and up to 18.2 tokens per second across two processors under Leopard, demonstrating how 1999 vector instructions mirror modern neural network instructions like VNNI. Open article →