Why You Should Ditch Windows for Linux When Training Machine Learning Models

Why You Should Ditch Windows for Linux When Training Machine Learning Models

As someone who’s dabbled in machine learning, I recently spent two days comparing the experience of training models on Windows 10 and Ubuntu 24.04. I wanted to see if the internet’s claims about Linux being better suited for ML tasks held water. Spoiler alert: they do.

My computer’s a beast, with a 7800X3D processor, 32GB of 6000MHz CL30 RAM, a 3080ti GPU, and an NVME drive that can hit 9000MB/s read and write speeds. So, I figured I’d get decent performance regardless of the OS. But the results were staggering.

On Windows, each epoch of my simple Flower Classifier model took an average of 53.78 seconds. Not terrible, but not great either. Installation was a breeze, and I used ChatGPT to help with coding and imports. However, when I switched to Ubuntu, the difference was night and day.

After wrestling with Arch Linux (let’s just say it wasn’t a great experience), I moved to Ubuntu and managed to install Docker Engine, set up my environment, and get the model running. And that’s when I saw the magic happen: each epoch took a mere 5.78 seconds on average. That’s a 10x speedup!

So, what’s behind this massive difference? In my opinion, it’s largely due to Windows’ poor I/O performance and the superiority of ext4 over NTFS. My GPU and CPU were barely breaking a sweat, and the code, libraries, and software were identical across both systems. The real bottleneck was file loading and movement, which Linux handled with ease.

If you’re planning to train models at home, take it from me: don’t waste your time on Windows. Spend a day or two learning the terminal, Docker Engine, and Ubuntu, and you’ll be rewarded with significantly faster training times.

Trust me, it’s worth the effort.

Leave a Comment

Your email address will not be published. Required fields are marked *