Training Memory Monitoring #
CUDA allocator sampling and drift warnings shared by TorchLean training loops.
Resolve an explicit CUDA-memory cadence, or enable periodic sampling for very long runs.
Instances For
Sample the CUDA allocator and warn when estimated allocation headroom keeps decreasing.
The estimate adds driver-free bytes to reserved-minus-allocated bytes, then caps that sum by the remaining configured memory-fraction budget. This avoids treating cache growth alone as a leak. Native allocations include library workspaces that can outlive TorchLean's buffer owners. Reserved storage is not necessarily reclaimable, samples are not atomic, and the fraction-to-byte conversion is approximate. The forecast is a drift warning, not a guarantee of successful allocation or a prediction of the exact step where allocation fails.