11 hours ago · 6 min read1160 words · Tech · hide

I wanted to compare two laptops on different GPU operations, related to deep learning. The two laptops I compared are: the MacBook Air M2 (8 CPU cores: 4 performance + 4 efficiency, 8 GPU cores), 16GB of unified memory — macOS 27.1, the Lenovo Yoga Slim 7 Ultra 14IPH11, with an Intel Core Ultra 7 355 (8 cores: 4P + 4 low-power E) and an integrated Intel Xe3 GPU — Fedora Linux 45 (Silverblue). To be honest, I expected both machines to be roughly equal, with a slight advantage for the MacBook Air M2… but that was not the case. Both machines run the same PyTorch benchmark script, but the device backend differs: the Yoga uses XPU and the MacBook uses MPS (Metal Performance Shaders). I wanted to benchmark different parts, so I measured: MatMul: a 4096x4096 matrix multiplication, MLP Forward: a fully-connected forward pass, Attention: an attention pass, and Train Step: a full forward + backward + optimizer step. The code is available here. The shapes are shown next to each line, and TFLOPS…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town