Is DOOM a Tensor? | LIVE165

In this session, Anthony Shaw creatively demonstrates that the classic game Doom can be run as a tensor within an ONNX model by compiling and interpreting its machine code, highlighting the theoretical versatility but practical inefficiency of such an approach. He emphasizes the importance of understanding the relationship between AI models, tensors, and hardware optimization to improve performance and effectively leverage AI capabilities.

In this engaging and fast-paced session, Anthony Shaw explores the intriguing question: “Is Doom a tensor?” Starting with a basic explanation of tensors as multi-dimensional arrays used in machine learning models, he illustrates how simple operations like summing an array can be considered tensor computations. Using tools like Netron, he demonstrates how AI models, such as text embedding models, are structured with inputs, weights, and instructions, emphasizing that models are more than just static weights—they include computational graphs that process data.

Anthony then takes a creative detour into the concept of running Doom, the classic 1995 video game, within a tensor framework. He explains that since ONNX models are Turing complete, theoretically, they can emulate any computation, including running Doom. To explore this, he discusses compiling Doom into RISC-V machine code and then interpreting that code purely within ONNX nodes, effectively treating the game’s RAM as a tensor. This ambitious project involved disassembling Doom’s machine code using Excel formulas and even running a CPU emulator inside a spreadsheet, highlighting the extreme flexibility and limitations of such approaches.

The demonstration reveals that while it is possible to run Doom inside an ONNX model, the performance is extremely slow—rendering one frame could take hours, making it impractical for real-time gameplay. Anthony shares insights on optimizing such AI-driven computations, including caching outputs, reducing computational workload, and scaling hardware. He also discusses the importance of benchmarking and guiding AI tools like Copilot to improve performance effectively, stressing that without proper benchmarks, AI may make inefficient optimization choices.

Despite the impracticality, the session underscores a key takeaway: tensors and AI models are fundamentally tied to the hardware they run on, and understanding this relationship is crucial. Models downloaded from repositories like Hugging Face may not be optimized for every device, especially new GPUs or tensor cores, which can lead to suboptimal performance. Anthony encourages developers to deepen their knowledge of how models interact with hardware to make better use of AI capabilities.

In conclusion, Anthony affirms that yes, Doom can be considered a tensor in this experimental context, though it’s not recommended as a practical approach. The talk blends humor, technical depth, and creative exploration to shed light on the nature of tensors, AI model execution, and hardware optimization. The session ends with a reflection on the learning journey and the importance of understanding the computational underpinnings of AI models in modern computing.