espnet2.torch_utils.device_funcs.is_out_of_memory_error
Less than 1 minute
espnet2.torch_utils.device_funcs.is_out_of_memory_error
espnet2.torch_utils.device_funcs.is_out_of_memory_error(exc: BaseException) → bool
Return whether exc, or an exception it was raised from, is an OOM.
CUDA raises torch.OutOfMemoryError; MPS raises a plain RuntimeError whose message starts with “MPS backend out of memory”. Both are covered, as is an OOM that a caller re-raised as another exception with raise ... from exc.
