Files
ComfyUI/comfy
Adi Borochov 4f4f8659c2 fix: guard torch.AcceleratorError for compatibility with torch < 2.8.0 (#12874)
* fix: guard torch.AcceleratorError for compatibility with torch < 2.8.0

torch.AcceleratorError was introduced in PyTorch 2.8.0. Accessing it
directly raises AttributeError on older versions. Use a try/except
fallback at module load time, consistent with the existing pattern used
for OOM_EXCEPTION.


* fix: address review feedback for AcceleratorError compat

- Fall back to RuntimeError instead of type(None) for ACCELERATOR_ERROR,
  consistent with OOM_EXCEPTION fallback pattern and valid for except clauses
- Add "out of memory" message introspection for RuntimeError fallback case
- Use RuntimeError directly in discard_cuda_async_error except clause
---------
2026-03-11 10:04:13 -07:00
..
2024-06-27 18:43:11 -04:00
2026-02-26 01:30:31 -05:00
2025-01-24 06:15:54 -05:00
2025-07-06 07:07:39 -04:00
2026-01-01 22:06:14 -05:00
2026-03-05 13:35:56 -05:00