Open-source governor avoids PyTorch OOMs on 8GB GPUs by dynamically downshifting batch size

uBazzyZ- · reddit · 2026-09-11

Frustrated by random CUDA OOM crashes while training small models locally on an 8GB RTX 5060 Ti, the author built a lightweight Python governor around PyTorch, MEM Orchestrator (open source):

Branches: main is the Linux core with DeepSpeed ZeRO integration; refactor/architecture-and-portability is a decoupled native PyTorch runner, cross-platform (tested on Windows).

The author ran a 1M-step endurance test on a 130M model and stress-tested a 255M model with injected memory spikes without crashing, with under 0.5% overhead. Code and 38 unit tests are on GitHub; feedback from PyTorch allocator/DeepSpeed folks welcome.

Related event: Open-Source Memory Orchestrator Stops CUDA OOM on 8GB GPUs(2 posts)→

Original post →

More from coding & agent

coding & agent channel →